title | description | author | ms.service | ms.topic | ms.date | ms.author |
---|---|---|---|---|---|---|
Provision Web App that uses Azure Cache for Redis using Bicep |
Use Bicep to deploy web app with Azure Cache for Redis. |
mijacobs |
app-service |
conceptual |
05/24/2022 |
mijacobs |
In this article, you use Bicep to deploy an Azure Web App that uses Azure Cache for Redis, as well as an App Service plan.
[!INCLUDE About Bicep]
You can use this Bicep file for your own deployments. The Bicep file provides unique names for the Azure Web App, the App Service plan, and the Azure Cache for Redis. If you'd like, you can customize the Bicep file after you save it to your local device to meet your requirements.
For more information about creating Bicep files, see Quickstart: Create Bicep files with Visual Studio Code. To learn about Bicep syntax, see Understand the structure and syntax of Bicep files.
The Bicep file used in this quickstart is from Azure Quickstart Templates.
:::code language="bicep" source="~/quickstart-templates/quickstarts/microsoft.web/web-app-with-redis-cache/main.bicep":::
With this Bicep file, you deploy:
-
Save the Bicep file as main.bicep to your local computer.
-
Deploy the Bicep file using either Azure CLI or Azure PowerShell.
az group create --name exampleRG --location eastus az deployment group create --resource-group exampleRG --template-file main.bicep
New-AzResourceGroup -Name exampleRG -Location eastus New-AzResourceGroupDeployment -ResourceGroupName exampleRG -TemplateFile ./main.bicep
When the deployment finishes, you should see a message indicating the deployment succeeded.
Use the Azure portal, Azure CLI, or Azure PowerShell to list the deployed resources in the resource group.
az resource list --resource-group exampleRG
Get-AzResource -ResourceGroupName exampleRG
When no longer needed, use the Azure portal, Azure CLI, or Azure PowerShell to delete the resource group and its resources.
az group delete --name exampleRG
Remove-AzResourceGroup -Name exampleRG
To learn more about Bicep, continue to the following article: