Skip to content

JeremyLikness/AzureBlazorCosmosWasm

Repository files navigation

Azure Active Directory from a Blazor WebAssembly App to Access Cosmos DB

A completely serverless solution to access Cosmos DB from Blazor WebAssembly using EF Core.

To configure your application and learn more, read:

Azure AD Secured Serverless Cosmos DB from Blazor WebAssembly

"Quick" start

  1. Optional: fork the repo
  2. git clone https://github.com/jeremylikness/AzureBlazorCosmosWasm.git (or your fork)
  3. Create an app registration for the Blazor app (there is an Azure CLI script for this linked in the comments of the blog post)
  4. Update wwwroot/appsettings.json in the Blazor WebAssembly client to use the tenant (directory) and client id
  5. Create a Cosmos DB database and seed some initial values
  6. Deploy the Azure Functions app
  7. Add the Cosmos DB connection string as "CosmosConnection" under connection strings for the Azure Functions app
  8. Update authentication for the Azure Functions app to use Azure AD
  9. Update wwwroot/appsettings.json in the Blazor WebAssembly project to point to your functions app (under "TokenClient: Endpoint")
  10. Run it!