Created
November 4, 2019 21:33
-
-
Save TheCloudScout/b2fa1f9d056496914dbb7094c1ffde61 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Retrieve all Azure Container Registry credentials | |
$RegistryCredentials = Get-AzContainerRegistry | Get-AzContainerRegistryCredential | |
# Convert first password to secure string and store it inside Key Vault as a secret | |
$RegistryPw1 = ConvertTo-SecureString -string $RegistryCredentials.Password -AsPlainText -Force | |
Set-AzKeyVaultSecret -VaultName $(KeyVaultName) -Name "RegistryPassword1" -SecretValue $RegistryPw1 | |
# Convert second password to secure string and store it inside Key Vault as a secret | |
$RegistryPw2 = ConvertTo-SecureString -string $RegistryCredentials.Password2 -AsPlainText -Force | |
Set-AzKeyVaultSecret -VaultName $(KeyVaultName) -Name "RegistryPassword2" -SecretValue $RegistryPw2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment