Neo
Neo

Reputation: 16239

How to use keyvault for service bus connection string inside logic app

I want to use service bus connector into logic app but when we add connection to service bus.

I need to use key vault instead service bus connection string into service bus connector any way to do it?

Added connection string into Key Vault enter image description here

How to use it inside logic app ?

enter image description here

Upvotes: 3

Views: 1754

Answers (1)

Md Farid Uddin Kiron
Md Farid Uddin Kiron

Reputation: 22495

According to my understanding, you want to access service bus connection string from in Azure logic app. If so, we can store the connection string as secret in Azure key vault. Then we can retrieve secrets from Azure Key Vault and pass the secrets as parameters during Resource Manager deployment. There is a sample(store my password in Azure key vault) for you to know it.

  1. Crete Azure Key vault and secret

    $userPrincipalName='{your-email-address-associated-with-your-subscription}' $pw = "" $secpasswd = ConvertTo-SecureString $pw -AsPlainText -Force $mycreds = New-Object System.Management.Automation.PSCredential ($userPrincipalName, $secpasswd) Add-AzureRmAccount -Credential $mycreds

    $keyVaultName = "{your-unique-vault-name}" $resourceGroupName="{your-resource-group-name}" $location=''

    New-AzureRmResourceGroup -Name $resourceGroupName -Location $location

    New-AzureRmKeyVault -VaultName $keyVaultName -resourceGroupName $resourceGroupName -Location $location -EnabledForTemplateDeployment

    set permissions

    Set-AzureRmKeyVaultAccessPolicy -VaultName $keyVaultName -UserPrincipalName $userPrincipalName -PermissionsToSecrets set,delete,get,list

$password = "" echo $password $secretvalue = ConvertTo-SecureString $password -AsPlainText -Force Set-AzureKeyVaultSecret -VaultName $keyVaultName -Name "your secret name" -SecretValue $secretvalue

  1. Create a parameter file for the preceding template

    { "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", "contentVersion": "1.0.0.0", "parameters": { "logicAppName": { "value": "test" },

    "Password": {
      "reference": {
        "keyVault": {
          "id": /subscriptions/<subscription-id>/resourceGroups/<resource group name>/providers/Microsoft.KeyVault/vaults/<vault-name>"
        },
        "secretName": "your secret name"
      }
    }
    

    } }

  2. Use the parameter

For more details, please refer to the document

Upvotes: 1

Related Questions