Azure / Azure/static-web-apps

Not able to resolve packages from private nuget

Open
#954 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
346
Forks
67
PR merge metrics
No merged PRs in 30d

Description

We have deployed a Blazor WASM project into Azure Static Apps and the WASM project references several packages in our private Nuget.

When running the GitHub action as generated by Azure Static Web Apps, we get an error at the Build and Deploy step when restoring the Blazor WASM project as it is unable to find the package(s) that is/are in the private nuget service.

`
/github/workspace/NextWare.Portal.Wasm/NextWare.Portal.Wasm.csproj : error NU1101: Unable to find package NextWare.CoreServices.Meta.SharedModels. No packages exist with this id in source(s): nuget.org`

We have Nuget.Config within the WASM project folder as well as the root folder for the solution.

Here is our workflow as generated by Azure Static Web Apps...

```
name: Azure Static Web Apps CI/CD

on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- main

jobs:
build_and_deploy_job:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
name: Build and Deploy Job
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Add Private Nuget source
run: dotnet nuget add source SourceToNugetService --name NameOfNugetService
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_JOLLY_SKY_0E29A4D0F }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: "upload"
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
#app_location: "path/to/blazorWasm" # App source code path
app_location: "NextWare.Portal.Wasm"
api_location: "" # Api source code path - optional
#output_location: "wwwroot" # Built app content directory - optional
skip_api_build: true
###### End of Repository/Build Configurations ######

close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_JOLLY_SKY_0E29A4D0F }}
action: "close"
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.