microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.47k stars 2.6k forks source link

[BUG]: AzurePowerShell@5 Error "The operation was canceled" appears after 2 minutes #18850

Closed nosalan closed 6 months ago

nosalan commented 1 year ago

Task name

AzurePowerShell

Task version

5

Environment type (Please select at least one enviroment where you face this issue)

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Ubuntu 20.04

Task log

##[debug]Evaluating condition for step: '<REDACTED>'
##[debug]Evaluating: SucceededNode()
##[debug]Evaluating SucceededNode:
##[debug]=> True
##[debug]Result: True
##[section]Starting: <REDACTED>
==============================================================================
Task         : Azure PowerShell
Description  : Run a PowerShell script within an Azure environment
Version      : 5.226.0
Author       : Microsoft Corporation
Help         : https://aka.ms/azurepowershelltroubleshooting
==============================================================================
##[debug]Using node path: /azp/externals/node16/bin/node
##[debug]agent.TempDirectory=/azp/_work/_temp
##[debug]loading inputs and endpoints
##[debug]loading INPUT_CONNECTEDSERVICENAMEARM
##[debug]loading INPUT_SCRIPTTYPE
##[debug]loading INPUT_SCRIPTPATH
##[debug]loading INPUT_INLINE
##[debug]loading INPUT_ERRORACTIONPREFERENCE
##[debug]loading INPUT_FAILONSTANDARDERROR
##[debug]loading INPUT_TARGETAZUREPS
##[debug]loading INPUT_PWSH
##[debug]loading INPUT_VALIDATESCRIPTSIGNATURE
##[debug]loading INPUT_WORKINGDIRECTORY
##[debug]loading ENDPOINT_AUTH_676e3058-a671-46a9-b98a-55848e86b847
##[debug]loading ENDPOINT_AUTH_SCHEME_676e3058-a671-46a9-b98a-55848e86b847
##[debug]loading ENDPOINT_AUTH_PARAMETER_676e3058-a671-46a9-b98a-55848e86b847_TENANTID
##[debug]loading ENDPOINT_AUTH_PARAMETER_676e3058-a671-46a9-b98a-55848e86b847_SERVICEPRINCIPALID
##[debug]loading ENDPOINT_AUTH_PARAMETER_676e3058-a671-46a9-b98a-55848e86b847_AUTHENTICATIONTYPE
##[debug]loading ENDPOINT_AUTH_PARAMETER_676e3058-a671-46a9-b98a-55848e86b847_SERVICEPRINCIPALKEY
##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
##[debug]loading SECRET_SYSTEM_ACCESSTOKEN
<REDACTED SECRET NAMES>
##[debug]loaded 54
##[debug]Agent.ProxyUrl=undefined
##[debug]Agent.CAInfo=undefined
##[debug]Agent.ClientCert=undefined
##[debug]Agent.SkipCertValidation=undefined
##[debug]agent.proxyurl=undefined
##[debug]VSTS_ARM_REST_IGNORE_SSL_ERRORS=undefined
##[debug]AZURE_HTTP_USER_AGENT=VSTS_dfca17fd-13fb-4b12-a985-7dc95c242889_build_340_0
##[debug]check path : /azp/_work/_tasks/AzurePowerShell_72a1931b-effb-4d2e-8fd8-f8472a07cb62/5.226.0/node_modules/azure-pipelines-tasks-azure-arm-rest/module.json
##[debug]adding resource file: /azp/_work/_tasks/AzurePowerShell_72a1931b-effb-4d2e-8fd8-f8472a07cb62/5.226.0/node_modules/azure-pipelines-tasks-azure-arm-rest/module.json
##[debug]system.culture=en-US
##[debug]Agent.TempDirectory=/azp/_work/_temp
##[debug]Resource file has already set to: /azp/_work/_tasks/AzurePowerShell_72a1931b-effb-4d2e-8fd8-f8472a07cb62/5.226.0/node_modules/azure-pipelines-tasks-azure-arm-rest/module.json
##[debug]check path : /azp/_work/_tasks/AzurePowerShell_72a1931b-effb-4d2e-8fd8-f8472a07cb62/5.226.0/task.json
##[debug]adding resource file: /azp/_work/_tasks/AzurePowerShell_72a1931b-effb-4d2e-8fd8-f8472a07cb62/5.226.0/task.json
##[debug]system.culture=en-US
##[debug]errorActionPreference=stop
##[debug]ScriptType=inlineScript
##[debug]ScriptPath=/azp/_work/1/s
##[debug]Inline=$ErrorActionPreference = 'Stop'
<SCRIPT REDACTED>
##[debug]ScriptArguments=undefined
##[debug]FailOnStandardError=false
##[debug]TargetAzurePs=latestVersion
##[debug]CustomTargetAzurePs=undefined
##[debug]ConnectedServiceNameARM=676e3058-a671-46a9-b98a-55848e86b847
##[debug]USE_MSAL=true
##[debug]MSAL - USE_MSAL override is found: true
##[debug]676e3058-a671-46a9-b98a-55848e86b847 auth scheme = ServicePrincipal
##[debug]676e3058-a671-46a9-b98a-55848e86b847 data subscriptionid = <REDACTED>
##[debug]676e3058-a671-46a9-b98a-55848e86b847 data subscriptionname = <REDACTED>
##[debug]676e3058-a671-46a9-b98a-55848e86b847 auth param serviceprincipalid = ***
##[debug]676e3058-a671-46a9-b98a-55848e86b847 data activeDirectoryAuthority = https://login.microsoftonline.com/
##[debug]676e3058-a671-46a9-b98a-55848e86b847 auth param tenantid = <REDACTED>
##[debug]676e3058-a671-46a9-b98a-55848e86b847=https://management.azure.com/
##[debug]676e3058-a671-46a9-b98a-55848e86b847 data environment = AzureCloud
##[debug]676e3058-a671-46a9-b98a-55848e86b847 auth scheme = ServicePrincipal
##[debug]676e3058-a671-46a9-b98a-55848e86b847 data msiclientId = undefined
##[debug]676e3058-a671-46a9-b98a-55848e86b847 data activeDirectoryServiceEndpointResourceId = https://management.core.windows.net/
##[debug]676e3058-a671-46a9-b98a-55848e86b847 data AzureKeyVaultServiceEndpointResourceId = https://vault.azure.net
##[debug]676e3058-a671-46a9-b98a-55848e86b847 data AzureKeyVaultDnsSuffix = vault.azure.net
##[debug]676e3058-a671-46a9-b98a-55848e86b847 data ScopeLevel = Subscription
##[debug]MSAL - getEndpoint - useGraphActiveDirectoryResource=false
##[debug]MSAL - getEndpoint - useMSAL=true
##[debug]MSAL - getEndpoint - endpoint={"subscriptionID":"<REDACTED>","subscriptionName":"<REDACTED>","servicePrincipalClientID":"***","environmentAuthorityUrl":"https://login.microsoftonline.com/","tenantID":"<REDACTED>","url":"https://management.azure.com/","environment":"AzureCloud","scheme":"ServicePrincipal","activeDirectoryResourceID":"https://management.core.windows.net/","azureKeyVaultServiceEndpointResourceId":"https://vault.azure.net","azureKeyVaultDnsSuffix":"vault.azure.net","scopeLevel":"Subscription"}
##[debug]MSAL - getEndpoint - connectedServiceName=676e3058-a671-46a9-b98a-55848e86b847
##[debug]676e3058-a671-46a9-b98a-55848e86b847 auth param authenticationType = spnKey
##[debug]credentials spn endpoint
##[debug]676e3058-a671-46a9-b98a-55848e86b847 auth param serviceprincipalkey = ***
##[debug]676e3058-a671-46a9-b98a-55848e86b847 data EnableAdfsAuthentication = false
##[debug]676e3058-a671-46a9-b98a-55848e86b847 auth param apitoken = undefined
##[debug]{"subscriptionID":"<REDACTED>","subscriptionName":"<REDACTED>","servicePrincipalClientID":"***","environmentAuthorityUrl":"https://login.microsoftonline.com/","tenantID":"<REDACTED>","url":"https://management.azure.com/","environment":"AzureCloud","scheme":"ServicePrincipal","activeDirectoryResourceID":"https://management.azure.com/","azureKeyVaultServiceEndpointResourceId":"https://vault.azure.net","azureKeyVaultDnsSuffix":"vault.azure.net","scopeLevel":"Subscription","authenticationType":"spnKey","servicePrincipalKey":***,"isADFSEnabled":false,"applicationTokenCredentials":{"connectedServiceName":"676e3058-a671-46a9-b98a-55848e86b847","clientId":"***","tenantId":"<REDACTED>","baseUrl":"https://management.azure.com/","authorityUrl":"https://login.microsoftonline.com/","activeDirectoryResourceId":"https://management.azure.com/","isAzureStackEnvironment":false,"authType":"spnKey","secret":***,"isADFSEnabled":false,"useMSAL":true,"tokenMutex":{"_semaphore":{"_value":1,"_cancelError":{},"_weightedQueues":***,"_weightedWaiters":***}}}}
##[debug]workingDirectory=/azp/_work/1/s
##[debug]check path : /azp/_work/1/s
Generating script.
##[debug]Agent.Version=3.225.0
##[debug]agent.tempDirectory=/azp/_work/_temp
##[debug]check path : /azp/_work/_temp
##[debug]which 'pwsh'
##[debug]found: '/usr/bin/pwsh'
##[debug]which '/usr/bin/pwsh'
##[debug]found: '/usr/bin/pwsh'
##[debug]/usr/bin/pwsh arg: -NoLogo
##[debug]/usr/bin/pwsh arg: -NoProfile
##[debug]/usr/bin/pwsh arg: -NonInteractive
##[debug]/usr/bin/pwsh arg: -ExecutionPolicy
##[debug]/usr/bin/pwsh arg: Unrestricted
##[debug]/usr/bin/pwsh arg: -Command
##[debug]/usr/bin/pwsh arg: . '/azp/_work/_temp/f4371f61-4d03-4342-bb03-20e91942e2f8.ps1'
##[debug]exec tool: /usr/bin/pwsh
##[debug]arguments:
##[debug]   -NoLogo
##[debug]   -NoProfile
##[debug]   -NonInteractive
##[debug]   -ExecutionPolicy
##[debug]   Unrestricted
##[debug]   -Command
##[debug]   . '/azp/_work/_temp/f4371f61-4d03-4342-bb03-20e91942e2f8.ps1'
[command]/usr/bin/pwsh -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command . '/azp/_work/_temp/f4371f61-4d03-4342-bb03-20e91942e2f8.ps1'
File saved!
[33;1mVERBOSE: Module path not present as expected in hosted agent, skipping step to make module available.
##[debug]Processed: ##vso[telemetry.publish area=TaskHub;feature=AzurePowerShellV5]{"targetAzurePs":"","moduleSource":"privateAgent"}
[33;1mVERBOSE: Latest module folder detected: 
[33;1mVERBOSE: The updated value of the PSModulePath is: /home/agentuser/.local/share/powershell/Modules:/usr/local/share/powershell/Modules:/opt/microsoft/powershell/7/Modules
[33;1mVERBOSE: Populating RepositorySourceLocation property for module Az.Accounts.
##[command]Import-Module -Name /usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Az.Accounts.psd1 -Global
[33;1mVERBOSE: Loading module from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Az.Accounts.psd1'.
[33;1mVERBOSE: Loading 'Assembly' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Microsoft.Azure.PowerShell.AssemblyLoading.dll'.
[33;1mVERBOSE: Loading 'Assembly' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll'.
[33;1mVERBOSE: Loading 'Assembly' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Microsoft.Azure.PowerShell.Authentication.dll'.
[33;1mVERBOSE: Loading 'Assembly' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Microsoft.Azure.PowerShell.Authenticators.dll'.
[33;1mVERBOSE: Loading 'Assembly' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll'.
[33;1mVERBOSE: Loading 'Assembly' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Microsoft.Azure.PowerShell.Clients.Authorization.dll'.
[33;1mVERBOSE: Loading 'Assembly' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Microsoft.Azure.PowerShell.Clients.Compute.dll'.
[33;1mVERBOSE: Loading 'Assembly' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll'.
[33;1mVERBOSE: Loading 'Assembly' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Microsoft.Azure.PowerShell.Clients.Monitor.dll'.
[33;1mVERBOSE: Loading 'Assembly' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Microsoft.Azure.PowerShell.Clients.Network.dll'.
[33;1mVERBOSE: Loading 'Assembly' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll'.
[33;1mVERBOSE: Loading 'Assembly' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll'.
[33;1mVERBOSE: Loading 'Assembly' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Microsoft.Azure.PowerShell.Common.dll'.
[33;1mVERBOSE: Loading 'Assembly' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Microsoft.Azure.PowerShell.Storage.dll'.
[33;1mVERBOSE: Loading 'Assembly' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll'.
[33;1mVERBOSE: Loading 'Assembly' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Microsoft.Azure.PowerShell.Clients.KeyVault.dll'.
[33;1mVERBOSE: Loading 'Assembly' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Microsoft.Azure.PowerShell.Clients.Websites.dll'.
[33;1mVERBOSE: Loading 'Assembly' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Hyak.Common.dll'.
[33;1mVERBOSE: Loading 'Assembly' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Microsoft.ApplicationInsights.dll'.
[33;1mVERBOSE: Loading 'Assembly' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Microsoft.Azure.Common.dll'.
[33;1mVERBOSE: Loading 'Assembly' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Microsoft.Rest.ClientRuntime.dll'.
[33;1mVERBOSE: Loading 'Assembly' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Microsoft.Rest.ClientRuntime.Azure.dll'.
[33;1mVERBOSE: Loading 'Assembly' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Microsoft.WindowsAzure.Storage.dll'.
[33;1mVERBOSE: Loading 'Assembly' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Microsoft.WindowsAzure.Storage.DataMovement.dll'.
[33;1mVERBOSE: Loading 'Assembly' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Microsoft.Azure.PowerShell.Clients.Aks.dll'.
[33;1mVERBOSE: Loading 'Assembly' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Microsoft.Azure.PowerShell.Strategies.dll'.
[33;1mVERBOSE: Loading 'Assembly' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Microsoft.Azure.PowerShell.Common.Share.dll'.
[33;1mVERBOSE: Loading 'Assembly' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/FuzzySharp.dll'.
[33;1mVERBOSE: Loading 'FormatsToProcess' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Accounts.format.ps1xml'.
[33;1mVERBOSE: Loading 'FormatsToProcess' from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Accounts.generated.format.ps1xml'.
[33;1mVERBOSE: Populating RepositorySourceLocation property for module Az.Accounts.
[33;1mVERBOSE: Loading module from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Az.Accounts.psm1'.
[33;1mVERBOSE: Loading module from path '/usr/local/share/powershell/Modules/Az.Accounts/2.12.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll'.
[33;1mVERBOSE: Importing cmdlet 'Register-AzModule'.
[33;1mVERBOSE: Importing cmdlet 'Clear-AzConfig'.
[33;1mVERBOSE: Importing cmdlet 'Export-AzConfig'.
[33;1mVERBOSE: Importing cmdlet 'Get-AzConfig'.
[33;1mVERBOSE: Importing cmdlet 'Import-AzConfig'.
[33;1mVERBOSE: Importing cmdlet 'Update-AzConfig'.
[33;1mVERBOSE: Importing cmdlet 'Connect-AzAccount'.
[33;1mVERBOSE: Importing cmdlet 'Disconnect-AzAccount'.
[33;1mVERBOSE: Importing cmdlet 'Get-AzContext'.
[33;1mVERBOSE: Importing cmdlet 'Import-AzContext'.
[33;1mVERBOSE: Importing cmdlet 'Save-AzContext'.
[33;1mVERBOSE: Importing cmdlet 'Set-AzContext'.
[33;1mVERBOSE: Importing cmdlet 'Disable-AzDataCollection'.
[33;1mVERBOSE: Importing cmdlet 'Enable-AzDataCollection'.
[33;1mVERBOSE: Importing cmdlet 'Add-AzEnvironment'.
[33;1mVERBOSE: Importing cmdlet 'Get-AzEnvironment'.
[33;1mVERBOSE: Importing cmdlet 'Remove-AzEnvironment'.
[33;1mVERBOSE: Importing cmdlet 'Set-AzEnvironment'.
[33;1mVERBOSE: Importing cmdlet 'Send-Feedback'.
[33;1mVERBOSE: Importing cmdlet 'Get-AzSubscription'.
[33;1mVERBOSE: Importing cmdlet 'Get-AzTenant'.
[33;1mVERBOSE: Importing cmdlet 'Get-AzAccessToken'.
[33;1mVERBOSE: Importing cmdlet 'Uninstall-AzureRm'.
[33;1mVERBOSE: Importing cmdlet 'Invoke-AzRestMethod'.
[33;1mVERBOSE: Importing cmdlet 'Open-AzSurveyLink'.
[33;1mVERBOSE: Importing cmdlet 'Resolve-AzError'.
[33;1mVERBOSE: Importing cmdlet 'Clear-AzDefault'.
[33;1mVERBOSE: Importing cmdlet 'Get-AzDefault'.
[33;1mVERBOSE: Importing cmdlet 'Set-AzDefault'.
[33;1mVERBOSE: Importing cmdlet 'Disable-AzureRmAlias'.
[33;1mVERBOSE: Importing cmdlet 'Enable-AzureRmAlias'.
[33;1mVERBOSE: Importing cmdlet 'Disable-AzContextAutosave'.
[33;1mVERBOSE: Importing cmdlet 'Enable-AzContextAutosave'.
[33;1mVERBOSE: Importing cmdlet 'Get-AzContextAutosaveSetting'.
[33;1mVERBOSE: Importing cmdlet 'Clear-AzContext'.
[33;1mVERBOSE: Importing cmdlet 'Remove-AzContext'.
[33;1mVERBOSE: Importing cmdlet 'Rename-AzContext'.
[33;1mVERBOSE: Importing cmdlet 'Select-AzContext'.
[33;1mVERBOSE: Importing alias 'Login-AzAccount'.
[33;1mVERBOSE: Importing alias 'Login-AzureRmAccount'.
[33;1mVERBOSE: Importing alias 'Add-AzAccount'.
[33;1mVERBOSE: Importing alias 'Logout-AzAccount'.
[33;1mVERBOSE: Importing alias 'Logout-AzureRmAccount'.
[33;1mVERBOSE: Importing alias 'Remove-AzAccount'.
[33;1mVERBOSE: Importing alias 'Save-AzProfile'.
[33;1mVERBOSE: Importing alias 'Select-AzSubscription'.
[33;1mVERBOSE: Importing alias 'Get-AzureRmDomain'.
[33;1mVERBOSE: Importing alias 'Get-AzDomain'.
[33;1mVERBOSE: Importing alias 'Invoke-AzRest'.
[33;1mVERBOSE: Importing alias 'Resolve-Error'.
[33;1mVERBOSE: Exporting function 'Test-DotNet'.
[33;1mVERBOSE: Exporting function 'Preload-Assembly'.
[33;1mVERBOSE: Exporting function 'Write-InstallationCheckToFile'.
[33;1mVERBOSE: Exporting cmdlet 'Register-AzModule'.
[33;1mVERBOSE: Exporting cmdlet 'Clear-AzConfig'.
[33;1mVERBOSE: Exporting cmdlet 'Export-AzConfig'.
[33;1mVERBOSE: Exporting cmdlet 'Get-AzConfig'.
[33;1mVERBOSE: Exporting cmdlet 'Import-AzConfig'.
[33;1mVERBOSE: Exporting cmdlet 'Update-AzConfig'.
[33;1mVERBOSE: Exporting cmdlet 'Connect-AzAccount'.
[33;1mVERBOSE: Exporting cmdlet 'Disconnect-AzAccount'.
[33;1mVERBOSE: Exporting cmdlet 'Get-AzContext'.
[33;1mVERBOSE: Exporting cmdlet 'Import-AzContext'.
[33;1mVERBOSE: Exporting cmdlet 'Save-AzContext'.
[33;1mVERBOSE: Exporting cmdlet 'Set-AzContext'.
[33;1mVERBOSE: Exporting cmdlet 'Disable-AzDataCollection'.
[33;1mVERBOSE: Exporting cmdlet 'Enable-AzDataCollection'.
[33;1mVERBOSE: Exporting cmdlet 'Add-AzEnvironment'.
[33;1mVERBOSE: Exporting cmdlet 'Get-AzEnvironment'.
[33;1mVERBOSE: Exporting cmdlet 'Remove-AzEnvironment'.
[33;1mVERBOSE: Exporting cmdlet 'Set-AzEnvironment'.
[33;1mVERBOSE: Exporting cmdlet 'Send-Feedback'.
[33;1mVERBOSE: Exporting cmdlet 'Get-AzSubscription'.
[33;1mVERBOSE: Exporting cmdlet 'Get-AzTenant'.
[33;1mVERBOSE: Exporting cmdlet 'Get-AzAccessToken'.
[33;1mVERBOSE: Exporting cmdlet 'Uninstall-AzureRm'.
[33;1mVERBOSE: Exporting cmdlet 'Invoke-AzRestMethod'.
[33;1mVERBOSE: Exporting cmdlet 'Open-AzSurveyLink'.
[33;1mVERBOSE: Exporting cmdlet 'Resolve-AzError'.
[33;1mVERBOSE: Exporting cmdlet 'Clear-AzDefault'.
[33;1mVERBOSE: Exporting cmdlet 'Get-AzDefault'.
[33;1mVERBOSE: Exporting cmdlet 'Set-AzDefault'.
[33;1mVERBOSE: Exporting cmdlet 'Disable-AzureRmAlias'.
[33;1mVERBOSE: Exporting cmdlet 'Enable-AzureRmAlias'.
[33;1mVERBOSE: Exporting cmdlet 'Disable-AzContextAutosave'.
[33;1mVERBOSE: Exporting cmdlet 'Enable-AzContextAutosave'.
[33;1mVERBOSE: Exporting cmdlet 'Get-AzContextAutosaveSetting'.
[33;1mVERBOSE: Exporting cmdlet 'Clear-AzContext'.
[33;1mVERBOSE: Exporting cmdlet 'Remove-AzContext'.
[33;1mVERBOSE: Exporting cmdlet 'Rename-AzContext'.
[33;1mVERBOSE: Exporting cmdlet 'Select-AzContext'.
[33;1mVERBOSE: Exporting alias 'Login-AzAccount'.
[33;1mVERBOSE: Exporting alias 'Login-AzureRmAccount'.
[33;1mVERBOSE: Exporting alias 'Add-AzAccount'.
[33;1mVERBOSE: Exporting alias 'Logout-AzAccount'.
[33;1mVERBOSE: Exporting alias 'Logout-AzureRmAccount'.
[33;1mVERBOSE: Exporting alias 'Remove-AzAccount'.
[33;1mVERBOSE: Exporting alias 'Save-AzProfile'.
[33;1mVERBOSE: Exporting alias 'Select-AzSubscription'.
[33;1mVERBOSE: Exporting alias 'Get-AzureRmDomain'.
[33;1mVERBOSE: Exporting alias 'Get-AzDomain'.
[33;1mVERBOSE: Exporting alias 'Invoke-AzRest'.
[33;1mVERBOSE: Exporting alias 'Resolve-Error'.
[33;1mVERBOSE: Importing cmdlet 'Add-AzEnvironment'.
[33;1mVERBOSE: Importing cmdlet 'Clear-AzConfig'.
[33;1mVERBOSE: Importing cmdlet 'Clear-AzContext'.
[33;1mVERBOSE: Importing cmdlet 'Clear-AzDefault'.
[33;1mVERBOSE: Importing cmdlet 'Connect-AzAccount'.
[33;1mVERBOSE: Importing cmdlet 'Disable-AzContextAutosave'.
[33;1mVERBOSE: Importing cmdlet 'Disable-AzDataCollection'.
[33;1mVERBOSE: Importing cmdlet 'Disable-AzureRmAlias'.
[33;1mVERBOSE: Importing cmdlet 'Disconnect-AzAccount'.
[33;1mVERBOSE: Importing cmdlet 'Enable-AzContextAutosave'.
[33;1mVERBOSE: Importing cmdlet 'Enable-AzDataCollection'.
[33;1mVERBOSE: Importing cmdlet 'Enable-AzureRmAlias'.
[33;1mVERBOSE: Importing cmdlet 'Export-AzConfig'.
[33;1mVERBOSE: Importing cmdlet 'Get-AzAccessToken'.
[33;1mVERBOSE: Importing cmdlet 'Get-AzConfig'.
[33;1mVERBOSE: Importing cmdlet 'Get-AzContext'.
[33;1mVERBOSE: Importing cmdlet 'Get-AzContextAutosaveSetting'.
[33;1mVERBOSE: Importing cmdlet 'Get-AzDefault'.
[33;1mVERBOSE: Importing cmdlet 'Get-AzEnvironment'.
[33;1mVERBOSE: Importing cmdlet 'Get-AzSubscription'.
[33;1mVERBOSE: Importing cmdlet 'Get-AzTenant'.
[33;1mVERBOSE: Importing cmdlet 'Import-AzConfig'.
[33;1mVERBOSE: Importing cmdlet 'Import-AzContext'.
[33;1mVERBOSE: Importing cmdlet 'Invoke-AzRestMethod'.
[33;1mVERBOSE: Importing cmdlet 'Open-AzSurveyLink'.
[33;1mVERBOSE: Importing cmdlet 'Register-AzModule'.
[33;1mVERBOSE: Importing cmdlet 'Remove-AzContext'.
[33;1mVERBOSE: Importing cmdlet 'Remove-AzEnvironment'.
[33;1mVERBOSE: Importing cmdlet 'Rename-AzContext'.
[33;1mVERBOSE: Importing cmdlet 'Resolve-AzError'.
[33;1mVERBOSE: Importing cmdlet 'Save-AzContext'.
[33;1mVERBOSE: Importing cmdlet 'Select-AzContext'.
[33;1mVERBOSE: Importing cmdlet 'Send-Feedback'.
[33;1mVERBOSE: Importing cmdlet 'Set-AzContext'.
[33;1mVERBOSE: Importing cmdlet 'Set-AzDefault'.
[33;1mVERBOSE: Importing cmdlet 'Set-AzEnvironment'.
[33;1mVERBOSE: Importing cmdlet 'Uninstall-AzureRm'.
[33;1mVERBOSE: Importing cmdlet 'Update-AzConfig'.
[33;1mVERBOSE: Importing alias 'Add-AzAccount'.
[33;1mVERBOSE: Importing alias 'Get-AzDomain'.
[33;1mVERBOSE: Importing alias 'Invoke-AzRest'.
[33;1mVERBOSE: Importing alias 'Login-AzAccount'.
[33;1mVERBOSE: Importing alias 'Logout-AzAccount'.
[33;1mVERBOSE: Importing alias 'Remove-AzAccount'.
[33;1mVERBOSE: Importing alias 'Resolve-Error'.
[33;1mVERBOSE: Importing alias 'Save-AzProfile'.
[33;1mVERBOSE: Importing alias 'Select-AzSubscription'.
##[command]Clear-AzContext -Scope Process
[33;1mVERBOSE: Populating RepositorySourceLocation property for module Az.
##[command]Clear-AzContext -Scope CurrentUser -Force -ErrorAction SilentlyContinue
[33;1mVERBOSE: Using ServicePrincipal authentication scheme
##[command]Connect-AzAccount -ServicePrincipal -Tenant <REDACTED> -Credential System.Management.Automation.PSCredential -Environment AzureCloud @processScope
Exception is : The operation was canceled.
[31;1mOperationStopped: /azp/_work/_tasks/AzurePowerShell_72a1931b-effb-4d2e-8fd8-f8472a07cb62/5.226.0/InitializeAz.ps1:93
[31;1mLine |
[31;1m  93 |          throw (New-Object System.Exception("There was an error with t …
[31;1m     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[31;1m     | There was an error with the service principal used for the deployment.
##[debug]Exit code 1 received from tool '/usr/bin/pwsh'
##[debug]STDIO streams have closed for tool '/usr/bin/pwsh'
##[debug]task result: Failed
##[error]PowerShell exited with code '1'.
##[debug]Processed: ##vso[task.issue type=error;]PowerShell exited with code '1'.
##[debug]Processed: ##vso[task.complete result=Failed;]PowerShell exited with code '1'.
##[section]Finishing: <REDACTED>

Relevant log output

image

Additional info

The AzurePowerShell@5 fails nondeterministically on the Connect-AzAccount part with the following errors: There was an error with the service principal used for the deployment/The operation was canceled. The task does not start executing the inline script. Just retry (without changing anything) usually helps. It always hangs for around 2 minutes 8 seconds before the error is printed out. The task runs on a self hosted agent based on Azure Container jobs. Agent is behind a firewall and at the similar time the firewall is blocking outgoing requests to raw.githubusercontent.com from the agent subnet. Current agent version: '3.225.0' PowerShell: 7.3.6

Usage:

  - task: AzurePowerShell@5
    displayName: "<REDACTED>"
    inputs:
      pwsh: true
      ConnectedServiceNameARM: <REDACTED>
      TargetAzurePs: "latestVersion"
      scriptType: "inlineScript"
      inline: <REDACTED>

Output of Get-Module (on the agent)

PS /azp> Get-Module -ListAvailable

    Directory: /usr/local/share/powershell/Modules

ModuleType Version    PreRelease Name                                PSEdition
---------- -------    ---------- ----                                ---------
Script     10.2.0                Az                                  Core,Desk
Script     2.12.5                Az.Accounts                         Core,Desk
Script     2.0.0                 Az.Advisor                          Core,Desk
Script     5.5.1                 Az.Aks                              Core,Desk
Script     1.1.4                 Az.AnalysisServices                 Core,Desk
Script     4.0.2                 Az.ApiManagement                    Core,Desk
Script     1.3.0                 Az.AppConfiguration                 Core,Desk
Script     2.2.2                 Az.ApplicationInsights              Core,Desk
Script     2.0.0                 Az.Attestation                      Core,Desk
Script     1.0.0                 Az.Automanage                       Core,Desk
Script     1.9.1                 Az.Automation                       Core,Desk
Script     3.5.0                 Az.Batch                            Core,Desk
Script     2.0.3                 Az.Billing                          Core,Desk
Script     3.1.0                 Az.Cdn                              Core,Desk
Script     1.2.0                 Az.CloudService                     Core,Desk
Script     1.14.0                Az.CognitiveServices                Core,Desk
Script     6.2.0                 Az.Compute                          Core,Desk
Script     1.0.0                 Az.ConfidentialLedger               Core,Desk
Script     3.2.0                 Az.ContainerInstance                Core,Desk
Script     4.1.0                 Az.ContainerRegistry                Core,Desk
Script     1.11.2                Az.CosmosDB                         Core,Desk
Script     1.1.0                 Az.DataBoxEdge                      Core,Desk
Script     1.7.0                 Az.Databricks                       Core,Desk
Script     1.17.0                Az.DataFactory                      Core,Desk
Script     1.0.2                 Az.DataLakeAnalytics                Core,Desk
Script     1.3.0                 Az.DataLakeStore                    Core,Desk
Script     2.0.0                 Az.DataProtection                   Core,Desk
Script     1.0.1                 Az.DataShare                        Core,Desk
Script     1.1.0                 Az.DeploymentManager                Core,Desk
Script     4.0.0                 Az.DesktopVirtualization            Core,Desk
Script     1.0.2                 Az.DevTestLabs                      Core,Desk
Script     1.1.3                 Az.Dns                              Core,Desk
Script     1.6.0                 Az.EventGrid                        Core,Desk
Script     4.0.0                 Az.EventHub                         Core,Desk
Script     1.10.0                Az.FrontDoor                        Core,Desk
Script     4.0.6                 Az.Functions                        Core,Desk
Script     6.0.0                 Az.HDInsight                        Core,Desk
Script     2.0.0                 Az.HealthcareApis                   Core,Desk
Script     2.7.5                 Az.IotHub                           Core,Desk
Script     4.10.1                Az.KeyVault                         Core,Desk
Script     2.2.0                 Az.Kusto                            Core,Desk
Script     1.0.0                 Az.LoadTesting                      Core,Desk
Script     1.5.0                 Az.LogicApp                         Core,Desk
Script     1.1.3                 Az.MachineLearning                  Core,Desk
Script     1.0.0                 Az.MachineLearningServices          Core,Desk
Script     1.3.0                 Az.Maintenance                      Core,Desk
Script     1.1.1                 Az.ManagedServiceIdentity           Core,Desk
Script     3.0.0                 Az.ManagedServices                  Core,Desk
Script     2.0.0                 Az.MarketplaceOrdering              Core,Desk
Script     1.1.1                 Az.Media                            Core,Desk
Script     2.2.0                 Az.Migrate                          Core,Desk
Script     4.5.0                 Az.Monitor                          Core,Desk
Script     1.1.1                 Az.MySql                            Core,Desk
Script     6.1.1                 Az.Network                          Core,Desk
Script     1.1.1                 Az.NotificationHubs                 Core,Desk
Script     3.2.0                 Az.OperationalInsights              Core,Desk
Script     1.6.2                 Az.PolicyInsights                   Core,Desk
Script     1.1.0                 Az.PostgreSql                       Core,Desk
Script     1.2.1                 Az.PowerBIEmbedded                  Core,Desk
Script     1.0.4                 Az.PrivateDns                       Core,Desk
Script     6.5.0                 Az.RecoveryServices                 Core,Desk
Script     1.8.0                 Az.RedisCache                       Core,Desk
Script     1.2.0                 Az.RedisEnterpriseCache             Core,Desk
Script     2.0.0                 Az.Relay                            Core,Desk
Script     1.1.0                 Az.ResourceMover                    Core,Desk
Script     6.9.0                 Az.Resources                        Core,Desk
Script     1.4.0                 Az.Security                         Core,Desk
Script     3.0.1                 Az.SecurityInsights                 Core,Desk
Script     3.0.0                 Az.ServiceBus                       Core,Desk
Script     3.2.0                 Az.ServiceFabric                    Core,Desk
Script     2.0.0                 Az.SignalR                          Core,Desk
Script     4.9.0                 Az.Sql                              Core,Desk
Script     2.0.0                 Az.SqlVirtualMachine                Core,Desk
Script     2.1.0                 Az.StackHCI                         Core,Desk
Script     5.9.0                 Az.Storage                          Core,Desk
Script     1.0.1                 Az.StorageMover                     Core,Desk
Script     2.0.0                 Az.StorageSync                      Core,Desk
Script     2.0.0                 Az.StreamAnalytics                  Core,Desk
Script     1.0.0                 Az.Support                          Core,Desk
Script     3.0.2                 Az.Synapse                          Core,Desk
Script     1.2.1                 Az.TrafficManager                   Core,Desk
Script     3.1.0                 Az.Websites                         Core,Desk
Manifest   2.3.0                 Microsoft.Graph                     Core,Desk
Script     2.3.0                 Microsoft.Graph.Applications        Core,Desk
Script     2.3.0                 Microsoft.Graph.Authentication      Core,Desk
Script     2.3.0                 Microsoft.Graph.Bookings            Core,Desk
Script     2.3.0                 Microsoft.Graph.Calendar            Core,Desk
Script     2.3.0                 Microsoft.Graph.ChangeNotifications Core,Desk
Script     2.3.0                 Microsoft.Graph.CloudCommunications Core,Desk
Script     2.3.0                 Microsoft.Graph.Compliance          Core,Desk
Script     2.3.0                 Microsoft.Graph.CrossDeviceExperie… Core,Desk
Script     2.3.0                 Microsoft.Graph.DeviceManagement    Core,Desk
Script     2.3.0                 Microsoft.Graph.DeviceManagement.A… Core,Desk
Script     2.3.0                 Microsoft.Graph.DeviceManagement.A… Core,Desk
Script     2.3.0                 Microsoft.Graph.DeviceManagement.E… Core,Desk
Script     2.3.0                 Microsoft.Graph.DeviceManagement.F… Core,Desk
Script     2.3.0                 Microsoft.Graph.Devices.CloudPrint  Core,Desk
Script     2.3.0                 Microsoft.Graph.Devices.CorporateM… Core,Desk
Script     2.3.0                 Microsoft.Graph.Devices.ServiceAnn… Core,Desk
Script     2.3.0                 Microsoft.Graph.DirectoryObjects    Core,Desk
Script     2.3.0                 Microsoft.Graph.Education           Core,Desk
Script     2.3.0                 Microsoft.Graph.Files               Core,Desk
Script     2.3.0                 Microsoft.Graph.Groups              Core,Desk
Script     2.3.0                 Microsoft.Graph.Identity.Directory… Core,Desk
Script     2.3.0                 Microsoft.Graph.Identity.Governance Core,Desk
Script     2.3.0                 Microsoft.Graph.Identity.Partner    Core,Desk
Script     2.3.0                 Microsoft.Graph.Identity.SignIns    Core,Desk
Script     2.3.0                 Microsoft.Graph.Mail                Core,Desk
Script     2.3.0                 Microsoft.Graph.Notes               Core,Desk
Script     2.3.0                 Microsoft.Graph.People              Core,Desk
Script     2.3.0                 Microsoft.Graph.PersonalContacts    Core,Desk
Script     2.3.0                 Microsoft.Graph.Planner             Core,Desk
Script     2.3.0                 Microsoft.Graph.Reports             Core,Desk
Script     2.3.0                 Microsoft.Graph.SchemaExtensions    Core,Desk
Script     2.3.0                 Microsoft.Graph.Search              Core,Desk
Script     2.3.0                 Microsoft.Graph.Security            Core,Desk
Script     2.3.0                 Microsoft.Graph.Sites               Core,Desk
Script     2.3.0                 Microsoft.Graph.Teams               Core,Desk
Script     2.3.0                 Microsoft.Graph.Users               Core,Desk
Script     2.3.0                 Microsoft.Graph.Users.Actions       Core,Desk
Script     2.3.0                 Microsoft.Graph.Users.Functions     Core,Desk
Script     0.4.7                 powershell-yaml                     Desk     
Script     22.1.1                SqlServer                           Core,Desk

    Directory: /opt/microsoft/powershell/7/Modules

ModuleType Version    PreRelease Name                                PSEdition
---------- -------    ---------- ----                                ---------
Manifest   1.2.5                 Microsoft.PowerShell.Archive        Desk     
Manifest   7.0.0.0               Microsoft.PowerShell.Host           Core     
Manifest   7.0.0.0               Microsoft.PowerShell.Management     Core     
Manifest   7.0.0.0               Microsoft.PowerShell.Security       Core     
Manifest   7.0.0.0               Microsoft.PowerShell.Utility        Core     
Script     1.4.8.1               PackageManagement                   Desk     
Script     2.2.5                 PowerShellGet                       Desk     
Script     2.2.6                 PSReadLine                          Desk     
Binary     2.0.3                 ThreadJob                           Desk
github-actions[bot] commented 6 months ago

This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days