Reputation: 15159
I need to export all secrets from my key vault in Azure but I get the following error:
Backup-AzureKeyVaultSecret : The term 'Backup-AzureKeyVaultSecret' is not recognized as the name of a cmdlet, function, script file, or operable program.
According to the documentation the command is in AzureRM.KeyVault module but it isn't on my machine:
> PS C:\> get-module AzureRM
>
> ModuleType Version Name
> ExportedCommands
> ---------------- Script 4.4.1 AzureRM {Add-AzureAnalysisServicesAccount, Add-AzureKeyVaultCertif...
>
>
>PS C:\> Get-Command -Module AzureRM.KeyVault -Noun azurekeyvault*|Select-Object Name, Version
Name Version
---- -------
Set-AzureKeyVaultKey 3.4.1
Add-AzureKeyVaultCertificate 2.8.0
Add-AzureKeyVaultCertificateContact 2.8.0
Add-AzureKeyVaultKey 2.8.0
Backup-AzureKeyVaultKey 2.8.0
Get-AzureKeyVaultCertificate 2.8.0
Get-AzureKeyVaultCertificateContact 2.8.0
Get-AzureKeyVaultCertificateIssuer 2.8.0
Get-AzureKeyVaultCertificateOperation 2.8.0
Get-AzureKeyVaultCertificatePolicy 2.8.0
Get-AzureKeyVaultKey 2.8.0
Get-AzureKeyVaultSecret 2.8.0
Import-AzureKeyVaultCertificate 2.8.0
New-AzureKeyVaultCertificateAdministratorDetails 2.8.0
New-AzureKeyVaultCertificateOrganizationDetails 2.8.0
New-AzureKeyVaultCertificatePolicy 2.8.0
Remove-AzureKeyVaultCertificate 2.8.0
Remove-AzureKeyVaultCertificateContact 2.8.0
Remove-AzureKeyVaultCertificateIssuer 2.8.0
Remove-AzureKeyVaultCertificateOperation 2.8.0
Remove-AzureKeyVaultKey 2.8.0
Remove-AzureKeyVaultSecret 2.8.0
Restore-AzureKeyVaultKey 2.8.0
Set-AzureKeyVaultCertificateAttribute 2.8.0
Set-AzureKeyVaultCertificateIssuer 2.8.0
Set-AzureKeyVaultCertificatePolicy 2.8.0
Set-AzureKeyVaultKeyAttribute 2.8.0
Set-AzureKeyVaultSecret 2.8.0
Set-AzureKeyVaultSecretAttribute 2.8.0
Stop-AzureKeyVaultCertificateOperation 2.8.0
Note, Backup-AzureKeyVaultKey
is present but there is no Backup-AzureKeyVaultSecret
. I tried Update-Module AzureRM
but there are no new commands. Where is this thing?
Upvotes: 3
Views: 4883
Reputation: 15159
OK, I had to do
Uninstall-Module AzureRm.KeyVault
twice (??), and then
Install-Module AzureRm.KeyVault -Force -AllowClobber
It didn't work without both -Force
and -AllowClobber
flags. Something with parallel version installation thing.
Upvotes: 3
Reputation: 12906
The recommendation is to download and install the latest Azure Powershell MSI-installer through GitHub: https://github.com/Azure/azure-powershell/releases
Currently the latest version is available though the following direct link: https://github.com/Azure/azure-powershell/releases/download/v4.4.1-October2017/azure-powershell.4.4.1.msi
I've run into the same issue and installing the MSI helped to fix the problem.
Upvotes: 3