Removed az login as CLI is not used in the script

This commit is contained in:
Alexander (Sasha) Nosov
2025-05-20 12:52:34 -07:00
parent bd62ed4c1e
commit 593ba9a04c
@@ -123,19 +123,6 @@ function Connect-Azure {
}
Write-Output "Connected to Azure PowerShell as: $($ctx.Account)"
# 3) Sync Azure CLI if available
if (Get-Command az -ErrorAction SilentlyContinue) {
Write-Output "Running az login..."
if ($UseManagedIdentity -or $envType -eq 'AzureAutomation') {
az login --tenant $TenantId --identity | Out-Null
}
else {
az login --tenant $TenantId | Out-Null
}
$acct = az account show --output json | ConvertFrom-Json
}
Write-Output "Azure CLI logged in as: $($acct.user.name)"
}