import * as msRestNodeAuth from "../lib/msRestNodeAuth" ; import * as dotenv from "dotenv" ; dotenv . config ( ) ; const clientId = process . env . CLIENT_ID || "" ; const tenantId = process . env . DOMAIN || "" ; const secret = process . env . APPLICATION_SECRET || "" ; async function main ( ) { try { const authres = await msRestNodeAuth . loginWithServicePrincipalSecretWithAuthResponse ( clientId , secret , tenantId ) ; console . log ( authres ) ; } catch ( err ) { console . log ( err ) ; } } main ( ) ;