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
Our project is now initialized with a *packages.json* file. Our project is going to use some Azure libraries contained in NPM packages. We'll use the library for Azure Active Directory authentication in Node.js (@azure/ms-rest-nodeauth) and the Azure CDN Client Library for JavaScript (@azure/arm-cdn). Let's add those to the project as dependencies.
46
+
Our project is now initialized with a *packages.json* file. Our project is going to use some Azure libraries contained in NPM packages. We'll use the library for Azure Active Directory authentication in Node.js (@azure/identity) and the Azure CDN Client Library for JavaScript (@azure/arm-cdn). Let's add those to the project as dependencies.
47
47
48
48
```console
49
-
npm install --save @azure/ms-rest-nodeauth
49
+
npm install --save @azure/identity
50
50
npm install --save @azure/arm-cdn
51
51
```
52
52
@@ -64,8 +64,8 @@ After the packages are done installing, the *package.json* file should look simi
64
64
"author": "Cam Soper",
65
65
"license": "MIT",
66
66
"dependencies": {
67
-
"@azure/arm-cdn": "^5.2.0",
68
-
"@azure/ms-rest-nodeauth": "^3.0.0"
67
+
"@azure/arm-cdn": "^7.0.1",
68
+
"@azure/identity": "^2.0.4"
69
69
}
70
70
}
71
71
```
@@ -78,7 +78,7 @@ With *app.js* open in our editor, let's get the basic structure of our program w
78
78
1. Add the "requires" for our NPM packages at the top with the following:
79
79
80
80
```javascript
81
-
var msRestAzure =require('@azure/ms-rest-nodeauth');
2. We need to define some constants our methods will use. Add the following. Be sure to replace the placeholders, including the **<angle brackets>**, with your own values as needed.
@@ -97,7 +97,7 @@ With *app.js* open in our editor, let's get the basic structure of our program w
97
97
3. Next, we'll instantiate the CDN management client and give it our credentials.
98
98
99
99
``` javascript
100
-
var credentials = new msRestAzure.ApplicationTokenCredentials(clientId, tenantId, clientSecret);
100
+
var credentials = new DefaultAzureCredential();
101
101
var cdnClient = new CdnManagementClient(credentials, subscriptionId);
102
102
```
103
103
@@ -246,7 +246,7 @@ function cdnCreate() {
246
246
}
247
247
248
248
// create profile <profile name>
249
-
function cdnCreateProfile() {
249
+
async function cdnCreateProfile() {
250
250
requireParms(3);
251
251
console.log("Creating profile...");
252
252
var standardCreateParameters = {
@@ -256,11 +256,11 @@ function cdnCreateProfile() {
0 commit comments