|
| 1 | +--- |
| 2 | +title: PowerShell Script Sample - Create an Azure App Configuration Store |
| 3 | +titleSuffix: Azure App Configuration |
| 4 | +description: Create an Azure App Configuration store using a sample PowerShell script. See reference article links to commands used in the script. |
| 5 | +services: azure-app-configuration |
| 6 | +author: maud-lv |
| 7 | +ms.service: azure-app-configuration |
| 8 | +ms.topic: sample |
| 9 | +ms.date: 01/18/2023 |
| 10 | +ms.author: malev |
| 11 | +ms.custom: devx-track-azurepowershell |
| 12 | +--- |
| 13 | + |
| 14 | +# Create an Azure App Configuration store |
| 15 | + |
| 16 | +This sample script creates a new instance of Azure App Configuration in a new resource group. |
| 17 | + |
| 18 | +[!INCLUDE [quickstarts-free-trial-note](../../../includes/quickstarts-free-trial-note.md)] |
| 19 | + |
| 20 | +To execute the sample scripts, you need a functional setup of [Azure PowerShell](/powershell/azure/). |
| 21 | + |
| 22 | +1. Open a PowerShell window with admin rights and run `Install-Module -Name Az` to install Azure PowerShell |
| 23 | +1. Run: `Install-Module -Name Az.AppConfiguration` to install the App Configuration module. |
| 24 | + |
| 25 | +## Sample script |
| 26 | + |
| 27 | +```powershell |
| 28 | +
|
| 29 | +# Create resource group |
| 30 | +New-AzResourceGroup -Name <rg-name> -Location <location> |
| 31 | +
|
| 32 | +# Create App Configuration store |
| 33 | +New-AzAppConfigurationStore -Name <store-name> -ResourceGroupName <rg-name> -Location <location> -Sku <sku> |
| 34 | +
|
| 35 | +# Get the AppConfig connection string |
| 36 | +Get-AzAppConfigurationStoreKey -Name <store-name> -ResourceGroupName <rg-name> |
| 37 | +``` |
| 38 | + |
| 39 | +[!INCLUDE [cli-script-cleanup](../../../includes/cli-script-clean-up.md)] |
| 40 | + |
| 41 | +## Script explanation |
| 42 | + |
| 43 | +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. |
| 44 | + |
| 45 | +| Command | Notes | |
| 46 | +|---|---| |
| 47 | +| [New-AzResourceGroup](/powershell/module/az.resources/new-azresourcegroup) | Creates a resource group in which all resources are stored. | |
| 48 | +| [New-AzAppConfigurationStore](/powershell/module/az.appconfiguration/new-azappconfigurationstore) | Creates an App Configuration store resource. | |
| 49 | +| [Get-AzAppConfigurationStoreKey](/powershell/module/az.appconfiguration/get-azappconfigurationstorekey) | List access keys for an App Configuration store. | |
| 50 | + |
| 51 | +## Next steps |
| 52 | + |
| 53 | +For more information on Azure PowerShell, see [Azure CLI documentation](/cli/azure). |
| 54 | + |
| 55 | +Additional App Configuration PowerShell script samples can be found in the [Azure App Configuration PowerShell samples](../powershell-samples.md). |
0 commit comments