File tree Expand file tree Collapse file tree 1 file changed +1
-20
lines changed
packages/msgraph-sdk-admin Expand file tree Collapse file tree 1 file changed +1
-20
lines changed Original file line number Diff line number Diff line change @@ -26,29 +26,10 @@ npm install @microsoft/msgraph-sdk-admin
26
26
Here is an example of how to use the package:
27
27
28
28
``` typescript
29
- import { createGraphServiceClient , GraphRequestAdapter } from " @microsoft/msgraph-sdk" ;
30
- import { AzureIdentityAuthenticationProvider } from " @microsoft/kiota-authentication-azure" ;
31
- import { ClientSecretCredential } from " @azure/identity" ;
32
29
import " @microsoft/msgraph-sdk-admin"
33
30
34
- // Create a credential using ClientSecretCredential
35
- const credential = new ClientSecretCredential (
36
- ' YOUR_TENANT_ID' ,
37
- ' YOUR_CLIENT_ID' ,
38
- ' YOUR_CLIENT_SECRET' ,
39
- );
40
-
41
- // Create an authentication provider
42
- const authProvider = new AzureIdentityAuthenticationProvider (credential , [" https://graph.microsoft.com/.default" ]);
43
-
44
- // Create a request adapter
45
- const requestAdapter = new GraphRequestAdapter (authProvider );
46
-
47
- // Create a GraphServiceClient
48
- const graphServiceClient = createGraphServiceClient (requestAdapter );
49
-
50
31
// Use the GraphServiceClient to make requests by including the appropriate API calls package
51
- // e.g graphServiceClient.admin.(complete your call)
32
+ const admin = graphServiceClient .admin .get ();
52
33
53
34
```
54
35
You can’t perform that action at this time.
0 commit comments