How to get the secrets from Azure Key Vault Using Azure SQL?

Govarthanan Venkatesan 66 Reputation points

How to get the secrets from AKV using PowerShell script that needs to be automated in Stored Procedure in Azure SQL?

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.
960 questions
Azure SQL Database
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,170 questions
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,453 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. GeethaThatipatri-MSFT 23,617 Reputation points Microsoft Employee

    Hi @Govarthanan Venkatesan , Thanks for posting your question in the Microsoft Q&A forum.
    As we understand the ask here is you want to know how to get the secrets using PowerShell correct me if my understanding is wrong.

    You can find the PowerShell syntax in this document
    Get-AzureKeyVaultSecret -VaultName 'ABC' -Name 'test' Get the current version of a specific secret in to the name 'test'. the same you can output to a file
    | Out-File -FilePath .\secrets.txt

    Please let me know if the information is helpful

  2. Newbie Jones 1,276 Reputation points

    Use the Azure Cmdlets. The other option is the REST interface.

    You need to ensure the (service) account running the PowerShell script has permissions to the key vault.

    0 comments No comments