Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Note
This isn't the latest version of this article. For the current release, see the .NET 9 version of this article.
Warning
This version of ASP.NET Core is no longer supported. For more information, see the .NET and .NET Core Support Policy. For the current release, see the .NET 9 version of this article.
Important
This information relates to a pre-release product that may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
For the current release, see the .NET 9 version of this article.
This article explains how to host and deploy standalone Blazor WebAssembly with Microsoft Azure Static Web Apps.
Deploy from Visual Studio
To deploy from Visual Studio, create a publish profile for Azure Static Web Apps:
Save any unsaved work in the project, as a Visual Studio restart might be required during the process.
In Visual Studio's Publish UI, select Target > Azure > Specific Target > Azure Static Web Apps to create a publish profile.
If the Azure WebJobs Tools component for Visual Studio isn't installed, a prompt appears to install the ASP.NET and web development component. Follow the prompts to install the tools using the Visual Studio Installer. Visual Studio closes and reopens automatically while installing the tools. After the tools are installed, start over at the first step to create the publish profile.
In the publish profile configuration, provide the Subscription name. Select an existing instance, or select Create a new instance. When creating a new instance in the Azure portal's Create Static Web App UI, set the Deployment details > Source to Other. Wait for the deployment to complete in the Azure portal before proceeding.
In the publish profile configuration, select the Azure Static Web Apps instance from the instance's resource group. Select Finish to create the publish profile. If Visual Studio prompts to install the Static Web Apps (SWA) CLI, install the CLI by following the prompts. The SWA CLI requires NPM/Node.js (Visual Studio documentation).
After the publish profile is created, deploy the app to the Azure Static Web Apps instance using the publish profile by selecting the Publish button.
Deploy from Visual Studio Code
To deploy from Visual Studio Code, see Quickstart: Build your first static site with Azure Static Web Apps.
Deploy from GitHub
To deploy from a GitHub repository, see Tutorial: Building a static web app with Blazor in Azure Static Web Apps.
ASP.NET Core