Skip to content

Click on each book below to review & buy on Amazon.

As an Amazon Associate, I earn from qualifying purchases.


Azure - App Service Static Site Deployment

This guide provides a step-by-step approach to deploying a static HTML website to an Azure App Service. Azure App Service is a fully-managed platform for building, deploying, and scaling web apps, offering robust capabilities for hosting static websites. This runbook is particularly useful for developers and IT professionals looking to streamline their web deployment process on Azure.

Introduction to Static Site Deployment on Azure

Deploying a static website involves hosting simple HTML, CSS, and JavaScript files on a web server. Azure App Service facilitates this by providing a scalable and secure hosting environment. The process is straightforward, efficient, and can be automated, which makes Azure an excellent choice for hosting static content.

Prerequisites for Deployment

Before beginning the deployment process, ensure that you have completed the following prerequisites:

Required Setup

  1. Azure App Service Creation: If you haven't already created an Azure App Service, follow the guide provided to set up a new App Service instance. This is essential as it is the platform where your static site will be hosted.

  2. Azure App Service Configuration: Ensure that your App Service is properly configured to host a static site. This includes setting up the appropriate runtime environment and other necessary configurations.

  3. Azure CLI Access: Access to a terminal with Azure CLI installed is crucial. Azure CLI is a set of commands used to manage Azure resources. Ensure that the CLI is authenticated to Azure with the appropriate permissions. Azure Cloud Shell can also be used as an alternative.

  4. Website Preparation: The static website content should be packaged into a zip file (e.g., site.zip). This file should be accessible from the location where you are running the Azure CLI or Cloud Shell.

Deployment Process

Setting the Azure Subscription

Ensure you are operating in the correct Azure subscription context. Use the following Azure CLI commands:

az account set --subscription [Subscription-ID]
az account show

Replace [Subscription-ID] with your specific Azure subscription ID.

Preparing for Deployment

  1. Locate the App Service Details:

    • Navigate to the Overview page of your Web App in the Azure portal.
    • Note the Resource Group name and the Web App Name. These details are critical for the deployment command.
  2. Deploy the Static Site:

    • Change to the directory containing your website's zip file.
    • Use the Azure CLI to deploy the website to the specified App Service.

    Deployment Command Example:

    cd /path/to/zip
    
    az webapp deploy --resource-group [Resource-Group-Name] \
                     --name [Web-App-Name] \
                     --type zip --src-path site.zip
    

    Replace [Resource-Group-Name] and [Web-App-Name] with your actual resource group and web app name.

Monitoring Deployment

  1. Access Deployment Center:

    • In the Azure portal, under your App Service, select Deployment Center.
    • Navigate to the Logs tab to monitor the deployment process.
  2. Deployment Status:

    • After a few minutes, the status should show Success (Active), indicating that your website has been successfully deployed.

    app-services-deploy-center

Viewing the Deployed Website

Once the deployment is successful, you can view your static website:

  • In the Azure portal, within your App Service, select Browse to open your deployed website in a new browser tab.

Support DTV Linux

Click on each book below to review & buy on Amazon. As an Amazon Associate, I earn from qualifying purchases.

NordVPN ®: Elevate your online privacy and security. Grab our Special Offer to safeguard your data on public Wi-Fi and secure your devices. I may earn a commission on purchases made through this link.