Muokkaa

Jaa


Create an Azure App Configuration store with PowerShell

This sample script creates a new instance of Azure App Configuration in a new resource group using PowerShell.

If you don't have an Azure subscription, create an Azure free account before you begin.

To execute the sample scripts, you need a functional setup of Azure PowerShell.

Open a PowerShell window with admin rights and run Install-Module -Name Az to install Azure PowerShell

Sample script

# Create a resource group 
New-AzResourceGroup -Name <resource-group-name> -Location <location>

# Create an App Configuration store
New-AzAppConfigurationStore -Name <store-name> -ResourceGroupName <resource-group-name> -Location <location> -Sku <sku>

# Get the App Configuration connection string 
Get-AzAppConfigurationStoreKey -Name <store-name> -ResourceGroupName <resource-group-name>

Clean up resources

Clean up the resources you deployed by deleting the resource group.

Remove-AzResourceGroup -Name <resource-group-name> 

Script explanation

This script uses the following commands to create a new resource group and an App Configuration store. Each command in the table links to command specific documentation.

Command Notes
New-AzResourceGroup Creates a resource group in which all resources are stored.
New-AzAppConfigurationStore Creates an App Configuration store resource.
Get-AzAppConfigurationStoreKey Lists access keys for an App Configuration store.

Next steps

For more information about Azure PowerShell, check out the Azure PowerShell documentation.

More App Configuration script samples for PowerShell can be found in the Azure App Configuration PowerShell samples.