You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/azure/vs-key-vault-add-connected-service.md
+6-14Lines changed: 6 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ author: ghogen
6
6
manager: mijacobs
7
7
ms.custom: devx-track-csharp
8
8
ms.topic: how-to
9
-
ms.date: 4/28/2023
9
+
ms.date: 04/10/2024
10
10
ms.author: ghogen
11
11
---
12
12
@@ -39,7 +39,7 @@ Before you begin, make sure that you're signed in to Visual Studio. Sign in with
39
39
40
40

41
41
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.
43
43
44
44

45
45
@@ -49,20 +49,12 @@ Now, connection to Key Vault is established and you can access your secrets in c
49
49
50
50
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).
51
51
52
-
## Troubleshooting
52
+
## Configure access to the key vault
53
53
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).
55
55
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).
0 commit comments