mirror of
https://github.com/azure/login.git
synced 2026-03-15 09:20:56 -04:00
Added changes for azure powershell login
This commit is contained in:
@@ -21,12 +21,13 @@ const crypto = __importStar(require("crypto"));
|
||||
const exec = __importStar(require("@actions/exec"));
|
||||
const io = __importStar(require("@actions/io"));
|
||||
const actions_secret_parser_1 = require("actions-secret-parser");
|
||||
const loginAzurePowerShell_1 = require("./loginAzurePowerShell");
|
||||
var azPath;
|
||||
var prefix = !!process.env.AZURE_HTTP_USER_AGENT ? `${process.env.AZURE_HTTP_USER_AGENT}` : "";
|
||||
function main() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
// Set user agent varable
|
||||
// Set user agent variable
|
||||
let usrAgentRepo = crypto.createHash('sha256').update(`${process.env.GITHUB_REPOSITORY}`).digest('hex');
|
||||
let actionName = 'AzureLogin';
|
||||
let userAgentString = (!!prefix ? `${prefix}+` : '') + `GITHUBACTIONS_${actionName}_${usrAgentRepo}`;
|
||||
@@ -44,6 +45,7 @@ function main() {
|
||||
}
|
||||
yield executeAzCliCommand(`login --service-principal -u "${servicePrincipalId}" -p "${servicePrincipalKey}" --tenant "${tenantId}"`);
|
||||
yield executeAzCliCommand(`account set --subscription "${subscriptionId}"`);
|
||||
yield loginAzurePowerShell_1.initializeAz(servicePrincipalId, servicePrincipalKey, tenantId, subscriptionId);
|
||||
console.log("Login successful.");
|
||||
}
|
||||
catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user