question

UrielMhezzek avatar image
0 Votes"
UrielMhezzek asked ryanchill edited

Blazor WASM Server hosted, error on rolemanager

I trying my first steps with Azure. I blazor wasm server hosted in a azure web app on linux base. My code works on my local system, but it dosn't work on azure server.

i identified with many uploads my app the line with error, i think here comes a error, but i don't know why.

 var adminRoleInDb = await _roleManager.FindByNameAsync(RoleConstants.AdministratorRole);


First i search the logs. I looked at the logstream, but i don't see any error there and no of my log messages, too. I don't know, what i can do, to identify the error.

azure-webappsdotnet-aspnet-core-blazor
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The one line of code does not help us to understand how your code is designed. Can you explain what "doesn't work on azure server" means? What are your expectations?

If you created a hosted Blazor application then the role manager is running on the hosted Razor Pages site not the Blazor WASM application (runs in your browser). Is there anyway you can provide a bit more information on how your application is designed?

0 Votes 0 ·

1 Answer

ryanchill avatar image
0 Votes"
ryanchill answered

Hi @UrielMhezzek,

A good place to start would be ASP.NET Core Blazor WebAssembly with Azure Active Directory groups and roles App Role section which has outlines steps on how you can configure and interact with roles. You didn't indicate the what error you're actually getting but I'm thinking you haven't setup the app roles in your application.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.