How to retrieve the value of an old version of the secret that is disabled and stored in the key Vault

2023-08-15T20:57:11.8433333+00:00

After an old version of sercret is deactivated in the azure portal you cannot activate it again in the portal and you cannot see the value that was stored.secret_old_version

Azure Key Vault
Azure Key Vault
An Azure service that is used to manage and protect cryptographic keys and other secrets used by cloud apps and services.
1,400 questions
Azure
Azure
A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.
1,155 questions
{count} votes

Accepted answer
  1. JamesTran-MSFT 36,841 Reputation points Microsoft Employee
    2023-08-16T20:59:38.9266667+00:00

    @Antonio Elias Soares Ferreira da Silva

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others", I'll repost your solution in case you'd like to accept the answer.

    Issue:

    After an older version of a Key Vault Secret is disabled - you were having issues with retrieving the value of that disabled version, along with not being able to activate it from the Azure Portal to see the value.

    User's image

    Solution:

    To resolve your issue, you were able to activate the older Secret version from Azure Cloud Shell, using the Set-AzKeyVaultSecretAttribute PowerShell command.

    For example:

    Set-AzKeyVaultSecretAttribute -VaultName 'MyKeyVault' -Name 'MySecretName' -Enable $True -Version 'NumberOfVersion'
    
    • After activating the older Secret version, you were able to see the value stored within the Azure Portal.

    Findings:

    Adding onto your solution, I was able to re-enable a disabled Secret version within the Azure Portal following the below steps.

    1. Navigate to your Key Vault
    2. Select the appropriate Secret
    3. Right-click the disabled version you're trying to view the value of.
    4. Enable the older version and select it.
    5. Show the Secret value.

    User's image

    If I missed anything please let me know and I'd be happy to add it to my answer, or feel free to comment below with any additional information.


    I hope this helps!

    If you have any other questions, please let me know. Thank you again for your time and patience throughout this issue.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Antonio Elias Soares Ferreira da Silva 30 Reputation points
    2023-08-15T21:28:04.6733333+00:00

    To activate the old versions of your secret you will need to access the azure portal and open the azure cloud shell, make sure you have the necessary permissions to run the Set-AzKeyVaultSecretAttribute commandsecret_old_version_activate

    Run this command Set-AzKeyVaultSecretAttribute -VaultName 'MyKeyVault' -Name 'MySecretName' -Enable $True -Version 'NumberOfVersion'

    After activating the old versions you will be able to see the values ​​stored through the azure portal, just click on the version you want


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.