Skip to content

Commit 54a9b5d

Browse files
authored
[KeyVault] - Update broken links in migration guide (Azure#15067)
In Azure#15023 we moved to samples to the V2 flow, but some links were still pointing to the old URL. This commit updates the links that were reported broken in [ADO](https://dev.azure.com/azure-sdk/internal/_build/results?buildId=867335) to point to the right sample.
1 parent a1cd77d commit 54a9b5d

File tree

4 files changed

+65
-61
lines changed

4 files changed

+65
-61
lines changed

sdk/keyvault/keyvault-certificates/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -677,8 +677,8 @@ setLogLevel("info");
677677

678678
You can find more code samples through the following links:
679679

680-
- [KeyVault Certificates Samples (JavaScript)](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/keyvault/keyvault-certificates/samples/javascript)
681-
- [KeyVault Certificates Samples (TypeScript)](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/keyvault/keyvault-certificates/samples/typescript)
680+
- [KeyVault Certificates Samples (JavaScript)](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/keyvault/keyvault-certificates/samples/v4/javascript)
681+
- [KeyVault Certificates Samples (TypeScript)](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/keyvault/keyvault-certificates/samples/v4/typescript)
682682
- [KeyVault Certificates Test Cases](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/keyvault/keyvault-certificates/test/)
683683

684684
## Contributing

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

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ Familiarity with the `azure-keyvault` package is assumed. For those new to the K
66

77
## Table of contents
88

9-
* [Migration benefits](#migration-benefits)
10-
* [Important changes](#important-changes)
11-
- [Separate packages and clients](#separate-packages-and-clients)
12-
- [Client constructors](#client-constructors)
13-
- [Create a certificate](#create-a-certificate)
14-
- [Retrieve a certificate](#retrieve-a-certificate)
15-
- [List properties of certificates](#list-properties-of-certificates)
16-
- [Delete a certificate](#delete-a-certificate)
17-
* [Additional samples](#additional-samples)
9+
- [Migration benefits](#migration-benefits)
10+
- [Important changes](#important-changes)
11+
- [Separate packages and clients](#separate-packages-and-clients)
12+
- [Client constructors](#client-constructors)
13+
- [Create a certificate](#create-a-certificate)
14+
- [Retrieve a certificate](#retrieve-a-certificate)
15+
- [List properties of certificates](#list-properties-of-certificates)
16+
- [Delete a certificate](#delete-a-certificate)
17+
- [Additional samples](#additional-samples)
1818

1919
## Migration benefits
2020

@@ -27,6 +27,7 @@ To try and improve the development experience across Azure services, a set of un
2727
### Cross Service SDK improvements
2828

2929
The modern Key Vault client libraries also share some of the cross-service improvements made to the Azure development experience, such as:
30+
3031
- Using the new `@azure/identity` library to share a single authentication approach between clients.
3132
- A unified logging and diagnostics pipeline that offers a common view of the activities across each of the client libraries.
3233
- The use of promises rather than callbacks for a simplified programming experience.
@@ -36,7 +37,7 @@ The modern Key Vault client libraries also share some of the cross-service impro
3637

3738
### Separate packages and clients
3839

39-
In the interest of simplifying the API for working with Key Vault keys, secrets and certificates, the `azure-keyvault` package is split into separate packages.
40+
In the interest of simplifying the API for working with Key Vault keys, secrets and certificates, the `azure-keyvault` package is split into separate packages.
4041

4142
- [`@azure/keyvault-keys`][kvk-npm] contains `KeyClient` for working with Key Vault keys, and `CryptographyClient` for performing cryptographic operations.
4243
- [`@azure/keyvault-secrets`][kvs-npm] contains `SecretClient` for working with Key Vault secrets.
@@ -51,20 +52,16 @@ Across all of the new Azure client libraries, clients consistently take an endpo
5152
Previously in `azure-keyvault` you could create a `KeyVaultClient` by using credentials from `ms-rest-azure` (up to the version `^2.6.0`. Higher versions are not supported).
5253

5354
```js
54-
var KeyVault = require('azure-keyvault');
55-
var msRestAzure = require('ms-rest-azure');
55+
var KeyVault = require("azure-keyvault");
56+
var msRestAzure = require("ms-rest-azure");
5657

5758
const clientId = "client id";
5859
const secret = "client secret";
5960
const domain = "tenant id";
6061
const vaultUrl = `https://my-vault.vault.azure.net/`;
6162

6263
async function main() {
63-
const credentials = await msRestAzure.loginWithServicePrincipalSecret(
64-
clientId,
65-
secret,
66-
domain
67-
);
64+
const credentials = await msRestAzure.loginWithServicePrincipalSecret(clientId, secret, domain);
6865
const client = new KeyVault.KeyVaultClient(credentials);
6966
const keyVaultCertificate = await client.getCertificate(vaultUrl, "MyCertificate", "");
7067
console.log(keyVaultCertificate);
@@ -81,7 +78,7 @@ You can install them by simply running the following command at the root of your
8178
npm install --save @azure/identity @azure/keyvault-certificates
8279
```
8380

84-
Below is a simple example using both `@azure/keyvault-certificates` and [`DefaultAzureCredential`][identity-readme-DAC]:
81+
Below is a simple example using both `@azure/keyvault-certificates` and [`DefaultAzureCredential`][identity-readme-dac]:
8582

8683
```ts
8784
// The default credential first checks environment variables for configuration as described above.
@@ -110,14 +107,16 @@ In `azure-keyvault` you could create a certificate by using `KeyVaultClient`'s `
110107
// Example of an old certificate policy
111108
let certificatePolicy = {
112109
issuerParameters: {
113-
name: "Self",
110+
name: "Self"
114111
},
115112
x509CertificateProperties: {
116-
subject: "CN=CLIGetDefaultPolicy",
113+
subject: "CN=CLIGetDefaultPolicy"
117114
}
118115
};
119116

120-
let certificateOperation = await client.createCertificate(vaultUrl, "MyCertificate", { certificatePolicy: certificatePolicy });
117+
let certificateOperation = await client.createCertificate(vaultUrl, "MyCertificate", {
118+
certificatePolicy: certificatePolicy
119+
});
121120
console.log(certificateOperation);
122121
```
123122

@@ -126,15 +125,14 @@ A similar approach exists now in `@azure/keyvault-certificates`. You can provide
126125
```ts
127126
// Example of a new certificate policy
128127
const certificatePolicy = {
129-
issuerName: 'Self',
128+
issuerName: "Self",
130129
subject: "cn=MyCert"
131130
};
132131

133132
const poller = await client.beginCreateCertificate("MyCertificate", certificatePolicy);
134133
const keyVaultCertificate = poller.getResult();
135134
console.log(keyVaultCertificate);
136135
await poller.pollUntilDone();
137-
138136
```
139137

140138
### Retrieve a certificate
@@ -162,7 +160,9 @@ console.log(keyVaultCertificate.properties.version);
162160

163161
for await (let versionProperties of client.listPropertiesOfCertificateVersions("MyCertificate")) {
164162
console.log("Name:", versionProperties.name, "Version:", versionProperties.version);
165-
const keyVaultCertificate = await client.getCertificate(versionProperties.name, { version: versionProperties.version });
163+
const keyVaultCertificate = await client.getCertificate(versionProperties.name, {
164+
version: versionProperties.version
165+
});
166166
console.log(keyVaultCertificate.properties.version);
167167
}
168168
```
@@ -207,14 +207,14 @@ await client.purgeDeletedCertificate(deletedCertificate.name);
207207

208208
## Additional samples
209209

210-
* [Key Vault Certificates samples for JavaScript](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/keyvault/keyvault-certificates/samples/javascript)
211-
* [General Key Vault samples for JavaScript](https://docs.microsoft.com/samples/browse/?products=azure-key-vault&languages=javascript)
212-
* [Key Vault Certificates samples for TypeScript](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/keyvault/keyvault-certificates/samples/typescript)
213-
* [General Key Vault samples for TypeScript](https://docs.microsoft.com/samples/browse/?products=azure-key-vault&languages=typescript)
210+
- [Key Vault Certificates samples for JavaScript](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/keyvault/keyvault-certificates/samples/v4/javascript)
211+
- [General Key Vault samples for JavaScript](https://docs.microsoft.com/samples/browse/?products=azure-key-vault&languages=javascript)
212+
- [Key Vault Certificates samples for TypeScript](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/keyvault/keyvault-certificates/samples/v4/typescript)
213+
- [General Key Vault samples for TypeScript](https://docs.microsoft.com/samples/browse/?products=azure-key-vault&languages=typescript)
214214

215215
[kvk-npm]: https://www.npmjs.com/package/@azure/keyvault-keys
216216
[kvs-npm]: https://www.npmjs.com/package/@azure/keyvault-secrets
217217
[kvc-npm]: https://www.npmjs.com/package/@azure/keyvault-certificates
218218
[ts-guidelines]: https://azure.github.io/azure-sdk/typescript_introduction.html
219219
[identity-npm]: https://www.npmjs.com/package/@azure/identity
220-
[identity-readme-DAC]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/README.md#defaultazurecredential
220+
[identity-readme-dac]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/README.md#defaultazurecredential

sdk/keyvault/keyvault-keys/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -828,8 +828,8 @@ setLogLevel("info");
828828

829829
You can find more code samples through the following links:
830830

831-
- [KeyVault Keys Samples (JavaScript)](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/keyvault/keyvault-keys/samples/javascript)
832-
- [KeyVault Keys Samples (TypeScript)](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/keyvault/keyvault-keys/samples/typescript)
831+
- [KeyVault Keys Samples (JavaScript)](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/keyvault/keyvault-keys/samples/v4/javascript)
832+
- [KeyVault Keys Samples (TypeScript)](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/keyvault/keyvault-keys/samples/v4/typescript)
833833
- [KeyVault Keys Test Cases](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/keyvault/keyvault-keys/test/)
834834

835835
## Contributing

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

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ Familiarity with the `azure-keyvault` package is assumed. For those new to the K
66

77
## Table of contents
88

9-
* [Migration benefits](#migration-benefits)
10-
* [Important changes](#important-changes)
11-
- [Separate packages and clients](#separate-packages-and-clients)
12-
- [Client constructors](#client-constructors)
13-
- [Create a key](#create-a-key)
14-
- [Retrieve a key](#retrieve-a-key)
15-
- [List properties of keys](#list-properties-of-keys)
16-
- [Delete a key](#delete-a-key)
17-
- [Perform cryptographic operations](#perform-cryptographic-operations)
18-
* [Additional samples](#additional-samples)
9+
- [Migration benefits](#migration-benefits)
10+
- [Important changes](#important-changes)
11+
- [Separate packages and clients](#separate-packages-and-clients)
12+
- [Client constructors](#client-constructors)
13+
- [Create a key](#create-a-key)
14+
- [Retrieve a key](#retrieve-a-key)
15+
- [List properties of keys](#list-properties-of-keys)
16+
- [Delete a key](#delete-a-key)
17+
- [Perform cryptographic operations](#perform-cryptographic-operations)
18+
- [Additional samples](#additional-samples)
1919

2020
## Migration benefits
2121

@@ -28,6 +28,7 @@ To try and improve the development experience across Azure services, a set of un
2828
### Cross Service SDK improvements
2929

3030
The modern Key Vault client libraries also share some of the cross-service improvements made to the Azure development experience, such as:
31+
3132
- Using the new `@azure/identity` library to share a single authentication approach between clients.
3233
- A unified logging and diagnostics pipeline that offers a common view of the activities across each of the client libraries.
3334
- The use of promises rather than callbacks for a simplified programming experience.
@@ -37,7 +38,7 @@ The modern Key Vault client libraries also share some of the cross-service impro
3738

3839
### Separate packages and clients
3940

40-
In the interest of simplifying the API for working with Key Vault keys, secrets and certificates, the `azure-keyvault` package is split into separate packages.
41+
In the interest of simplifying the API for working with Key Vault keys, secrets and certificates, the `azure-keyvault` package is split into separate packages.
4142

4243
- [`@azure/keyvault-keys`][kvk-npm] contains `KeyClient` for working with Key Vault keys, and `CryptographyClient` for performing cryptographic operations.
4344
- [`@azure/keyvault-secrets`][kvs-npm] contains `SecretClient` for working with Key Vault secrets.
@@ -51,22 +52,17 @@ Across all of the new Azure client libraries, clients consistently take an endpo
5152

5253
Previously in `azure-keyvault` you could create a `KeyVaultClient` by using credentials from `ms-rest-azure` (up to the version `^2.6.0`. Higher versions are not supported).
5354

54-
5555
```js
56-
var KeyVault = require('azure-keyvault');
57-
var msRestAzure = require('ms-rest-azure');
56+
var KeyVault = require("azure-keyvault");
57+
var msRestAzure = require("ms-rest-azure");
5858

5959
const clientId = "client id";
6060
const secret = "client secret";
6161
const domain = "tenant id";
6262
const vaultUrl = `https://my-vault.vault.azure.net/`;
6363

6464
async function main() {
65-
const credentials = await msRestAzure.loginWithServicePrincipalSecret(
66-
clientId,
67-
secret,
68-
domain
69-
);
65+
const credentials = await msRestAzure.loginWithServicePrincipalSecret(clientId, secret, domain);
7066
const client = new KeyVault.KeyVaultClient(credentials);
7167
const keyVaultKey = await client.getKey(vaultUrl, "MyKey", "");
7268
console.log(keyVaultKey);
@@ -83,7 +79,7 @@ You can install them by simply running the following command at the root of your
8379
npm install --save @azure/identity @azure/keyvault-keys
8480
```
8581

86-
Below is a simple example using both `@azure/keyvault-keys` and [`DefaultAzureCredential`][identity-readme-DAC]:
82+
Below is a simple example using both `@azure/keyvault-keys` and [`DefaultAzureCredential`][identity-readme-dac]:
8783

8884
```ts
8985
// The default credential first checks environment variables for configuration as described above.
@@ -134,7 +130,7 @@ let keyBundle = await client.createKey(vaultUrl, "myRSAKey", "RSA");
134130
console.log(keyBundle);
135131

136132
// create an elliptic curve key
137-
keyBundle = await client.createKey(vaultUrl, "myECKey", "EC")
133+
keyBundle = await client.createKey(vaultUrl, "myECKey", "EC");
138134
console.log(keyBundle);
139135
```
140136

@@ -180,7 +176,9 @@ console.log(keyVaultKey.properties.version);
180176

181177
for await (let versionProperties of client.listPropertiesOfKeyVersions("MyKey")) {
182178
console.log("Name:", versionProperties.name, "Version:", versionProperties.version);
183-
const keyVaultKey = await client.getKey(versionProperties.name, { version: versionProperties.version });
179+
const keyVaultKey = await client.getKey(versionProperties.name, {
180+
version: versionProperties.version
181+
});
184182
console.log(keyVaultKey.properties.version);
185183
}
186184
```
@@ -230,7 +228,13 @@ In `azure-keyvault` you could perform cryptographic operations with keys by usin
230228
```js
231229
const keyName = "MyKey";
232230
await client.createKey(vaultUrl, keyName, "RSA");
233-
const operationResult = await client.encrypt(vaultUrl, keyName, "", "RSA1_5", Buffer.from("plaintext"));
231+
const operationResult = await client.encrypt(
232+
vaultUrl,
233+
keyName,
234+
"",
235+
"RSA1_5",
236+
Buffer.from("plaintext")
237+
);
234238
console.log(operationResult.result);
235239
```
236240

@@ -245,14 +249,14 @@ console.log(operationResult.result);
245249

246250
## Additional samples
247251

248-
* [Key Vault keys samples for JavaScript](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/keyvault/keyvault-keys/samples/javascript)
249-
* [General Key Vault samples for JavaScript](https://docs.microsoft.com/samples/browse/?products=azure-key-vault&languages=javascript)
250-
* [Key Vault keys samples for TypeScript](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/keyvault/keyvault-keys/samples/typescript)
251-
* [General Key Vault samples for TypeScript](https://docs.microsoft.com/samples/browse/?products=azure-key-vault&languages=typescript)
252+
- [Key Vault keys samples for JavaScript](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/keyvault/keyvault-keys/samples/v4/javascript)
253+
- [General Key Vault samples for JavaScript](https://docs.microsoft.com/samples/browse/?products=azure-key-vault&languages=javascript)
254+
- [Key Vault keys samples for TypeScript](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/keyvault/keyvault-keys/samples/v4/typescript)
255+
- [General Key Vault samples for TypeScript](https://docs.microsoft.com/samples/browse/?products=azure-key-vault&languages=typescript)
252256

253257
[kvk-npm]: https://www.npmjs.com/package/@azure/keyvault-keys
254258
[kvs-npm]: https://www.npmjs.com/package/@azure/keyvault-secrets
255259
[kvc-npm]: https://www.npmjs.com/package/@azure/keyvault-certificates
256260
[ts-guidelines]: https://azure.github.io/azure-sdk/typescript_introduction.html
257261
[identity-npm]: https://www.npmjs.com/package/@azure/identity
258-
[identity-readme-DAC]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/README.md#defaultazurecredential
262+
[identity-readme-dac]: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/README.md#defaultazurecredential

0 commit comments

Comments
 (0)