Azure App Service is a fully managed platform for building, deploying, and scaling web applications, RESTful APIs, and mobile backends. It supports multiple languages, including .NET, Java, Node.js, and more.
Azure App Service offers an effortless way to deploy and manage ASP.NET Core applications with high availability and scalability.
Follow these steps to deploy your ASP.NET Core application:
// Sign up for Azure if you don’t have an account:
// https://azure.microsoft.com/free/
Log in to the Azure Portal at https://portal.azure.com.
// Use Visual Studio to publish the application:
// 1. Right-click your project in Solution Explorer.
// 2. Select "Publish".
// 3. Choose "Folder" as the target.
// 4. Click "Publish" to generate files locally.
The application is now ready for deployment.
// In the Azure Portal:
// 1. Click "Create a Resource".
// 2. Search for "App Service" and select it.
// 3. Click "Create".
// 4. Fill in the required details:
// - Subscription: Select your subscription.
// - Resource Group: Create or choose an existing group.
// - App Name: Give your app a unique name.
// - Runtime Stack: Select ".NET 7 (LTS)" or your desired version.
// - Region: Choose a region near your users.
// 5. Click "Review + Create" and then "Create".
Wait for the App Service to be provisioned.
// In Visual Studio:
// 1. Right-click your project in Solution Explorer.
// 2. Select "Publish".
// 3. Choose "Azure" as the target and click "Next".
// 4. Sign in to your Azure account.
// 5. Select the App Service you created.
// 6. Click "Publish".
Visual Studio will deploy the application to Azure App Service.
// Install Azure CLI if not already installed:
// https://learn.microsoft.com/en-us/cli/azure/install-azure-cli
// Log in to Azure:
az login
// Deploy your application:
az webapp up --name --resource-group --runtime "DOTNETCORE:7.0"
This command builds and deploys the application directly from your project folder.
// Open the URL of your App Service:
// https://.azurewebsites.net
Your application should now be live and accessible!
// In the Azure Portal:
// 1. Go to your App Service.
// 2. Under "Deployment Center", configure GitHub or Azure DevOps for automatic deployment.
This ensures any new changes are automatically deployed.