App Services Quickstart Guide

Welcome to the Azure App Services quickstart! This guide will walk you through the essential steps to deploy your first web application to Azure App Services. By the end, you'll have a running application accessible on the internet.

Note: This guide assumes you have an Azure account. If not, you can create a free Azure account to get started.

Prerequisites

Before you begin, ensure you have the following:

Steps to Deploy Your First App

  1. Create an App Service Plan

    An App Service plan defines a set of computing resources for your web app to run. You can think of it as the environment where your application will be hosted.

    az appservice plan create --name MyWebAppPlan --resource-group MyResourceGroup --location "East US" --sku B1

    This command creates a new App Service plan named MyWebAppPlan in the East US region with the B1 pricing tier (Basic).

  2. Create a Web App

    Now, let's create the actual web app resource that will host your code. This web app will be associated with the App Service plan you just created.

    az webapp create --resource-group MyResourceGroup --plan MyWebAppPlan --name MyFirstWebApp --deployment-local-git

    This command creates a web app named MyFirstWebApp. The --deployment-local-git flag enables local Git deployment, which is a common and straightforward method.

  3. Deploy Your Code

    There are several ways to deploy your code. For simplicity, we'll use local Git deployment.

    First, clone the Git repository provided by Azure for your web app:

    git clone https://@myfirstwebapp.scm.eastus.azurewebsites.net/MyFirstWebApp.git MyWebAppRepo
    cd MyWebAppRepo

    Replace <your_username> with your Azure deployment credentials. You can find these credentials in the Azure portal under your web app's "Deployment Center".

    Now, copy your application files into this repository. If you have a simple index.html file, place it in the root of this directory.

    Commit your changes and push them to Azure:

    git add .
    git commit -m "Initial commit"
    git push origin master
  4. Verify Your Deployment

    Once the push is complete, your web application should be live! You can visit it using the default URL provided by Azure.

    Your web app's URL will be in the format: https://MyFirstWebApp.azurewebsites.net

    Open this URL in your web browser to see your deployed application.

Tip: For more advanced deployment options, explore Azure DevOps Pipelines, GitHub Actions, or Docker container deployments.

Next Steps

Congratulations on deploying your first application! Here are some suggestions for what to do next: