Skip to content

Latest commit

 

History

History
95 lines (61 loc) · 3.15 KB

cache-web-app-bicep-with-redis-cache-provision.md

File metadata and controls

95 lines (61 loc) · 3.15 KB
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

Create a Web App plus Azure Cache for Redis using Bicep

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.

Review the Bicep file

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:

Deploy the Bicep file

  1. Save the Bicep file as main.bicep to your local computer.

  2. 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.

Review deployed resources

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

Clean up resources

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

Next steps

To learn more about Bicep, continue to the following article: