Azure App Service is a fully managed platform for building, deploying, and scaling web apps, mobile backends, and API apps. It supports a variety of programming languages and frameworks, and provides built-in DevOps capabilities.
Azure App Service enables you to build and host web applications, REST APIs, and mobile backends in your preferred programming language without managing infrastructure. It also provides:
To get started, you'll need:
An App Service plan is a prerequisite for creating a web app. It determines the underlying compute resources and pricing tier.
Using Azure CLI:
az appservice plan create --name MyFreeAppServicePlan --resource-group MyResourceGroup --sku F1 --is-linux
Replace MyFreeAppServicePlan and MyResourceGroup with your desired names. F1 denotes the Free tier. The --is-linux flag specifies a Linux environment.
Once you have an App Service plan, you can create your web app. You can deploy code from various sources.
Using Azure CLI (deploying a sample Node.js app):
az webapp create --name MyFirstWebApp12345 --resource-group MyResourceGroup --plan MyFreeAppServicePlan --runtime "node|18-lts"
Replace MyFirstWebApp12345 with a globally unique name for your web app. Replace MyResourceGroup and MyFreeAppServicePlan with the names you used previously. "node|18-lts" specifies the runtime stack.
You can deploy your application code using Git, FTP, or integration with CI/CD services.
For Git deployment, you can enable it on your web app:
az webapp deployment source config-zip --resource-group MyResourceGroup --name MyFirstWebApp12345 --src .\app.zip
This example deploys a zip file. You can also deploy directly from a local Git repository.
Your web app is now running and accessible via its URL.
You can find the URL in the Azure portal or by using the CLI:
az webapp show --resource-group MyResourceGroup --name MyFirstWebApp12345 --query "defaultHostName" --output tsv
Open this URL in your browser to see your deployed application.