Skip to content

Commit

Permalink
Fix #384: Remove az account clear in az cli (#398)
Browse files Browse the repository at this point in the history
  • Loading branch information
MoChilia authored Jan 8, 2024
1 parent b503882 commit 3f2bf91
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/azure-login-positive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/Cli/AzureCliLogin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3f2bf91

Please sign in to comment.