Skip to content

Commit 32cdce1

Browse files
Merge pull request #12482 from MicrosoftDocs/ghogen-patch-41
Review and update date
2 parents 32faa1f + 68a1fd4 commit 32cdce1

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

docs/azure/vs-key-vault-add-connected-service.md

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: ghogen
66
manager: mijacobs
77
ms.custom: devx-track-csharp
88
ms.topic: how-to
9-
ms.date: 4/28/2023
9+
ms.date: 04/10/2024
1010
ms.author: ghogen
1111
---
1212

@@ -39,7 +39,7 @@ Before you begin, make sure that you're signed in to Visual Studio. Sign in with
3939

4040
![Screenshot of "Create Azure Key Vault" screen](./media/vs-key-vault-add-connected-service/create-new-key-vault.png)
4141

42-
1. In the **Configure Key Vault** screen, you can change the name of the environment variable.
42+
1. In the **Configure Key Vault** screen, you can change the name of the environment variable that references the key vault URI. The connection string is not stored here; it's stored in the key vault.
4343

4444
![Screenshot of Connect to Azure Key Vault screen.](./media/vs-key-vault-add-connected-service/connect-to-azure-key-vault.png)
4545

@@ -49,20 +49,12 @@ Now, connection to Key Vault is established and you can access your secrets in c
4949

5050
See code examples of working with secrets at [Azure Key Vault Secrets client library for .NET - Code examples](/azure/key-vault/secrets/quick-create-net?tabs=azure-cli#code-examples).
5151

52-
## Troubleshooting
52+
## Configure access to the key vault
5353

54-
If your key vault is running on a different Microsoft account than the one you're signed in to Visual Studio (for example, the key vault is running on your work account, but Visual Studio is using your private account) you get an error in your Program.cs file, that Visual Studio can't get access to the key vault. To fix this issue:
54+
If your key vault is running on a different Microsoft account than the one you're signed in to Visual Studio (for example, the key vault is running on your work account, but Visual Studio is using your private account) you get an error in your Program.cs file, that Visual Studio can't get access to the key vault. To fix this issue, go to the [Azure portal](https://portal.azure.com), open your key vault, and choose **Access control (IAM)** to set permissions. See [Provide access to Key Vault keys, certificates, and secrets with an Azure role-based access control](/azure/key-vault/general/rbac-guide?tabs=azure-cli).
5555

56-
1. Go to the [Azure portal](https://portal.azure.com) and open your key vault.
57-
58-
1. Choose **Access policies**, then **Add Access Policy**, and choose the account you are logged in with as Principal.
59-
60-
1. In Visual Studio, choose **File** > **Account Settings**.
61-
Select **Add an account** from the **All account** section. Sign in with the account you have chosen as Principal of your access policy.
62-
63-
1. Choose **Tools** > **Options**, and look for **Azure Service Authentication**. Then select the account you just added to Visual Studio.
64-
65-
Now, when you debug your application, Visual Studio connects to the account your key vault is located on.
56+
> [!NOTE]
57+
> Older key vaults might use a legacy access policy model. It is recommended to migrate older key vaults to use Azure RBAC. See [Azure role-based access control (RBAC) vs. access policies](/azure/key-vault/general/rbac-access-policy).
6658
6759
## How your ASP.NET Core project is modified
6860

0 commit comments

Comments
 (0)