@@ -15,7 +15,7 @@ npm install @azure/arm-policy
1515
1616### How to use
1717
18- #### nodejs - Authentication, client creation and get policyAssignments as an example written in TypeScript.
18+ #### nodejs - client creation and getByPolicyMode dataPolicyManifests as an example written in TypeScript.
1919
2020##### Install @azure/ms-rest-nodeauth
2121
@@ -26,18 +26,16 @@ npm install @azure/ms-rest-nodeauth@"^3.0.0"
2626
2727##### Sample code
2828
29+ While the below sample uses the interactive login, other authentication options can be found in the [ README.md file of @azure/ms-rest-nodeauth ] ( https://www.npmjs.com/package/@azure/ms-rest-nodeauth ) package
2930``` typescript
30- import * as msRest from " @azure/ms-rest-js" ;
31- import * as msRestAzure from " @azure/ms-rest-azure-js" ;
32- import * as msRestNodeAuth from " @azure/ms-rest-nodeauth" ;
33- import { PolicyClient , PolicyModels , PolicyMappers } from " @azure/arm-policy" ;
31+ const msRestNodeAuth = require (" @azure/ms-rest-nodeauth" );
32+ const { PolicyClient } = require (" @azure/arm-policy" );
3433const subscriptionId = process .env [" AZURE_SUBSCRIPTION_ID" ];
3534
3635msRestNodeAuth .interactiveLogin ().then ((creds ) => {
3736 const client = new PolicyClient (creds , subscriptionId );
38- const scope = " testscope" ;
39- const policyAssignmentName = " testpolicyAssignmentName" ;
40- client .policyAssignments .get (scope , policyAssignmentName ).then ((result ) => {
37+ const policyMode = " testpolicyMode" ;
38+ client .dataPolicyManifests .getByPolicyMode (policyMode ).then ((result ) => {
4139 console .log (" The result is:" );
4240 console .log (result );
4341 });
@@ -46,7 +44,7 @@ msRestNodeAuth.interactiveLogin().then((creds) => {
4644});
4745```
4846
49- #### browser - Authentication, client creation and get policyAssignments as an example written in JavaScript.
47+ #### browser - Authentication, client creation and getByPolicyMode dataPolicyManifests as an example written in JavaScript.
5048
5149##### Install @azure/ms-rest-browserauth
5250
@@ -80,9 +78,8 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
8078 authManager .login ();
8179 }
8280 const client = new Azure.ArmPolicy.PolicyClient (res .creds , subscriptionId);
83- const scope = " testscope" ;
84- const policyAssignmentName = " testpolicyAssignmentName" ;
85- client .policyAssignments .get (scope, policyAssignmentName).then ((result ) => {
81+ const policyMode = " testpolicyMode" ;
82+ client .dataPolicyManifests .getByPolicyMode (policyMode).then ((result ) => {
8683 console .log (" The result is:" );
8784 console .log (result);
8885 }).catch ((err ) => {
0 commit comments