How to get Azure App configuration access keys using RM module in power shell

611 views Asked by At

Azure rm module doesn't show any related commands to get keys from app configuration.

2

There are 2 answers

0
Jim Xu On BEST ANSWER

If you want to list access key of Azure App configuration with the AzureRM module, we can use the command Invoke-AzureRmResourceAction with action listkeys.

For example

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

2
Stringfellow On

I use the following.

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

Reference docs: https://learn.microsoft.com/en-us/powershell/module/az.appconfiguration/get-azappconfigurationstorekey?view=azps-4.7.0