title | titleSuffix | description | author | ms.author | ms.date | ms.service | ms.topic | ms.custom |
---|---|---|---|---|---|---|---|---|
Create an Azure App Configuration store using Bicep |
Azure App Configuration |
Learn how to create an Azure App Configuration store using Bicep. |
schaffererin |
v-eschaffer |
05/06/2022 |
azure-app-configuration |
quickstart |
subject-armqs, devx-track-azurepowershell, mode-arm |
This quickstart describes how you can use Bicep to:
- Deploy an App Configuration store.
- Create key-values in an App Configuration store.
- Read key-values in an App Configuration store.
[!INCLUDE About Bicep]
If you don't have an Azure subscription, create a free account before you begin.
The Bicep file used in this quickstart is from Azure Quickstart Templates.
:::code language="bicep" source="~/quickstart-templates/quickstarts/microsoft.appconfiguration/app-configuration-store-kv/main.bicep":::
Two Azure resources are defined in the Bicep file:
- Microsoft.AppConfiguration/configurationStores: create an App Configuration store.
- Microsoft.AppConfiguration/configurationStores/keyValues: create a key-value inside the App Configuration store.
With this Bicep file, we create one key with two different values, one of which has a unique label.
-
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 --parameters configStoreName=<store-name>
New-AzResourceGroup -Name exampleRG -Location eastus New-AzResourceGroupDeployment -ResourceGroupName exampleRG -TemplateFile ./main.bicep -configStoreName "<store-name>"
[!NOTE] Replace <store-name> with the name of the App Configuration store.
When the deployment finishes, you should see a message indicating the deployment succeeded.
Use Azure CLI or Azure PowerShell to list the deployed resources in the resource group.
az resource list --resource-group exampleRG
Get-AzResource -ResourceGroupName exampleRG
You can also use the Azure portal to list the resources:
- Sign in to the Azure portal.
- In the search box, enter App Configuration, then select App Configuration from the list.
- Select the newly created App Configuration resource.
- Under Operations, select Configuration explorer.
- Verify that two key-values exist.
When no longer needed, use Azure CLI or Azure PowerShell to delete the resource group and its resources.
az group delete --name exampleRG
Remove-AzResourceGroup -Name exampleRG
You can also use the Azure portal to delete the resource group:
- Navigate to your resource group.
- Select Delete resource group.
- A tab will appear. Enter the resource group name and select Delete.
To learn about adding feature flag and Key Vault reference to an App Configuration store, check out the ARM template examples.