There is one web project in this sample. To deploy it to Azure App Services, you'll need to:
- create an Azure App Service
- publish the projects to the App Services, and
- update its client(s) to call the web site instead of the local environment.
Follow the link to Create Azure App Service and Publish Project with Visual Studio.
- Sign in to the Azure portal.
- Select
Create a resource
in the top left-hand corner, select Web --> Web App, and give your web site a name, for example,WebApp-blazor-wasm.azurewebsites.net
. - Next, select the
Subscription
,Resource Group
,App service plan and Location
.OS
will be Windows andPublish
will be Code. - Select
Create
and wait for the App Service to be created. - Once you get the
Deployment succeeded
notification, then select onGo to resource
to navigate to the newly created App service.
-
Install the VS Code extension Azure App Service.
-
Sign-in to App Service using Azure AD Account.
-
Open the WebApp-blazor-wasm project folder.
-
Choose View > Terminal from the main menu.
-
The terminal opens in the WebApp-blazor-wasm folder.
-
Run the following command:
dotnet publish --configuration Release
-
Publish folder is created under path
bin/Release/<Enter_Framework_FolderName>
. -
Right Click on Publish folder and select Deploy to Web App.
-
Select Create New Web App, enter unique name for the app.
-
Select Windows as the OS. Press Enter.
- Go to Azure portal.
- On the Settings tab, select Authentication / Authorization. Make sure
App Service Authentication
is Off. Select Save.
- On the Settings tab, select Authentication / Authorization. Make sure
- Browse your website. If you see the default web page of the project, the publication was successful.
- Navigate back to to the Azure portal. In the left-hand navigation pane, select the Azure Active Directory service, and then select App registrations (Preview).
- In the resulting screen, select the
WebApp-blazor-wasm
application. - In the app's registration screen, select Authentication in the menu.
- Update the Logout URL section with the address of your service, for example https://WebApp-blazor-wasm.azurewebsites.net/signout-oidc
- In Redirect URI section, add the URL https://WebApp-blazor-wasm.azurewebsites.net/authentication/login-callback. If you have multiple redirect URIs, make sure that there is a new entry using the App service's URI for each redirect URI.
- From the Branding menu, update the Home page URL, to the address of your service, for example https://WebApp-blazor-wasm.azurewebsites.net. Save the configuration.
⚠️ If your app is using an in-memory storage, Azure App Services will spin down your web site if it is inactive, and any records that your app was keeping will emptied. In addition, if you increase the instance count of your web site, requests will be distributed among the instances. Your app's records, therefore, will not be the same on each instance.
Use Stack Overflow to get support from the community.
Ask your questions on Stack Overflow first and browse existing issues to see if someone has asked your question before.
Make sure that your questions or comments are tagged with [azure-active-directory
] [msal
] [dotnet
].
If you find a bug in the sample, raise the issue on GitHub Issues.
To provide feedback on or suggest features for Azure Active Directory, visit User Voice page.
If you'd like to contribute to this sample, see CONTRIBUTING.MD.
This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.