如何使用Power Shell中的RM模块获取Azure App配置访问密钥

问题描述

Azure rm模块未显示任何有关从应用程序配置中获取密钥的命令。

解决方法

如果要使用AzureRM模块列出Azure App配置的访问密钥,我们可以将命令Invoke-AzureRmResourceAction与操作listkeys一起使用。

例如

Connect-AzureRmAccount


$keys=Invoke-AzureRmResourceAction -Action listKeys `
        -ResourceType "Microsoft.AppConfiguration/configurationStores" `
        -ResourceName "<>" `
        -ResourceGroupName "<>" -ApiVersion "2019-10-01" -Force 

$keys | ConvertTo-Json

enter image description here

,

我使用以下内容。

Get-AzAppConfigurationStoreKey
   -Name <String>
   -ResourceGroupName <String>
   [-SubscriptionId <String[]>]
   [-DefaultProfile <PSObject>]
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]

参考文档:https://docs.microsoft.com/en-us/powershell/module/az.appconfiguration/get-azappconfigurationstorekey?view=azps-4.7.0