Skip to content

Latest commit

 

History

History
80 lines (54 loc) · 5.04 KB

File metadata and controls

80 lines (54 loc) · 5.04 KB

Deploy your app to Azure

Deployment to Azure App Services

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.

Create Azure App Service and Publish the Project using Visual Studio

Follow the link to Create Azure App Service and Publish Project with Visual Studio.

Create Azure App Service and Publish the Project using Visual Studio Code

Create WebApp-blazor-wasm in Azure App Services

  1. Sign in to the Azure portal.
  2. 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.
  3. Next, select the Subscription, Resource Group, App service plan and Location. OS will be Windows and Publish will be Code.
  4. Select Create and wait for the App Service to be created.
  5. Once you get the Deployment succeeded notification, then select on Go to resource to navigate to the newly created App service.

Publish the project

  1. Install the VS Code extension Azure App Service.

  2. Sign-in to App Service using Azure AD Account.

  3. Open the WebApp-blazor-wasm project folder.

  4. Choose View > Terminal from the main menu.

  5. The terminal opens in the WebApp-blazor-wasm folder.

  6. Run the following command:

    dotnet publish --configuration Release
  7. Publish folder is created under path bin/Release/<Enter_Framework_FolderName>.

  8. Right Click on Publish folder and select Deploy to Web App.

  9. Select Create New Web App, enter unique name for the app.

  10. Select Windows as the OS. Press Enter.

Update Azure App Services Configuration

  1. Go to Azure portal.
    • On the Settings tab, select Authentication / Authorization. Make sure App Service Authentication is Off. Select Save.
  2. Browse your website. If you see the default web page of the project, the publication was successful.

Update the Azure AD app registration for WebApp-blazor-wasm

  1. 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).
  2. In the resulting screen, select the WebApp-blazor-wasm application.
  3. In the app's registration screen, select Authentication in the menu.
  4. 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.

More information

Community Help and Support

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.

Contributing

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.