Skip to content

Commit 82e2eca

Browse files
timovvheaths
andauthored
[keyvault] Update migration and troubleshooting guides (Azure#26521)
### Packages impacted by this PR - `@azure/keyvault-certificates` - `@azure/keyvault-keys` - `@azure/keyvault-secrets` ### Issues associated with this PR - Fixes Azure#26358 ### Describe the problem that is addressed by this PR Documentation updates with new information reflecting recent changes and feedback; see corresponding [.NET](Azure/azure-sdk-for-net#37028) and [Python](Azure/azure-sdk-for-python#30897) PRs. --------- Co-authored-by: Heath Stewart <heaths@outlook.com>
1 parent 00b5b82 commit 82e2eca

File tree

4 files changed

+114
-51
lines changed

4 files changed

+114
-51
lines changed

sdk/keyvault/TROUBLESHOOTING.md

Lines changed: 62 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,26 @@ common to these SDKs.
66

77
For any package-specific troubleshooting guides, see any of the following:
88

9-
* [Troubleshooting Azure Key Vault Administration SDK Issues](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/keyvault/keyvault-admin/TROUBLESHOOTING.md)
10-
* [Troubleshooting Azure Key Vault Certificates SDK Issues](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/keyvault/keyvault-certificates/TROUBLESHOOTING.md)
11-
* [Troubleshooting Azure Key Vault Keys SDK Issues](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/keyvault/keyvault-keys/TROUBLESHOOTING.md)
12-
* [Troubleshooting Azure Key Vault Secrets SDK Issues](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/keyvault/keyvault-secrets/TROUBLESHOOTING.md)
9+
- [Troubleshooting Azure Key Vault Administration SDK Issues](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/keyvault/keyvault-admin/TROUBLESHOOTING.md)
10+
- [Troubleshooting Azure Key Vault Certificates SDK Issues](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/keyvault/keyvault-certificates/TROUBLESHOOTING.md)
11+
- [Troubleshooting Azure Key Vault Keys SDK Issues](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/keyvault/keyvault-keys/TROUBLESHOOTING.md)
12+
- [Troubleshooting Azure Key Vault Secrets SDK Issues](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/keyvault/keyvault-secrets/TROUBLESHOOTING.md)
1313

1414
## Table of Contents
1515

16-
* [Troubleshooting Authentication Issues](#troubleshooting-authentication-issues)
17-
* [HTTP 401 Errors](#http-401-errors)
18-
* [Frequent HTTP 401 Errors in Logs](#frequent-http-401-errors-in-logs)
19-
* [AKV10032: Invalid issuer](#akv10032-invalid-issuer)
20-
* [Other Authentication Issues](#other-authentication-issues)
21-
* [HTTP 403 Errors](#http-403-errors)
22-
* [Operation Not Permitted](#operation-not-permitted)
23-
* [Other Service Errors](#other-service-errors)
24-
* [HTTP 429: Too Many Request](#http-429-too-many-requests)
16+
- [Troubleshooting Authentication Issues](#troubleshooting-authentication-issues)
17+
- [HTTP 401 Errors](#http-401-errors)
18+
- [Frequent HTTP 401 Errors in Logs](#frequent-http-401-errors-in-logs)
19+
- [AKV10032: Invalid issuer](#akv10032-invalid-issuer)
20+
- [Other Authentication Issues](#other-authentication-issues)
21+
- [HTTP 403 Errors](#http-403-errors)
22+
- [Operation Not Permitted](#operation-not-permitted)
23+
- [Other Authentication Errors](#other-authentication-errors)
24+
- [Multi-tenant Authentication Issues](#multi-tenant-authentication-issues)
25+
- [Incorrect Challenge Resource](#incorrect-challenge-resource)
26+
- [Other Service Errors](#other-service-errors)
27+
- [HTTP 429: Too Many Requests](#http-429-too-many-requests)
28+
- [Support](#support)
2529

2630
## Troubleshooting Authentication Issues
2731

@@ -57,12 +61,12 @@ under the wrong tenant even though you're logged into the Azure CLI under the ri
5761
Automatic tenant discovery support has been added when referencing package `@azure/identity` version
5862
2.0.0 or newer, and any of the following Key Vault SDK package versions or newer:
5963

60-
Package | Minimum Version
61-
--- | ---
62-
`@azure/keyvault-admin` | 4.2.0
63-
`@azure/keyvault-certificates` | 4.4.0
64-
`@azure/keyvault-keys` | 4.4.0
65-
`@azure/keyvault-secrets` | 4.4.0
64+
| Package | Minimum Version |
65+
| ------------------------------ | --------------- |
66+
| `@azure/keyvault-admin` | 4.2.0 |
67+
| `@azure/keyvault-certificates` | 4.4.0 |
68+
| `@azure/keyvault-keys` | 4.4.0 |
69+
| `@azure/keyvault-secrets` | 4.4.0 |
6670

6771
Upgrading to these package versions should resolve any "Invalid Issuer" errors as long as the application or user is a member of the resource's tenant.
6872

@@ -93,10 +97,41 @@ The message and inner `code` may vary, but the rest of the text will indicate wh
9397
This error indicates that the authenticated application or user does not have permissions to perform that operation, though the cause may vary.
9498

9599
1. Check that the application or user has the appropriate permissions:
96-
* [Access policies](https://docs.microsoft.com/azure/key-vault/general/assign-access-policy) (Key Vault)
97-
* [Role-Based Access Control (RBAC)](https://docs.microsoft.com/azure/key-vault/general/rbac-guide) (Key Vault and Managed HSM)
100+
- [Access policies](https://docs.microsoft.com/azure/key-vault/general/assign-access-policy) (Key Vault)
101+
- [Role-Based Access Control (RBAC)](https://docs.microsoft.com/azure/key-vault/general/rbac-guide) (Key Vault and Managed HSM)
98102
2. If the appropriate permissions are assigned to your application or user, make sure you are authenticating as that user.
99-
* If using the [DefaultAzureCredential] a different credential might've been used than one you expected. [Enable logging](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/README.md#logging) and you will see which credential the [DefaultAzureCredential] used as shown below, and why previously-attempted credentials were rejected.
103+
- Are you using [DefaultAzureCredential]? If so, ensure that it is selecting the correct underlying credential type. [Enable logging](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/README.md#logging) to see which credential type was used.
104+
105+
### Other Authentication Errors
106+
107+
See the [`@azure/identity` troubleshooting guide][identity-troubleshooting-guide] for general guidance on authentication errors.
108+
109+
#### Multi-tenant Authentication Issues
110+
111+
If a `CredentialUnavailableError` message is thrown with a message similar to:
112+
113+
> The current credential is not configured to acquire tokens for tenant
114+
115+
See our [troubleshooting guide for multi-tenant authentication issues](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/TROUBLESHOOTING.md#troubleshoot-multi-tenant-authentication-issues).
116+
Read our [release notes](https://aka.ms/azsdk/blog/multi-tenant-guidance) for more information about this change.
117+
118+
#### Incorrect Challenge Resource
119+
120+
If an `Error` is thrown with a message similar to:
121+
122+
> The challenge resource 'myvault.vault.azure.net' does not match the requested domain. Set disableChallengeResourceVerification to true in your client options to disable. See https://aka.ms/azsdk/blog/vault-uri for more information.
123+
124+
Check that the resource is as expected - that you're not receiving a challenge from an unknown host which may indicate an incorrect request URI.
125+
126+
If it is correct but you are using a mock service or non-transparent proxy for testing, set `disableChallengeResourceVerification` to `true` in your client options:
127+
128+
```typescript
129+
const client = new SecretClient(vaultUri, credential, {
130+
disableChallengeResourceVerification: true,
131+
});
132+
```
133+
134+
Read our [release notes](https://aka.ms/azsdk/blog/vault-uri) for more information on this change.
100135

101136
## Other Service Errors
102137

@@ -115,4 +150,9 @@ Possible solutions include:
115150

116151
See our [Azure Key Vault throttling guide](https://docs.microsoft.com/azure/key-vault/general/overview-throttling) for more information.
117152

153+
## Support
154+
155+
For additional support, please search our [existing issues](https://github.com/Azure/azure-sdk-for-js/issues) or [open a new issue](https://github.com/Azure/azure-sdk-for-net/issues/new/choose). You may also find existing answers on community sites like [Stack Overflow](https://stackoverflow.com/questions/tagged/azure-keyvault+node.js).
156+
118157
[DefaultAzureCredential]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/README.md#defaultazurecredential
158+
[identity-troubleshooting-guide]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/TROUBLESHOOTING.md

sdk/keyvault/keyvault-certificates/migration-guide.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Guide for migrating to @azure/keyvault-certificates from azure-keyvault
22

3-
This guide is intended to assist in the migration to `@azure/keyvault-certificates` from `azure-keyvault`. It will focus on side-by-side comparisons for similar operations between the two packages.
3+
This guide is intended to assist in the migration to `@azure/keyvault-certificates` from the [deprecated] `azure-keyvault` package. It will focus on side-by-side comparisons for similar operations between the two packages.
44

55
Familiarity with the `azure-keyvault` package is assumed. For those new to the Key Vault client libraries for JavaScript, please refer to the [README for @azure/keyvault-certificates][kvc-npm] rather than this guide.
66

@@ -15,9 +15,12 @@ Familiarity with the `azure-keyvault` package is assumed. For those new to the K
1515
- [List properties of certificates](#list-properties-of-certificates)
1616
- [Delete a certificate](#delete-a-certificate)
1717
- [Additional samples](#additional-samples)
18+
- [Support](#support)
1819

1920
## Migration benefits
2021

22+
> Note: `azure-keyvault` has been [deprecated]. Please migrate to `@azure/keyvault-certificates` for continued support.
23+
2124
A natural question to ask when considering whether or not to adopt a new version or library is what the benefits of doing so would be. As Azure has matured and been embraced by a more diverse group of developers, we have been focused on learning the patterns and practices to best support developer productivity and to understand the gaps that the JavaScript client libraries have.
2225

2326
There were several areas of consistent feedback expressed across the Azure client library ecosystem. One of the most important is that the client libraries for different Azure services have not had a consistent approach to organization, naming, and API structure. Additionally, many developers have felt that the learning curve was difficult, and the APIs did not offer a good, approachable, and consistent onboarding story for those learning Azure or exploring a specific Azure service.
@@ -107,15 +110,15 @@ In `azure-keyvault` you could create a certificate by using `KeyVaultClient`'s `
107110
// Example of an old certificate policy
108111
let certificatePolicy = {
109112
issuerParameters: {
110-
name: "Self"
113+
name: "Self",
111114
},
112115
x509CertificateProperties: {
113-
subject: "CN=CLIGetDefaultPolicy"
114-
}
116+
subject: "CN=CLIGetDefaultPolicy",
117+
},
115118
};
116119

117120
let certificateOperation = await client.createCertificate(vaultUrl, "MyCertificate", {
118-
certificatePolicy: certificatePolicy
121+
certificatePolicy: certificatePolicy,
119122
});
120123
console.log(certificateOperation);
121124
```
@@ -126,7 +129,7 @@ A similar approach exists now in `@azure/keyvault-certificates`. You can provide
126129
// Example of a new certificate policy
127130
const certificatePolicy = {
128131
issuerName: "Self",
129-
subject: "cn=MyCert"
132+
subject: "cn=MyCert",
130133
};
131134

132135
const poller = await client.beginCreateCertificate("MyCertificate", certificatePolicy);
@@ -161,7 +164,7 @@ console.log(keyVaultCertificate.properties.version);
161164
for await (let versionProperties of client.listPropertiesOfCertificateVersions("MyCertificate")) {
162165
console.log("Name:", versionProperties.name, "Version:", versionProperties.version);
163166
const keyVaultCertificate = await client.getCertificate(versionProperties.name, {
164-
version: versionProperties.version
167+
version: versionProperties.version,
165168
});
166169
console.log(keyVaultCertificate.properties.version);
167170
}
@@ -212,6 +215,11 @@ await client.purgeDeletedCertificate(deletedCertificate.name);
212215
- [Key Vault Certificates samples for TypeScript](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/keyvault/keyvault-certificates/samples/v4/typescript)
213216
- [General Key Vault samples for TypeScript](https://docs.microsoft.com/samples/browse/?products=azure-key-vault&languages=typescript)
214217

218+
## Support
219+
220+
If you have migrated your code base and are experiencing errors, see our [troubleshooting guide](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/keyvault/TROUBLESHOOTING.md). For additional support, please search our [existing issues](https://github.com/Azure/azure-sdk-for-js/issues) or [open a new issue](https://github.com/Azure/azure-sdk-for-net/issues/new/choose). You may also find existing answers on community sites like [Stack Overflow](https://stackoverflow.com/questions/tagged/azure-keyvault+node.js).
221+
222+
[deprecated]: https://aka.ms/azsdk/deprecated
215223
[kvk-npm]: https://www.npmjs.com/package/@azure/keyvault-keys
216224
[kvs-npm]: https://www.npmjs.com/package/@azure/keyvault-secrets
217225
[kvc-npm]: https://www.npmjs.com/package/@azure/keyvault-certificates

sdk/keyvault/keyvault-keys/migration-guide.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Guide for migrating to @azure/keyvault-keys from azure-keyvault
22

3-
This guide is intended to assist in the migration to `@azure/keyvault-keys` from `azure-keyvault`. It will focus on side-by-side comparisons for similar operations between the two packages.
3+
This guide is intended to assist in the migration to `@azure/keyvault-keys` from the [deprecated] `azure-keyvault` package. It will focus on side-by-side comparisons for similar operations between the two packages.
44

55
Familiarity with the `azure-keyvault` package is assumed. For those new to the Key Vault client libraries for JavaScript, please refer to the [README for @azure/keyvault-keys][kvk-npm] rather than this guide.
66

@@ -16,9 +16,12 @@ Familiarity with the `azure-keyvault` package is assumed. For those new to the K
1616
- [Delete a key](#delete-a-key)
1717
- [Perform cryptographic operations](#perform-cryptographic-operations)
1818
- [Additional samples](#additional-samples)
19+
- [Support](#support)
1920

2021
## Migration benefits
2122

23+
> Note: `azure-keyvault` has been [deprecated]. Please migrate to `@azure/keyvault-keys` for continued support.
24+
2225
A natural question to ask when considering whether or not to adopt a new version or library is what the benefits of doing so would be. As Azure has matured and been embraced by a more diverse group of developers, we have been focused on learning the patterns and practices to best support developer productivity and to understand the gaps that the JavaScript client libraries have.
2326

2427
There were several areas of consistent feedback expressed across the Azure client library ecosystem. One of the most important is that the client libraries for different Azure services have not had a consistent approach to organization, naming, and API structure. Additionally, many developers have felt that the learning curve was difficult, and the APIs did not offer a good, approachable, and consistent onboarding story for those learning Azure or exploring a specific Azure service.
@@ -177,7 +180,7 @@ console.log(keyVaultKey.properties.version);
177180
for await (let versionProperties of client.listPropertiesOfKeyVersions("MyKey")) {
178181
console.log("Name:", versionProperties.name, "Version:", versionProperties.version);
179182
const keyVaultKey = await client.getKey(versionProperties.name, {
180-
version: versionProperties.version
183+
version: versionProperties.version,
181184
});
182185
console.log(keyVaultKey.properties.version);
183186
}
@@ -233,7 +236,7 @@ const operationResult = await client.encrypt(
233236
keyName,
234237
"",
235238
"RSA1_5",
236-
Buffer.from("plaintext")
239+
Buffer.from("plaintext"),
237240
);
238241
console.log(operationResult.result);
239242
```
@@ -254,6 +257,11 @@ console.log(operationResult.result);
254257
- [Key Vault keys samples for TypeScript](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/keyvault/keyvault-keys/samples/v4/typescript)
255258
- [General Key Vault samples for TypeScript](https://docs.microsoft.com/samples/browse/?products=azure-key-vault&languages=typescript)
256259

260+
## Support
261+
262+
If you have migrated your code base and are experiencing errors, see our [troubleshooting guide](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/keyvault/TROUBLESHOOTING.md). For additional support, please search our [existing issues](https://github.com/Azure/azure-sdk-for-js/issues) or [open a new issue](https://github.com/Azure/azure-sdk-for-net/issues/new/choose). You may also find existing answers on community sites like [Stack Overflow](https://stackoverflow.com/questions/tagged/azure-keyvault+node.js).
263+
264+
[deprecated]: https://aka.ms/azsdk/deprecated
257265
[kvk-npm]: https://www.npmjs.com/package/@azure/keyvault-keys
258266
[kvs-npm]: https://www.npmjs.com/package/@azure/keyvault-secrets
259267
[kvc-npm]: https://www.npmjs.com/package/@azure/keyvault-certificates

0 commit comments

Comments
 (0)