Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.23k stars 3.83k forks source link

Az.Keyvault v. 4.02-preview REGRESSION with preview Powershell Secretmanagement #14271

Closed TheBigBear closed 3 years ago

TheBigBear commented 3 years ago

Description

Registering a powershell secretmanagement Vault for Az.Keyvault fails with error message:

Register-SecretVault: Could not find a SecretManagement extension implementing script module.

Steps to reproduce

I am trying to add and use an Azure Keyvault in the Powershell SecretManagement module.

If I use:

Register-SecretVault -Name AzKeyVault -ModuleName Az.KeyVault -VaultParameters @{ AZKVaultName = 'My-AzKeyVault'; SubscriptionId = '8a2e...-...-...-...-43fbcfe7...' } # subscriptionId redacted here

and I get the following error in red

Register-SecretVault: Could not find a SecretManagement extension implementing script module.

What did I do wrong? Pretty sure this used to work in an earlier preview of the module?

PS: I have the following versions of modules installed.

Version                    Name                              
-------                    ----                                
4.0.2-preview       Az.KeyVault                         
0.9.0                        Microsoft.PowerShell.SecretStore
0.9.0                        Microsoft.PowerShell.SecretManagement

BUT if I remove Az.Keyvault 4.02-preview and install the lastest released version of it 3.4.0 registering the vault works as it always used to.

Also see my report on the powershell secretmangement module: https://github.com/PowerShell/SecretManagement/issues/104

Environment data

Module versions

Debug output

Error output

BethanyZhou commented 3 years ago

Hi @TheBigBear , Az.Keyvault 4.0.1-preview and 4.0.2-preview was published in 2019. They are not our latest release. Please use Az.Keyvault 3.3.1 or higher stable version to get powershell secret management feature.

TheBigBear commented 3 years ago

Hi @BethanyZhou thanks, but this is quite counter intuitive and strange! Sydney Smith sent me the link to Az.Keyvault 4.0.2-preview on twitter and you are saying use 3.3.1 or higher? Well in most people's books 4.0.2 is higher than 3.3.1? You absolutely sure the 4.0.2-preview is from back in 2019 ? And the most up to date and relevant now is 3.3.1?

dcaro commented 3 years ago

@TheBigBear the most recent stable version for Az.KeyVault is 3.4.0, the integration with secrets management has only been implemented in the stable version starting with 3.3.1.

Preview modules do not necessarily have more features than the stable modules. I understand that this may be misleading and we try to keep this as the exception. In the case of Az.KeyVault, as @BethanyZhou mentioned, it was build in 2019.

I confirm that the most recent version to use with secrets management as of today is 3.4.0. Sorry for the confusion this may have created,

dcaro commented 3 years ago

@TheBigBear based on your feedback and feedback received from others, we plan to hide from the gallery those preview modules. I hope that we have answered your issues and will close this issue. Please add a comment if needed to reopen.