diff --git a/sdk/keyvault/azure-security-keyvault-keys/README.md b/sdk/keyvault/azure-security-keyvault-keys/README.md index d49459cf014f7..e8f8db367e75c 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/README.md +++ b/sdk/keyvault/azure-security-keyvault-keys/README.md @@ -255,7 +255,7 @@ The following sections provide several code snippets covering some of the most c - [Update an existing key asynchronously](#update-an-existing-key-asynchronously) - [Delete a key asynchronously](#delete-a-key-asynchronously) - [List keys asynchronously](#list-keys-asynchronously) -- [Encrypt asynchronously](#encryp-asynchronously) +- [Encrypt asynchronously](#encrypt-asynchronously) - [Decrypt asynchronously](#decrypt-asynchronously) > Note : You should add `System.in.read()` or `Thread.sleep()` after the function calls in the main class/thread to allow async functions/operations to execute and finish before the main application/thread exits. diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/samples/java/com/azure/security/keyvault/keys/KeyAsyncClientJavaDocCodeSnippets.java b/sdk/keyvault/azure-security-keyvault-keys/src/samples/java/com/azure/security/keyvault/keys/KeyAsyncClientJavaDocCodeSnippets.java index b056f7e714080..e01a950bd6064 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/samples/java/com/azure/security/keyvault/keys/KeyAsyncClientJavaDocCodeSnippets.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/samples/java/com/azure/security/keyvault/keys/KeyAsyncClientJavaDocCodeSnippets.java @@ -43,8 +43,8 @@ public KeyAsyncClient createAsyncClientWithHttpClient() { // BEGIN: com.azure.security.keyvault.keys.async.keyclient.withhttpclient.instantiation KeyAsyncClient keyAsyncClient = new KeyClientBuilder() .vaultUrl("https://myvault.azure.net/") + .credential(new DefaultAzureCredentialBuilder().build()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)) - .addPolicy(new KeyVaultCredentialPolicy(new DefaultAzureCredentialBuilder().build())) .httpClient(HttpClient.createDefault()) .buildAsyncClient(); // END: com.azure.security.keyvault.keys.async.keyclient.withhttpclient.instantiation