How do I configure appsettings for blazor wasm apps deployed on azure static web apps?

pvanroos 20 Reputation points
2024-08-19T05:48:26.4133333+00:00

how do I configure appsettings for blazor wasm apps deployed on azure static web apps?

I tried lots of different things. I'm trying to change different items based on the env it's deployed to.

Is there any really good guidance? The documentation is not good.

Developer technologies | .NET | Blazor
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,174 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2024-08-19T16:19:00.6433333+00:00

    the app settings for blazor wasm is just the deployed wwwroot/appsettings.json file. your deployment or build system can create the correct file. Blazor WASM also support setting the env via the Blazor.Start javascript on the host page, or http header (blazor-environment) to define the environment.

    to add a custom header to static web apps you configure its settings:

    https://learn.microsoft.com/en-us/azure/static-web-apps/configuration#global-headers

    0 comments No comments

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.