Skip to content

Instantly share code, notes, and snippets.

@dwalleck
Created May 22, 2019 19:03
Show Gist options
  • Save dwalleck/4d049d3515e82bb4b687fe95a1da194d to your computer and use it in GitHub Desktop.
Save dwalleck/4d049d3515e82bb4b687fe95a1da194d to your computer and use it in GitHub Desktop.
Azure auth subscriptions returned example
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