I want to publish my VS solution to Azure static web app, I'm using the template that has Blazor WASM, a .Net Core API and Authentication with Identity inside the API.
It works fine on my local machine but after being published as an Azure static web app, it runs but remains authorizing...
The error is:
Could not load settings from '_configuration'
This is the browser console:
Client - program.cs:
public class Program
{
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.Services.AddHttpClient("x.ServerAPI", client => client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress))
.AddHttpMessageHandler<BaseAddressAuthorizationMessageHandler>();
// Supply HttpClient instances that include access tokens when making requests to the server project
builder.Services.AddScoped(sp => sp.GetRequiredService<IHttpClientFactory>().CreateClient("x.ServerAPI"));
builder.Services.AddApiAuthorization();
await builder.Build().RunAsync();
}
}
Need help making this work...