Azure App Service: Quickstart Tutorial

This guide will walk you through the process of deploying your first web application to Azure App Service. App Service is a fully managed platform for building, deploying, and scaling web apps and APIs. You can use Node.js, .NET, Java, Python, PHP, or Ruby to build your apps.

Prerequisites

Before you begin, ensure you have the following:

Step 1: Create a Resource Group

Create a Resource Group

A resource group is a logical container for your Azure resources. It helps you manage related resources together.

Open your terminal or command prompt and run the following Azure CLI command:

az group create --name myResourceGroup --location eastus

This command creates a resource group named myResourceGroup in the eastus region.

Step 2: Create an App Service Plan

Create an App Service Plan

An App Service plan defines a set of compute resources for your web app to run on. It determines the location, size, and features of the web server farm.

Run the following command to create a new App Service plan:

az appservice plan create --name myAppServicePlan --resource-group myResourceGroup --sku F1 --is-linux

Step 3: Create a Web App

Create a Web App

Now, create the web app itself, linking it to the App Service plan.

Execute this command:

az webapp create --resource-group myResourceGroup --plan myAppServicePlan --name myuniqueappname --runtime "node:18-lts"

Step 4: Deploy Your Application

Deploy Your Application

For this quickstart, we'll use deployment from a local Git repository. Make sure your application code is in a local Git repository and committed.

First, enable local Git deployment for your web app:

az webapp deployment source config-local-git --name myuniqueappname --resource-group myResourceGroup

This command will output Git credentials. Add these as a remote to your local Git repository:

git remote add azure 

Now, push your code to Azure:

git push azure master

You will be prompted for the Git username and password generated by the az webapp deployment command.

Step 5: Verify Your Deployment

Verify Your Deployment

Once the deployment is complete, you can access your web app by navigating to its URL in a web browser.

The URL will be in the format: http://myuniqueappname.azurewebsites.net

You should see your deployed web application!

Next Steps

Congratulations on deploying your first web app to Azure App Service!

View More Tutorials