title: How reference nuget packages in C# project from Feed of Azure Artifacts and deploy using Github actions
body: <p>I created a Blazor Web Assembly project, this project references a package, this package resides in an external nuget source(Azure artifact feed).</p>
  <p>I created the feed in Azure. ✅<br />
  I successfuly upload the *.nupkg of the library/external package to Azure feed ✅<br />
  I created a Personal Access Token - PAT in Azure - for use in GitHhub ✅<br />
  I tested with Visual Studio locally and works ✅</p>
  <p>but the project not compile with Github Actions<br />
  I created a secret in my Github project configuration with the PAT value. ✅</p>
  <p><strong>Error</strong></p>
  <pre><code>Successfully installed workload(s) wasm-tools.
  
    Determining projects to restore...
  /github/workspace/Insta3D.MainSite/Insta3D.MainSite.csproj : error NU1101: Unable to find package Insta3D.Common. No packages exist with this id in source(s): nuget.org
    Failed to restore /github/workspace/Insta3D.MainSite/Insta3D.MainSite.csproj (in 1.58 sec).
  </code></pre>
  <p>My Github workflow action.</p>
  <pre><code>name: Azure Static Web Apps CI/CD
  
  on:
    push:
      branches:
        - main
    pull_request:
      types: [opened, synchronize, reopened, closed]
      branches:
        - main
  env:
    AZURE_FEED_NAME: Insta3DNugetFeed
    AZURE_FEED_SOURCE: &quot;https://pkgs.dev.azure.com/Insta3D/Insta3D/_packaging/Insta3DNugetFeed/nuget/v3/index.json&quot;
    BUILD_CONFIGURATION: 'Release'    # set this to the appropriate build configuration
    DOTNET_VERSION: '6.x'
  jobs:
    build_and_deploy_job:
      if: github.event_name == 'push' || (github.event_name == 'pull_request' &amp;&amp; github.event.action != 'closed')
      runs-on: ubuntu-latest
      name: Build and Deploy Job
      steps:
        - uses: actions/checkout@v2
          with:
            submodules: true
        - name: Restore packages
          run: |
            pwsh -NoLogo -ExecutionPolicy Bypass -Command &quot;./AddNugetSource.ps1 -FeedName ${{ env.AZURE_FEED_NAME }} -FeedSource ${{ env.AZURE_FEED_SOURCE }} -AzurePAT ${{ secrets.AZURE_Insta3D_READ_PAT }}&quot;
        - 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_PURPLE_WAVE_0AF3AD50F }}
            repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
            action: &quot;upload&quot;
            ###### 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: &quot;Insta3D.MainSite&quot; # App source code path
            api_location: &quot;api&quot; # Api source code path - optional
            output_location: &quot;wwwroot&quot; # Built app content directory - optional
            ###### End of Repository/Build Configurations ######
  
    close_pull_request_job:
      if: github.event_name == 'pull_request' &amp;&amp; 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_PURPLE_WAVE_0AF3AD50F }}
            action: &quot;close&quot;
  
  </code></pre>
  <p><strong>AddNugetSource.ps1</strong></p>
  <pre><code>[CmdletBinding()]
  param (
      [Parameter()]
      [string]
      $FeedName,
  
      [Parameter()]
      [string]
      $FeedSource,
  
      [Parameter()]
      [string]
      $AzurePAT
  )
  
  $ErrorActionPreferenceOriginal = $ErrorActionPreference
  try {
      $ErrorActionPreference = &quot;Ignore&quot;
      dotnet nuget remove source $FeedName 2&gt;&amp;1
      dotnet nuget add source &quot;$FeedSource&quot; --name &quot;$FeedName&quot; --username az --password &quot;$AzurePAT&quot; --store-password-in-clear-text
      dotnet restore &quot;Insta3D.MainSite.sln&quot;
  }
  finally {
      $ErrorActionPreference = $ErrorActionPreferenceOriginal
  }
  </code></pre>