staticwebapp.config.json for Azure Service Apps

425 Views Asked by At

So I have an Azure Service App hosting a Service Side Blazor Application. I also have 2 Virtual Application in the Azure Service App for hosting 2 Static Applications (Angular).

Virtual Path         Physical Path             App type
/                    site\wwwroot              Blazor
/tourofheroes        site\tourofheroes         Angular
/gettingstarted      site\gettingstarted       Angular

When I launch one of the Angular Apps in the Virtual Application and navigate thru application (e.g. https://myblazorapp.azurewebsites.net/TourOfHeroes/detail/12) everything works as expected.

However, when I refresh I get an error message: "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable." This is a well known issue with static apps like React & Angular.

I know using Github workflows I can include a file "staticwebapp.config.json" to include a NavigatioFallback & Rewrite rule which handles this issue. However, all 3 repo's reside on Azure Git.

The question: is there a way to apply Github Workflows and staticwebapp.config.json rules to an Azure Build & Release Pipeline?

Thank in advance for you help.

1

There are 1 best solutions below

1
Mohit Ganorkar On

Yes , you can apply github workflow to the azure pipelines.

For that first you need to authenticate yourself using personal access tokens which are used to connect the azure devops to the github.

Once this is done you can create the workflow , commit/push the workflow and then click on actions tab in github to select the azure pipeline.

Refer the following documentation for detailed explanation.