Jason E Vetter
Jason E Vetter

Reputation: 1

Problem publishing azure static web app (blazor wasm) via devops because it's referencing nuget packages from remote source (not nuget.org)

I have a blazor web assembly app and it references a few nuget packages that exist as Artifacts in our Azure Devops source control. This web app gets published as an azure static web app. Everything works great if the blazor app only has package references to nuget.org but if I add a package from our devops artifacts, the app will not publish. Here is the error:

/working_dir/src/BlazorUI/BlazorUI.csproj : error NU1101: Unable to find package Ovcri.AspNetCore.Authentication. No packages exist with this id in source(s): nuget.org /working_dir/src/BlazorUI/BlazorUI.csproj : error NU1101: Unable to find package Ovcri.AspNetCore.Authentication.Extensions. No packages exist with this id in source(s): nuget.org Failed to restore /working_dir/src/BlazorUI/BlazorUI.csproj (in 2.66 sec). | 1 | Please build your app locally before publishing. | https://docs.microsoft.com/en-us/azure/app-service/configure-language-dotnetcore?pivots=platform-linux

I would think that something in the .yml file could instruct the build process to look in our devops as well as nuget.org but I have not been able to find anything.

I've read this but could not find a solution: https://learn.microsoft.com/en-us/azure/devops/pipelines/process/resources?view=azure-devops&tabs=example

Also Googled, of course.

Upvotes: 0

Views: 445

Answers (1)

RohitVarun
RohitVarun

Reputation: 68

  • I have tried a sample blaze with CI/CD pipelines instead of DeVops follow the below steps.
  • First, we need to create an azure static web app in azure portal as shown below.

enter image description here

  • Give the repository details that you are using if we use GitHub and you can also use AzureDevops as below.

enter image description here

  • Select the Blazer as the Build Presets as below and click on Review+Create as below.

enter image description here

  • After Clicking on review+Create it will deploy a Static web app an after run a CI/CD pipeline as below.

enter image description here

  • After Successful deployment open the URL in static web it will redirect to as below.

enter image description here

Upvotes: 0

Related Questions