Skip to content

Commit f619c94

Browse files
committed
More edits
1 parent fa417e2 commit f619c94

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

articles/storage/common/multiple-identity-scenarios.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ You can also enable access to Azure resources for local development by assigning
109109
using Azure.Messaging.ServiceBus;
110110
using Azure.Storage.Blobs;
111111
112+
// Create an instance of DefaultAzureCredential that will use a system-assigned managed identity
112113
DefaultAzureCredential credential = new();
113114
114115
BlobServiceClient blobServiceClient = new(
@@ -227,7 +228,7 @@ You can also enable access to Azure resources for local development by assigning
227228
}
228229
```
229230
230-
#### [JavaScript](#tab/javascript)
231+
#### [Node.js](#tab/javascript)
231232
232233
1. In your project, use [npm](https://docs.npmjs.com/) to add a reference to the `@azure/identity` package. This library contains all of the necessary entities to implement `DefaultAzureCredential`. Install any other [Azure SDK libraries](https://www.npmjs.com/search?q=%40azure) which are relevant to your app.
233234
@@ -389,23 +390,24 @@ Add the following to your code:
389390
```java
390391
class Demo {
391392
public static void main(String[] args) {
392-
// Get the first user-assigned managed identity ID to connect to shared storage
393+
// Get the first user-assigned managed identity client ID to connect to shared storage
393394
String clientIdStorage = System.getenv("Managed_Identity_Client_ID_Storage");
394395

395396
// Get the DefaultAzureCredential from clientIdStorage
396-
DefaultAzureCredential storageCredential =
397-
new DefaultAzureCredentialBuilder().managedIdentityClientId(clientIdStorage).build();
397+
DefaultAzureCredential credential = new DefaultAzureCredentialBuilder()
398+
.managedIdentityClientId(clientIdStorage)
399+
.build();
398400

399-
// First blob storage client that uses a managed identity
400-
BlobServiceClient blobServiceClient = new BlobServiceClientBuilder()
401+
// First blob storage client that uses a user-assigned managed identity
402+
BlobServiceClient blobServiceClient1 = new BlobServiceClientBuilder()
401403
.endpoint("https://<receipt-storage-account>.blob.core.windows.net")
402-
.credential(storageCredential)
404+
.credential(credential)
403405
.buildClient();
404406

405-
// Second blob storage client that uses a managed identity
407+
// Second blob storage client that uses a user-assigned managed identity
406408
BlobServiceClient blobServiceClient2 = new BlobServiceClientBuilder()
407409
.endpoint("https://<contract-storage-account>.blob.core.windows.net")
408-
.credential(storageCredential)
410+
.credential(credential)
409411
.buildClient();
410412

411413
// Get the second user-assigned managed identity ID to connect to shared databases
@@ -527,7 +529,7 @@ public class ExampleService {
527529
}
528530
```
529531

530-
#### [JavaScript](#tab/javascript)
532+
#### [Node.js](#tab/javascript)
531533

532534
1. Inside of your project, use [npm](https://docs.npmjs.com/) to add a reference to the `@azure/identity` package. This library contains all of the necessary entities to implement `DefaultAzureCredential`. Install any other [Azure SDK libraries](https://www.npmjs.com/search?q=%40azure) which are relevant to your app.
533535

0 commit comments

Comments
 (0)