Using getSecret() to retrieve a secret value from KeyVault in Gov cloud

natalie 6 Reputation points Microsoft Employee

For public cloud we are using getSecret(akvName: String, secret: String, linkedService: String) to get a secret from keyvault. However, as we are setting up our government cloud, the host this uses is the public cloud<keyvault> instead of using the government cloud of .us . How can I get the secret in government cloud for a government cloud keyvault. I verfied that the Linked Service base url was government cloud as well.

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,107 questions
{count} votes

2 answers

Sort by: Most helpful
  1. BhargavaGunnam-MSFT 23,586 Reputation points Microsoft Employee

    Hello @natalie,

    Welcome to the MS Q&A platform.

    The hostname for Key Vault in Azure Government Cloud is

    This is documented here:

    User's image

    I hope this helps.

    If this answers your question, please consider accepting the answer by hitting the Accept answer and up-vote as it helps the community.

    1 person found this answer helpful.

  2. natalie 6 Reputation points Microsoft Employee

    GetSecret() defaults to using the public host for the keyvault therefore you'll need to pass in the full domain for the vault name for the respective env.
    Gov cloud:



    val connectionString: String = TokenLibrary.getSecret("<yourKVName>", "<yourSecretName>", "<YourLinkedService>")

    1 person found this answer helpful.
    0 comments No comments