共用方式為


使用 PowerShell 建立 Azure 應用程式組態存放區

此範例指令碼會在新資源群組中使用 PowerShell 建立新的 Azure 應用程式組態執行個體。

如果您沒有 Azure 訂用帳戶,請在開始之前先建立 Azure 免費帳戶

若要執行範例指令碼,您需要 Azure PowerShell 的功能設定。

以系統管理員權限開啟 PowerShell 視窗,並且執行 Install-Module -Name Az 以安裝 Azure PowerShell

範例指令碼

# 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>

清除資源

您可以藉由刪除資源群組來清除您所部署的資源。

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

指令碼說明

此指令碼使用下列命令來建立新的資源群組與應用程式組態存放區。 下表中的每個命令都會連結至命令特定的文件。

Command 注意
New-AzResourceGroup 建立用來存放所有資源的資源群組。
New-AzAppConfigurationStore 建立應用程式組態存放區資源。
Get-AzAppConfigurationStoreKey 列出應用程式組態存放區的存取金鑰。

下一步

如需有關 Azure PowerShell 的詳細資訊,請參閱 Azure PowerShell 文件。

您可以在 Azure 應用程式組態 PowerShell 範例中找到更多適用於 PowerShell 的應用程式組態指令碼範例。