Created
May 22, 2019 19:03
-
-
Save dwalleck/4d049d3515e82bb4b687fe95a1da194d to your computer and use it in GitHub Desktop.
Azure auth subscriptions returned example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const msRestNodeAuth = require('@azure/ms-rest-nodeauth'); | |
const msRest = require('ms-rest-azure'); | |
const clientId = ''; | |
const clientSecret = '' | |
const tenantId = ''; | |
const main = async () => { | |
const oldCreds = await msRest.loginWithServicePrincipalSecretWithAuthResponse( | |
clientId, | |
clientSecret, | |
tenantId, | |
); | |
const newCreds = await msRestNodeAuth.loginWithServicePrincipalSecretWithAuthResponse( | |
clientId, | |
clientSecret, | |
tenantId, | |
); | |
console.log(`msRestAzure subscriptions: ${JSON.stringify(oldCreds.subscriptions, null, 4)}`); | |
console.log(`msRestNodeAuth subscriptions: ${JSON.stringify(newCreds.subscriptions, null, 4)}`); | |
} | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment