-
Couldn't load subscription status.
- Fork 4.1k
Description
Description
After Az.Accounts was updated to version 2.10.4 we can no longer change AzContext or generate a Access Token with a multi-tenant App registration.
Connect-AzAccount -TenantId (Tenant1 where the app registration is created) - this works OK.
Set-AzContext -TenantId (Tenant2 where the app registration is linked and registered as an Enterprise App) - We receive error.
Error: ##[error]The running command stopped because the preference variable "WarningPreference" or common parameter is set to Stop: Unable to acquire token for tenant 'XYZ' with error 'No certificate thumbprint or secret provided for the given service principal '***'.'
This is tested and worked in Az.Accounts version 2.10.0 - 2.10.3, and this is critical, as the way the import of Az.Accounts works is difficult to handle. Even though we specify an older version of
AzurePowershell
azurePowerShellVersion: OtherVersion
preferredAzurePowerShellVersion: 9.1.1 (tested with 8.3.0 and 9.1.0)
The Az will still import the latest version of Az.Accounts which has this error.
Issue script & Debug output
Connect-AzAccount -Tenant (Tenant1 where the app registration is created) -Credential $creds -ServicePrincipal- this works OK.
Set-AzContext -TenantId (Tenant2 where the app registration is registered as an Enterprise App) - We receive error.Environment data
This is tested and working in Az.Accounts version 2.10.0 - 2.10.3Module versions
Az.Accounts version 2.10.4Error output
Error: ##[error]The running command stopped because the preference variable "WarningPreference" or common parameter is set to Stop: Unable to acquire token for tenant 'XYZ' with error 'No certificate thumbprint or secret provided for the given service principal '***'.'