You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import { AzPSLogin } from './PowerShell/AzPSLogin';
import { LoginConfig } from './common/LoginConfig';
import { AzureCliLogin } from './Cli/AzureCliLogin';
async function main() {
try {
setUserAgent();
// prepare the login configuration
var loginConfig = new LoginConfig();
await loginConfig.initialize();
await loginConfig.validate();
// login to Azure CLI
var cliLogin = new AzureCliLogin(loginConfig);
await cliLogin.login();
//login to Azure PowerShell
if (loginConfig.enableAzPSSession) {
var psLogin: AzPSLogin = new AzPSLogin(loginConfig);
await psLogin.login();
}
}
catch (error) {
core.setFailed(`Login failed with ${error}. Double check if the 'auth-type' is correct. Refer to https://github.com/Azure/login#readme for more information.`);