Sign in during Public Preview to get the Team plan free, plus an early-adopter discount when we launch. Sign in
This guide shows you how to provision a Web App against Locally. As with the other guides we're going to use the Azure CLI, but the same resources can be provisioned with HashiCorp Terraform, Pulumi or Bicep too.
az) installed.Firstly, we need to launch Locally which we can do from a terminal by running:
$
locally build
Once Locally has started, the Locally Dashboard will open automatically:
Next we can create the Resource Group:
$
locally run az group create -n sample-resources -l berlin
There's two things to note here:
locally run.locally run when you do.A Web App runs on an App Service Plan, which is the compute it's scheduled onto - so that comes first:
$
locally run az appservice plan create -g sample-resources -n sample-plan -l berlin --sku B1 --is-linux
{
"kind": "linux",
"name": "sample-plan",
"sku": "B1",
"state": "Succeeded"
}
Then the Web App itself, placed on that plan and given a runtime:
$
locally run az webapp create -g sample-resources -n samplewebapp1 --plan sample-plan --runtime NODE:24-lts
{
"defaultHostName": "samplewebapp1.furnace.locally:5663",
"kind": "app,linux",
"name": "samplewebapp1",
"state": "Running"
}
Note
That furnace.locally hostname is served by Locally's own DNS server and points at the Web App Emulator running on your machine.
At this point the app exists but has no code, so requesting it reports that it isn't ready yet - the same as a freshly created App Service in Azure before its first deployment. Deploying a build is the next step:
$
locally run az webapp deploy --resource-group sample-resources --name samplewebapp1 --src-path ./app.zip --type zip
We can list the apps and plans in the Resource Group:
$
locally run az webapp list -g sample-resources --query "[].{Name:name, State:state, Host:defaultHostName}" -o table
$
locally run az appservice plan list -g sample-resources --query "[].{Name:name, Sku:sku.name, Kind:kind}" -o table
We can see the Web App in the Locally Dashboard too:
Finally, we can tidy up. To remove the Resource Group and everything within it:
$
locally run az group delete -n sample-resources --yes
There's nothing billable to clean up, since everything ran on your machine, but it's still worth checking your teardown scripts work here before you run them against Azure.
Whilst this guide used the Azure CLI, App Service works the same way through any of the tooling that Locally supports - a Microsoft.Web/sites resource in HashiCorp Terraform or OpenTofu, Pulumi, Bicep or an ARM Template all provision against Locally in the same way, with only the location changed.
To give the app a database, see PostgreSQL Flexible Server or MySQL Flexible Server. For event-driven code on App Service, see Function App.
Should you encounter any issues, please take a look at the troubleshooting section.
Sign in during Public Preview to get the Team plan free, plus an early-adopter discount when we launch. Sign in
Your Azure infrastructure, running on your machine. Deploy in seconds, break things freely, and ship to Azure when you're ready.