Skip to content
Get Started for Free

Web App

Azure Web App lets you deploy and run web applications without managing underlying infrastructure. It supports multiple runtimes, app configuration, and integration with App Service plans. Web App is useful for quickly building and testing hosted HTTP applications.

LocalStack for Azure allows you to build and test Web App workflows in your local environment. The supported APIs are available on our API Coverage section, which provides information on the extent of Web App’s integration with LocalStack.

This guide is designed for users new to Web App and assumes basic knowledge of the Azure CLI and our azlocal wrapper script.

Start your LocalStack container using your preferred method. Then start CLI interception:

Terminal window
azlocal start_interception

Create a resource group for your Web App resources:

Terminal window
az group create \
--name rg-web-demo \
--location westeurope
Output
{
"name": "rg-web-demo",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-web-demo",
"location": "westeurope",
"properties": {
"provisioningState": "Succeeded"
},
...
}

Create an App Service plan that will host the web app:

Terminal window
az appservice plan create \
--name asp-web-doc89 \
--resource-group rg-web-demo \
--location westeurope \
--sku F1
Output
{
"name": "asp-web-doc89",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-web-demo/providers/Microsoft.Web/serverfarms/asp-web-doc89",
"location": "westeurope",
"provisioningState": "Succeeded",
"sku": {
"name": "B1",
"tier": "Basic",
...
},
...
}

Create a web app using a Python runtime:

Terminal window
az webapp create \
--name ls-web-doc89 \
--resource-group rg-web-demo \
--plan asp-web-doc89 \
--runtime "PYTHON:3.11"
Output
{
"name": "ls-web-doc89",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-web-demo/providers/Microsoft.Web/sites/ls-web-doc89",
"type": "Microsoft.Web/sites",
"location": "westeurope",
"defaultHostName": "ls-web-doc89.azurewebsites.net",
"state": "Running",
...
}

Get the web app:

Terminal window
az webapp show \
--name ls-web-doc89 \
--resource-group rg-web-demo

Read the current web app configuration:

Terminal window
az webapp config show \
--name ls-web-doc89 \
--resource-group rg-web-demo
Output
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-web-demo/providers/Microsoft.Web/sites/ls-web-doc89/config/web",
"linuxFxVersion": "PYTHON|3.11",
"http20Enabled": true,
"alwaysOn": false,
"ftpsState": "FtpsOnly",
...
}

Update web app configuration:

Terminal window
az webapp config set \
--name ls-web-doc89 \
--resource-group rg-web-demo \
--always-on false \
--http20-enabled true
Output
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-web-demo/providers/Microsoft.Web/sites/ls-web-doc89",
"http20Enabled": true,
"alwaysOn": false,
...
}

Delete the web app and verify it no longer appears:

Terminal window
az webapp delete \
--name ls-web-doc89 \
--resource-group rg-web-demo
az webapp list --resource-group rg-web-demo
Output
[]
OperationImplemented
Page 1 of 0
Was this page helpful?