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: articles/service-connector/how-to-integrate-key-vault.md
+14-15Lines changed: 14 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,20 @@
1
1
---
2
2
title: Integrate Azure Key Vault with Service Connector
3
-
description: Integrate Azure Key Vault into your application with Service Connector
3
+
description: Use these code samples to integrate Azure Key Vault into your application with Service Connector.
4
4
author: maud-lv
5
5
ms.author: malev
6
6
ms.service: service-connector
7
7
ms.topic: how-to
8
-
ms.date: 02/02/2024
8
+
ms.date: 07/24/2025
9
+
#customer intent: As a cloud developer, I want to connect my cloud services to Azure Key Vault by using Service Connector.
9
10
---
10
11
11
12
# Integrate Azure Key Vault with Service Connector
12
13
13
14
> [!NOTE]
14
15
> When you use Service Connector to connect your Key Vault or manage Key Vault connections, Service Connector uses your token to perform the corresponding operations.
15
16
16
-
This page shows supported authentication methods and clients, and shows sample code you can use to connect Azure Key Vault to other cloud services using Service Connector. You might still be able to connect to Azure Key Vault in other programming languages without using Service Connector. This page also shows default environment variable names and values (or Spring Boot configuration) you get when you create the service connection.
17
+
This page shows supported authentication methods and clients. It provides sample code you can use to connect Azure Key Vault to other cloud services using Service Connector. You might be able to connect to Azure Key Vault in other programming languages without using Service Connector. This page also shows default environment variable names and values (or Spring Boot configuration) you get when you create the service connection.
17
18
18
19
## Supported compute services
19
20
@@ -27,7 +28,7 @@ Service Connector can be used to connect the following compute services to Azure
27
28
28
29
## Supported authentication types and client types
29
30
30
-
The table below shows which combinations of client types and authentication methods are supported for connecting your compute service to Azure Key Vault using Service Connector. A “Yes” indicates that the combination is supported, while a “No” indicates that it is not supported.
31
+
The following table shows which combinations of client types and authentication methods are supported for connecting your compute service to Azure Key Vault using Service Connector. A "Yes" indicates that the combination is supported, while a "No" indicates that it isn't supported.
31
32
32
33
| Client type | System-assigned managed identity | User-assigned managed identity | Secret / connection string | Service principal |
@@ -38,15 +39,15 @@ The table below shows which combinations of client types and authentication meth
38
39
| Python | Yes | Yes | No | Yes |
39
40
| None | Yes | Yes | No | Yes |
40
41
41
-
This table indicates that all combinations of client types and authentication methods in the table are supported, except for the Secret / connection stringmethod, which is not supported for any of the client types. All client types can use any of the other authentication methods to connect to Azure Key Vault using Service Connector.
42
+
This table indicates that all combinations of client types and authentication methods in the table are supported, except for **Secret / connection string**. That method isn't supported for any of the client types. All client types can use any of the other authentication methods to connect to Azure Key Vault using Service Connector.
42
43
43
44
## Default environment variable names or application properties and sample code
44
45
45
-
Use the connection details below to connect compute services to Azure Key Vault. For each example below, replace the placeholder texts `<vault-name>`, `<client-ID>`, `<client-secret>`, and `<tenant-id>` with your Key Vault name, client-ID, client secret and tenant ID. For more information about naming conventions, check the [Service Connector internals](concept-service-connector-internals.md#configuration-naming-convention) article.
46
+
Use the following connection details to connect compute services to Azure Key Vault. For each of these examples, replace the placeholder texts `<vault-name>`, `<client-ID>`, `<client-secret>`, and `<tenant-id>` with your Key Vault name, client-ID, client secret, and tenant ID. For more information, see [Configuration naming convention](concept-service-connector-internals.md#configuration-naming-convention).
46
47
47
48
### System-assigned managed identity
48
49
49
-
#### SpringBoot client type
50
+
#### Spring Boot client type
50
51
51
52
| Default environment variable name | Description | Example value |
1. Authenticate using `Azure.Identity` and get the Azure Key Vault endpoint from the environment variables added by Service Connector. When using the code below, uncomment the part of the code snippet for the authentication type you want to use.
18
+
19
+
1. Authenticate using `Azure.Identity` and get the Azure Key Vault endpoint from the environment variables added by Service Connector. When using this code, uncomment the part of the code snippet for the authentication type you want to use.
20
+
18
21
```csharp
19
22
using Azure.Identity;
20
23
using Azure.Security.KeyVault.Secrets;
@@ -56,6 +59,7 @@ ms.author: wchi
56
59
### [Java](#tab/java)
57
60
58
61
1. Add the following dependencies in your *pom.xml* file:
62
+
59
63
```xml
60
64
<dependency>
61
65
<groupId>com.azure</groupId>
@@ -67,7 +71,9 @@ ms.author: wchi
67
71
<version>1.1.5</version>
68
72
</dependency>
69
73
```
70
-
1. Authenticate using `azure-identity` and get the Azure Key Vault endpoint from the environment variables added by Service Connector. When using the code below, uncomment the part of the code snippet for the authentication type you want to use.
74
+
75
+
1. Authenticate using `azure-identity` and get the Azure Key Vault endpoint from the environment variables added by Service Connector. When using this code, uncomment the part of the code snippet for the authentication type you want to use.
76
+
71
77
```java
72
78
// Uncomment the following lines corresponding to the authentication type you want to use.
73
79
// for system-managed identity
@@ -94,15 +100,18 @@ ms.author: wchi
94
100
95
101
### [SpringBoot](#tab/springBoot)
96
102
97
-
Refer to [Tutorial: Connect Azure Spring Apps to Key Vault using managed identities](../../spring-apps/basic-standard/tutorial-managed-identities-key-vault.md?tabs=system-assigned-managed-identity) to set up your Spring application. Two sets of configuration properties are added to Spring Apps by Service Connector, according to Spring Cloud Azure version below 4.0 and above 4.0. For more information, check [Migration Guide for 4.0](https://microsoft.github.io/spring-cloud-azure/current/reference/html/appendix.html#configuration-spring-cloud-azure-starter-keyvault-secrets)
103
+
To set up your Spring application, see [Connect Azure Spring Apps to Key Vault using managed identities](../../spring-apps/basic-standard/tutorial-managed-identities-key-vault.md?tabs=system-assigned-managed-identity). Two sets of configuration properties are added to Spring Apps by Service Connector, according to Spring Cloud Azure version below 4.0 and above 4.0. For more information, see [Migration Guide for 4.0](https://microsoft.github.io/spring-cloud-azure/current/reference/html/appendix.html#configuration-spring-cloud-azure-starter-keyvault-secrets).
98
104
99
105
### [Python](#tab/python)
100
106
101
107
1. Install dependencies.
108
+
102
109
```bash
103
110
pip install azure-keyvault-keys azure-identity
104
111
```
105
-
1. Authenticate using `azure-identity` and get the Azure Key Vault endpoint from the environment variables added by Service Connector. When using the code below, uncomment the part of the code snippet for the authentication type you want to use.
112
+
113
+
1. Authenticate using `azure-identity` and get the Azure Key Vault endpoint from the environment variables added by Service Connector. When using this code, uncomment the part of the code snippet for the authentication type you want to use.
114
+
106
115
```python
107
116
import os
108
117
from azure.identity import ManagedIdentityCredential, ClientSecretCredential
@@ -126,14 +135,17 @@ Refer to [Tutorial: Connect Azure Spring Apps to Key Vault using managed identit
1. Authenticate using `@azure/identity` and get the Azure Key Vault endpoint from the environment variables added by Service Connector. When using the code below, uncomment the part of the code snippet for the authentication type you want to use.
146
+
147
+
1. Authenticate using `@azure/identity` and get the Azure Key Vault endpoint from the environment variables added by Service Connector. When using this code, uncomment the part of the code snippet for the authentication type you want to use.
148
+
137
149
```javascript
138
150
import { DefaultAzureCredential,ClientSecretCredential } from "@azure/identity";
0 commit comments