Closed abhinab22mohanty closed 2 weeks ago
Hi @abhinab22mohanty Thanks for reporting the issue. Could you please share the complete pipeline logs by adding variable system.debug to "true"?
ErrorLogs.txt Sure uploaded the Error log form the pipeline run : https://dev.azure.com/dynamicscrm/OneCRM/_build/results?buildId=15035728&view=logs&s=d4a9a205-d52e-57fb-7b17-15a9d984af62
Hi, is there any update on this? we’ve been facing some problems with many tasks of this repository over the past 5-6 weeks. There has been a noticeable and concerning increase in tasks breaking (recently azure power shell, web app, file copy etc), which is heavily impacting our org operations. I’m sure we’re not the only team dealing with these frustrations.
The lack of adequate testing, proactive monitoring, and early resolution of these issues is glaring. It’s become incredibly frustrating for myself and many of my team members. We used to report issues and raise PRs in this repo, and they were acknowledged and resolved within a few hours. Lately, however, the proactive responses from the support team have disappeared.
It’s not good that for each issue, we now have to spend time reaching out to the dev community, Stack Overflow, and Microsoft support. This is consuming valuable time and severely impacting our operations. The long waits for resolution are causing significant disruptions.
I’ve noticed contributors like @v-schhabra @v-snalawade @manolerazvan @garun-kumar and few more have approved many PRs related to these tasks. the monitoring of this repo needs to be stepped up significantly, with proactive measures taken to reduce future outages. It’s difficult to continue to operate with such instability. Please do check action to rectify these issues and restore the level of support we previously experienced.
Hi, is there any update on this? we’ve been facing some problems with many tasks of this repository over the past 5-6 weeks. There has been a noticeable and concerning increase in tasks breaking (recently azure power shell, web app, file copy etc), which is heavily impacting our org operations. I’m sure we’re not the only team dealing with these frustrations.
The lack of adequate testing, proactive monitoring, and early resolution of these issues is glaring. It’s become incredibly frustrating for myself and many of my team members. We used to report issues and raise PRs in this repo, and they were acknowledged and resolved within a few hours. Lately, however, the proactive responses from the support team have disappeared.
It’s not good that for each issue, we now have to spend time reaching out to the dev community, Stack Overflow, and Microsoft support. This is consuming valuable time and severely impacting our operations. The long waits for resolution are causing significant disruptions.
I’ve noticed contributors like @v-schhabra @v-snalawade @manolerazvan @garun-kumar and few more have approved many PRs related to these tasks. the monitoring of this repo needs to be stepped up significantly, with proactive measures taken to reduce future outages. It’s difficult to continue to operate with such instability. Please do check action to rectify these issues and restore the level of support we previously experienced.
can you share the details of task and issue you are facing. we will check on it
Facing a similar issue in our pipeline as well:
##[error]The term 'New-AzStorageContext' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
##[debug]Processed: ##vso[task.logissue type=error;source=TaskInternal;correlationId=df587367-2f6e-4ad8-a965-cdfb4b14fc7e]The term 'New-AzStorageContext' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
##[debug]Processed: ##vso[task.complete result=Failed]
Task has been setup this way:
- task: AzureFileCopy@6
displayName: 'Copy site content to Azure Storage'
condition: and(succeeded(), eq(variables['AccessibilityTestingOnly'], 'false'))
inputs:
SourcePath: packages/doc-site/build/*
ConnectedServiceNameARM: ***************
Destination: AzureBlob
StorageAccountRM: ******************
ContainerName: $web
BlobPrefix: azure-devops
Based on this error message: Could not find the module Az.Accounts with given version. If the module was recently installed, retry after restarting the Azure Pipelines task agent.
, I also tried installing Az.Accounts module separately:
- task: PowerShell@2
displayName: 'Install Az Module'
inputs:
targetType: 'inline'
script: 'Install-Module -Name Az.Accounts -Scope AllUsers -AllowClobber -Force'
But then ended up getting the above error
Hello we are facing a similar issue with our pipeline as well.
For this pipeline: https://msazure.visualstudio.com/One/_build/results?buildId=98883452&view=logs&j=15dfcb1a-0989-5cf6-3160-3e181e44de87&t=7f38a826-dcdc-5dce-32e2-bd5be705b052
We are getting this error:
##[error]Could not find the module Az.Accounts with given version. If the module was recently installed, retry after restarting the Azure Pipelines task agent.
And this is the pipeline task:
- task: AzureFileCopy@6
inputs:
SourcePath: '$(Build.SourcesDirectory)/crc-portal' # Path to the directory you want to upload
azureSubscription: '$(serviceConnection)' # Your service connection name
Destination: 'AzureBlob'
storage: '$(storageAccount)' # Your storage account name
ContainerName: '$(containerName)' # The name of your blob storage container
BlobPrefix: 'filedump' # Prefix to maintain the directory structure in blob
sasTokenTimeOutInMinutes: 240
Here is a more detailed error with system.debug set to true:
##[debug]Importing function 'Remove-EndpointSecrets'.
##[debug]Importing function 'Update-PSModulePathForHostedAgentWithLatestModule'.
##[debug]ENDPOINT_URL_a1533ba0-334b-46a7-af00-bdb271607052: 'https://management.azure.com/'
##[debug]ENDPOINT_AUTH_a1533ba0-334b-46a7-af00-bdb271607052: '********'
##[debug]ENDPOINT_DATA_a1533ba0-334b-46a7-af00-bdb271607052: '{"environment":"AzureCloud","scopeLevel":"Subscription","subscriptionId":"88e54977-85c2-43c8-908a-34caf6c7b8a4","subscriptionName":"Azure-CRC-Bare-Metal","resourceGroupName":"","mlWorkspaceName":"","mlWorkspaceLocation":"","managementGroupId":"","managementGroupName":"","oboAuthorization":"","creationMode":"Automatic","azureSpnRoleAssignmentId":"51dc1884-6fb9-43bf-b75c-934cdaa5a523","azureSpnPermissions":"[{\"roleAssignmentId\":\"51dc1884-6fb9-43bf-b75c-934cdaa5a523\",\"resourceProvider\":\"Microsoft.RoleAssignment\",\"provisioned\":true}]","spnObjectId":"d6d8d64c-76b4-4e19-bec0-e44dbf25d0de","appObjectId":"23e13e3a-f6d8-49f6-9cc5-a7ea127d6003","resourceId":"","revertSchemeDeadline":"revertSchemeDeadlineExpired","environmentUrl":"[https://management.azure.com/","galleryUrl":"https://gallery.azure.com/","serviceManagementUrl":"https://management.core.windows.net/","resourceManagerUrl":"https://management.azure.com/","activeDirectoryAuthority":"https://login.microsoftonline.com/","environmentAuthorityUrl":"https://login.windows.net/","microsoftGraphUrl":"https://graph.microsoft.com/","managementPortalUrl":"https://manage.windowsazure.com/","armManagementPortalUrl":"https://portal.azure.com/","activeDirectoryServiceEndpointResourceId":"https://management.core.windows.net/","sqlDatabaseDnsSuffix":".database.windows.net","AzureKeyVaultDnsSuffix":"vault.azure.net","AzureKeyVaultServiceEndpointResourceId":"https://vault.azure.net","StorageEndpointSuffix":"core.windows.net","EnableAdfsAuthentication":"false"}'](https://management.azure.com/%22,%22galleryUrl%22:%22https://gallery.azure.com/%22,%22serviceManagementUrl%22:%22https://management.core.windows.net/%22,%22resourceManagerUrl%22:%22https://management.azure.com/%22,%22activeDirectoryAuthority%22:%22https://login.microsoftonline.com/%22,%22environmentAuthorityUrl%22:%22https://login.windows.net/%22,%22microsoftGraphUrl%22:%22https://graph.microsoft.com/%22,%22managementPortalUrl%22:%22https://manage.windowsazure.com/%22,%22armManagementPortalUrl%22:%22https://portal.azure.com/%22,%22activeDirectoryServiceEndpointResourceId%22:%22https://management.core.windows.net/%22,%22sqlDatabaseDnsSuffix%22:%22.database.windows.net%22,%22AzureKeyVaultDnsSuffix%22:%22vault.azure.net%22,%22AzureKeyVaultServiceEndpointResourceId%22:%22https://vault.azure.net%22,%22StorageEndpointSuffix%22:%22core.windows.net%22,%22EnableAdfsAuthentication%22:%22false%22%7D')
##[debug]C:\Modules\azurerm_2.1.0 is not present in C:\Users\ContainerAdministrator\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager;C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement;C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\Storage;C:\Program Files\Microsoft Monitoring Agent\Agent\PowerShell;C:\Program Files\Azure Cosmos DB Emulator\PSModules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager;C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement;C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\Storage;C:\Program Files\Microsoft Monitoring Agent\Agent\PowerShell;C:\Program Files\Azure Cosmos DB Emulator\PSModules;
##[debug]C:\\Modules\azurerm_2.1.0 is not present in C:\Users\ContainerAdministrator\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager;C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement;C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\Storage;C:\Program Files\Microsoft Monitoring Agent\Agent\PowerShell;C:\Program Files\Azure Cosmos DB Emulator\PSModules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager;C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement;C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\Storage;C:\Program Files\Microsoft Monitoring Agent\Agent\PowerShell;C:\Program Files\Azure Cosmos DB Emulator\PSModules;
##[debug]C:\Modules\azure_2.1.0 is not present in C:\Users\ContainerAdministrator\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager;C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement;C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\Storage;C:\Program Files\Microsoft Monitoring Agent\Agent\PowerShell;C:\Program Files\Azure Cosmos DB Emulator\PSModules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager;C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement;C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\Storage;C:\Program Files\Microsoft Monitoring Agent\Agent\PowerShell;C:\Program Files\Azure Cosmos DB Emulator\PSModules;
##[debug]C:\\Modules\azure_2.1.0 is not present in C:\Users\ContainerAdministrator\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager;C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement;C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\Storage;C:\Program Files\Microsoft Monitoring Agent\Agent\PowerShell;C:\Program Files\Azure Cosmos DB Emulator\PSModules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager;C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement;C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\Storage;C:\Program Files\Microsoft Monitoring Agent\Agent\PowerShell;C:\Program Files\Azure Cosmos DB Emulator\PSModules;
##[debug]ENDPOINT_URL_SystemVssConnection: 'https://msazure.visualstudio.com/'
##[debug]ENDPOINT_AUTH_SystemVssConnection: '********'
##[debug]ENDPOINT_DATA_SystemVssConnection (empty)
##[debug]No module found with name: Az.Accounts
##[debug]Caught exception from task script.
##[debug]Error record:
##[debug]Could not find the module Az.Accounts with given version. If the module was recently installed, retry after restarting the Azure Pipelines task agent.
##[debug]At C:\__w\_tasks\AzureFileCopy_eb72cb01-a7e5-427b-a8a1-1b31ccac8a43\6.242.10\AzureFileCopy.ps1:70 char:5
##[debug]+ throw ("Could not find the module Az.Accounts with given version. ...
##[debug]+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##[debug] + CategoryInfo : OperationStopped: (Could not find ...nes task ag ent.:String) [], RuntimeException
##[debug] + FullyQualifiedErrorId : Could not find the module Az.Accounts with given version. If the module was recently installed, retry after restarting the Azure Pipelines task agent.
##[debug]
##[debug]Script stack trace:
##[debug]at <ScriptBlock>, C:\__w\_tasks\AzureFileCopy_eb72cb01-a7e5-427b-a8a1-1b31ccac8a43\6.242.10\AzureFileCopy.ps1: line 70
##[debug]at <ScriptBlock>, <No file>: line 1
##[debug]at <ScriptBlock>, <No file>: line 22
##[debug]at <ScriptBlock>, <No file>: line 18
##[debug]at <ScriptBlock>, <No file>: line 1
##[debug]Exception:
##[debug]System.Management.Automation.RuntimeException: Could not find the module Az.Accounts with given version. If the module was recently installed, retry after restarting the Azure Pipelines task agent.
##[error]Could not find the module Az.Accounts with given version. If the module was recently installed, retry after restarting the Azure Pipelines task agent.
##[debug]Processed: ##vso[task.logissue type=error;source=TaskInternal;correlationId=f42d0b5c-f415-4c2e-814b-ae06391dec82]Could not find the module Az.Accounts with given version. If the module was recently installed, retry after restarting the Azure Pipelines task agent.
##[debug]Processed: ##vso[task.complete result=Failed]
##[debug]Handler exit code: 0
Hi @Saransh-K Could you please install Az module in your agent machine and let us know if still you are encountering the same issue?
Can you help me with this?
I tried adding this task to my YAML:
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
Install-Module -Name Az -Force
Install-Module -Name Az.Accounts -Force
But I got this error:
Install-NuGetClientBinaries : Exception calling "ShouldContinue" with "2"
argument(s): "Windows PowerShell is in NonInteractive mode. Read and Prompt
functionality is not available."
At C:\Program
Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1762 char:9
+ Install-NuGetClientBinaries -CallerPSCmdlet $PSCmdlet -Proxy ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-NuGetClientBinaries],
MethodInvocationException
+ FullyQualifiedErrorId : PSInvalidOperationException,Install-NuGetClientB
inaries
I also tried adding -AllowClobber -Scope CurrentUser
to the Install-Module
but that didn't seem to fix it.
Hi @Saransh-K As discussed offline please install Nuget packages on the agent machine if you are using 1ES agents?
My pipeline is running on the default 1ES OneBranch pool. With this container image: onebranch.azurecr.io/windows/ltsc2019/vse2022:latest
As per offline discussion I added this powershell task before the AzureFileCopy
and it fixed it.
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
Write-Output (Get-PackageProvider -ListAvailable)
Install-PackageProvider Nuget -ForceBootstrap -Force
Install-Module -Name Az -RequiredVersion 10.0.0 -Force -AllowClobber -Scope CurrentUser
ErrorLogs.txt Sure uploaded the Error log form the pipeline run : https://dev.azure.com/dynamicscrm/OneCRM/_build/results?buildId=15035728&view=logs&s=d4a9a205-d52e-57fb-7b17-15a9d984af62
From the logs it seems modules were not imported New-AzStorageContext is part of Az.Storage module.
Can you please check if modules are installed correctly
you can run below command in powershell on machine where agent is hosted. Get-Module -Name Az.* -ListAvailable
See if Az.storage is available if not then please install the modules and try to run the pipeline.
ErrorLogs.txt Sure uploaded the Error log form the pipeline run : https://dev.azure.com/dynamicscrm/OneCRM/_build/results?buildId=15035728&view=logs&s=d4a9a205-d52e-57fb-7b17-15a9d984af62
did you tried installing Az.Storage module
From the logs it seems modules were not imported New-AzStorageContext is part of Az.Storage module.
Can you please check if modules are installed correctly
you can run below command in powershell on machine where agent is hosted. Get-Module -Name Az.* -ListAvailable
See if Az.storage is available if not then please install the modules and try to run the pipeline.
New issue checklist
Task name
AzureFileCopy
Task version
6.242.6
Issue Description
We recently upgraded the Azure DevOps (ADO) service connection from using an Azure Resource Manager service principal (automatic) to Azure Resource Manager using Workload Identity federation with OpenID Connect (automatic). There were couple successful runs but recently started getting error "The term 'New-AzStorageContext' is not recognized as the name of a cmdlet"
Environment type (Please select at least one enviroment where you face this issue)
Azure DevOps Server type
Azure DevOps Server (Please specify exact version in the textbox below)
Azure DevOps Server Version (if applicable)
No response
Operation system
Windows 11
Relevant log output
Full task logs with system.debug enabled
Repro steps