Wednesday, January 8, 2020

Copy all secrets from one Azure Keyvault to another Key Vault using Powershell


$NewKeyVaultName="<your new key Vault>"
$ExistingKeyVault="<your existing key Valut>"


$secretNames = (Get-AzKeyVaultSecret -VaultName $ExistingKeyVault).Name
$secretNames.foreach{
    Set-AzKeyVaultSecret -VaultName $NewKeyVaultName -Name $_  -SecretValue (Get-AzKeyVaultSecret -VaultName $ExistingKeyVault -Name $_).SecretValue
}

No comments:

Post a Comment

Activating All triggers in ADF using powershell

Scenario: I have an ADF having more than one pipelines. For each pipeline more than one triggers. I need to activate all the triggers i...