Creating secrets in Azure Key Vault
- Log in to your Azure portal account.
- Browse to the Key Vaults service.
- Click Create to open the Create a key vault page at the Basics tab.
- Complete the following fields:
- Resource Group: Select an existing resource group. We recommend you choose the same resource group that your will be launched in. To create a new resource group, read Create resource groups.
- Key vault name: Give your new key vault a name.
- Region: Select an Azure region.
- Pricing tier: Select Standard or Premium pricing.
- Click the Access Policy tab and review your permission model. Vault Access Policy is the default selection. If you want to select the Azure role-based access control instead, refer to Assign an access policy.
- Click Review + create, and then click Create.
- After a brief period, your key vault will be created. Under Next steps, click Go to resource.
- The Overview tab will be displayed. Make a note of your Vault URI. You may need to use the Vault URI within —when you create a , for example.
- Click Secrets in the sidebar, then click Generate/Import at the top.
-
Enter the following secret details.
- Upload options: Select Manual.
- Name: Enter
agent-rsa. - Secret value: Enter your secret key. See the note below on multi-line secrets.
- Azure Key Vault strips newlines from secrets being added via the graphical user interface (GUI), which will prevent your multi-line secrets from working. Read Store a multi-line secret in Azure Key Vault to work around this issue.
-
The following CLI command will maintain newlines:
- Leave the other fields blank, and click Create.
Assign an access policy
Configure your access policy by selecting one of the following permission models:- Vault Access Policy: The default permission model that determines whether a security principle, such as a user, application, or user group, can perform different operations on keys, secrets, and certificates.
- Azure role-based access control: An authorization system that provides fine-grained access management of Azure resources to grant access at a specific scope level by assigning appropriate Azure roles.
- Click the Access policy tab in the Create a key vault process.
- Choose your permission model.
- Select your Resource access.
- If you choose the default Vault access policy, continue to the next step. If you choose Azure role-based access control, continue to step 10.
- Under the Access policies heading, click Create.
- Use the Configure from a template drop-down to select an existing template.
-
Add the following Secret permissions:
- Get
- List
- These permissions must be set for a secret, not a key or certificate.
- In some scenarios, you may need additional secret permissions. See Additional configuration for CDC pipelines, below.
- Click the Principal tab, and select your chosen principal. Only one principal can be assigned per access policy.
- Click the Application (optional) tab and select an application. For more information, read Managed identities.
- Click Review + Create, then click Create.
Access control IAM
Use the following steps to assign roles and grant access to your Azure Key Vault resource.- Access your existing Key Vault resource in your Microsoft Azure portal account.
- Click on the intended key vault.
- Click Access control (IAM) in the sidebar.
- Click Add from the top menu, then click Add role assignment.
- Select the Reader permissions.
- Click Next.
- In the Members tab, select the members you want to assign access to, add an optional description, and add your application.
- Click Next, then click Review + assign.
Additional configuration for CDC pipelines
Some additional configuration is required to allow a CDC pipeline to be created from a deployed on Azure. In this scenario, complete the following steps. Add your Azure user to the access policy for the chosen key vault:- In the Azure portal, find the key vault created from the deployment.
- In the left navigation menu, click Access Policies.
- Click +Create.
- Under Secret Permissions, select the following permissions:
- Get
- List
- Set
- Delete
- Click Next.
- Under Principle, search for your Azure username and select it.
- Click Next, then click Next again.
- Click Create.
- In the Azure portal, find the key vault created from the deployment.
- In the left navigation menu, click Objects → Secrets.
- Click +Generate/Import.
- Enter the following details:
- Name: The name that will use to refer to the secret.
- Secret Value: The password to be used when connecting to the CDC source.
- Click Create.
- In the Azure portal, navigate to the storage account created from the deployment.
- In the left navigation menu, click Security + networking, then click Access keys.
- Click the Show button next to the key value for Key1 or Key2.
- Click the Copy button to copy the key that is now shown.
- In the Azure portal, find the key vault created from the deployment.
- In the left navigation menu, click Objects, then click Secrets.
- Click +Generate/Import.
- Enter the following details:
- Name: The name that will use to refer to the secret.
- Secret Value: The password storage key copied in step 4.
- Click Create.

