1
0
Fork 0
mirror of synced 2026-06-05 14:28:19 +00:00

Fix #384: Remove az account clear in az cli (#398)

This commit is contained in:
Shiying Chen 2024-01-08 18:26:20 +08:00 committed by GitHub
commit 3f2bf91b4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View file

@ -207,17 +207,21 @@ jobs:
enable-AzPSSession: true
- name: Run Azure Cli
shell: pwsh
run: |
az account show --output none
$checkResult = (az account list --output json | ConvertFrom-Json).Count -eq 2
if(-not $checkResult){
throw "Not all checks passed!"
}
- name: Run Azure PowerShell
uses: azure/powershell@v1
with:
azPSVersion: "latest"
inlineScript: |
$checkResult = (Get-AzContext).Environment.Name -eq 'AzureCloud'
$checkResult = (Get-AzContext -ListAvailable).Count -eq 2
if(-not $checkResult){
throw "Not all checks passed!"
throw "Not all checks passed!"
}
- name: Login with creds, no subscription, allow no subscription

View file

@ -31,8 +31,6 @@ export class AzureCliLogin {
await this.executeAzCliCommand(["--version"], true, execOptions);
core.debug(`Azure CLI version used:\n${output}`);
await this.executeAzCliCommand(["account", "clear"], true, execOptions);
this.setAzurestackEnvIfNecessary();
await this.executeAzCliCommand(["cloud", "set", "-n", this.loginConfig.environment], false);