1

I'm using AzureFileCopy task in Azure DevOps for copying a file to a blob storage. However, during execution, the task fails, and the logged error is about AzureRM module not being present.

`Starting: Copying file to blob storage

Task : Azure file copy Description : Copy files to Azure Blob Storage or virtual machines Version : 4.210.3 Author : Microsoft Corporation Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-file-copy

##[error]Could not find the modules: 'AzureRM' with Version: 'Any version'. If the module was recently installed, retry after restarting the Azure Pipelines task agent. Finishing: Copying file to blob storage`

I tried to create a PowerShell task which was supposed to install this module, but couldn't make it to work.

Any suggestions?

Thanks.

phanxen
  • 21
  • 5
  • Hi @phanxen. Could you hint how was your setup with Agent Pool. I'm using Azure virtual machine. 3 days still stuck. https://stackoverflow.com/questions/75285303/azurefilecop5-error-the-term-get-azresource-is-not-recognized-yaml – khmub Jan 31 '23 at 13:19

1 Answers1

0

You could use PowerShell script Uninstall-AzureRm to remove all AzureRm modules from the machine, refer to this official doc: https://learn.microsoft.com/en-us/powershell/module/az.accounts/uninstall-azurerm?view=azps-9.1.0#examples

From my test, I am failing with Azure File Copy task version 5.*

enter image description here

The same configuration succeeds with Azure File Copy task version 2.*

enter image description here

Kim Xu-MSFT
  • 1,819
  • 1
  • 2
  • 4
  • Why would Uninstall-AzureRM help, given that the error message is complaining precisely about the fact that AzureRM *is not* installed? – David Jul 06 '23 at 18:46