mirror of
https://github.com/azure/login.git
synced 2026-03-12 18:07:08 -04:00
10
.github/workflows/azure-login-positive.yml
vendored
10
.github/workflows/azure-login-positive.yml
vendored
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user