title: Azure DevOps pipeline unable to deploy Blazor Wasm app to Static Web App due to package from private Nuget feed
body: <p>I try to deploy a Blazor Wasm application from my Azure DevOps repo to an Azure static web app. My app is based on the standard template, but is also using a Nuget package hosted in private feed in Azure Artifacts. I have tried several combinations of pipeline tasks but none seem to do the trick.</p>
  <p><em>Attempt 1: The essentials</em></p>
  <pre class="lang-yaml prettyprint-override"><code>trigger:
  - main
  
  pool:
    vmImage: ubuntu-latest
  
  steps:
  - checkout: self
    submodules: true
  - task: AzureStaticWebApp@0
    inputs:
      app_location: 'src/[project_name]'
      output_location: 'wwwroot'
      azure_static_web_apps_api_token: '[my_token]'
  </code></pre>
  <p>The task fails with a clear error, indicating that the private nuget feed hosting the package is not used:</p>
  <pre><code>Determining projects to restore...
  /working_dir/src/[project_folder]/[project_name].csproj : error NU1101: Unable to find package [my_private_package_in_private_feed]. No packages exist with this id in source(s): nuget.org
    Failed to restore /working_dir/src/[project_folder]/[project_name].csproj (in 7.91 sec).
  </code></pre>
  <p>Since there is no feedsToUse and vstsFeed configuration options for this task, I looked into restoring the Nuget packages separately.</p>
  <p><em>Attempt 2: Adding Nuget restore</em></p>
  <pre class="lang-yaml prettyprint-override"><code>- task: DotNetCoreCLI@2
    displayName: 'dotnet restore'
    inputs:
      command: restore
      projects: '**/*.csproj'
      feedsToUse: 'select'
      vstsFeed: '[my_private_feed]'
  </code></pre>
  <p>Adding the above dotnet restore task successfully registers the private feed and restores the nuget package from it, but it seems this registration is not available to the deployment task coming next. The deploy task fails with the same error as above.</p>
  <p><em>Attempt 3: Skip the build during deploy</em></p>
  <p>My last attempt was trying to let the deploy task use the output from the previous tasks, so I set up a full dotnet build-publish pipeline, and set skip_app_build to true in the deploy task, to avoid a build &amp; failing restore:</p>
  <pre class="lang-yaml prettyprint-override"><code>trigger:
  - main
  
  pool:
    vmImage: ubuntu-latest
  
  steps:
  - checkout: self
    submodules: true
  - task: DotNetCoreCLI@2
    displayName: 'dotnet restore'
    inputs:
      command: restore
      projects: '**/*.csproj'
      feedsToUse: 'select'
      vstsFeed: '[my_private_feed]'
  - task: DotNetCoreCLI@2
    displayName: 'Build'
    inputs:
      command: 'build'
      configuration: $(configuration)
      projects: '**/*.csproj'
  - task: DotNetCoreCLI@2
    displayName: 'Publish...'
    inputs:
      command: publish
      publishWebProjects: true
      arguments: '--configuration Release --output $(Build.ArtifactStagingDirectory)'
      zipAfterPublish: false
  - task: AzureStaticWebApp@0
    inputs:
      skip_app_build: true
      app_location: 'src/[project_folder]'
      output_location: 'wwwroot'
      azure_static_web_apps_api_token: '[my_token]'
  </code></pre>
  <p>This produces the following error, saying the (published?) default files are missing:</p>
  <pre><code>App Directory Location: '[app_location]' was found.
  No Api directory specified. Azure Functions will not be created.
  Skipping step to build /working_dir/src/[project_folder] with Oryx
  Failed to find a default file in the app artifacts folder ([app_location]). Valid default files: index.html,Index.html.
  If your application contains purely static content, please verify that the variable 'app_location' in your deployment configuration file points to the root of your application.
  If your application requires build steps, please validate that a default file exists in the build output directory.
  </code></pre>
  <p>For <code>app_location</code>, as per instructions <a href="https://docs.microsoft.com/en-us/azure/static-web-apps/publish-devops" rel="nofollow noreferrer">here</a>, I used the location of the csproj file (src/[project_folder]), where indeed no index.html or other default file exists. However when I use src/[project_folder]/wwwroot, I get past the above error.</p>
  <p>For <code>output_location</code>, wwwroot is what most tutorials use, but they don't use the full-blown pipeline approach. I have also tried to match the output folders from the build (../bin/Release/net5.0/wwwroot) and the publish ($(Build.ArtifactStagingDirectory)/[project_folder]) tasks.</p>
  <p>Regardless of which folder I use, the pipeline completes, but when opening the web app, it looks like some but not all files got deployed:</p>
  <p><a href="https://i.stack.imgur.com/2o8f8.png" rel="nofollow noreferrer">Network traffic when opening the application</a></p>
  <p>I don't know where to go from here.</p>