File tree 4 files changed +1646
-2
lines changed
4 files changed +1646
-2
lines changed Original file line number Diff line number Diff line change 1
- node_modules
1
+ node_modules
2
+ .env
3
+
4
+ aks.json
5
+ test_output.json
6
+ test.json
Original file line number Diff line number Diff line change
1
+ const AzureCompute = require ( '@azure/arm-compute' ) ;
2
+ const AzureResources = require ( '@azure/arm-resources' )
3
+ const MsRest = require ( '@azure/ms-rest-nodeauth' ) ;
4
+ const ClientID = process . env . ARM_CLIENT_ID ;
5
+ const ClientSecret = process . env . ARM_CLIENT_SECRET ;
6
+ const SubscriptionID = process . env . ARM_SUBSCRIPTION_ID ;
7
+ const TenantID = process . env . ARM_TENANT_ID ;
8
+ const FS = require ( 'fs' ) ;
9
+
10
+
11
+ function getCredentials ( ) {
12
+ return new Promise ( ( resolve , reject ) => {
13
+ MsRest . loginWithServicePrincipalSecret (
14
+ ClientID ,
15
+ ClientSecret ,
16
+ TenantID ,
17
+ ( err , credentials ) => {
18
+ err ? reject ( err ) : resolve ( credentials ) ;
19
+ }
20
+ )
21
+ } )
22
+ }
23
+
24
+ getCredentials ( ) . then ( credentials => {
25
+ const client = new AzureResources . ResourceManagementClient ( credentials , SubscriptionID ) ;
26
+
27
+ client . resources . list ( )
28
+ . then ( result => {
29
+ console . log ( result . length )
30
+ } )
31
+
32
+ } )
You can’t perform that action at this time.
0 commit comments