Azcopy is not support in runbook

Himanshuk 161 Reputation points
2024-04-26T16:16:35.2933333+00:00

Azcopy exe I am trying to install inside in runbook but it's not detected and I don't want hybrid worker because I have to maintain it, is there any way to convert exe onto powershell module so that I can convert azcopy exe into module and add that module as zip at runtime in runbook environment and use it else how to copy sync bulk data between cross regions between azcopy fileshare

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,128 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AnuragSingh-MSFT 20,106 Reputation points
    2024-04-29T06:50:11.01+00:00

    @Himanshuk, thank you for reaching out to Microsoft Q&A for this issue.

    There are multiple ways you can perform copy data in Azure Storage. One of the options you have already mentioned is using AzCopy cmdline tool. As you mentioned correctly, one of the options is to create custom PowerShell module --> package AzCopy executable --> write PowerShell functions to map the input and outputs for the AzCopy tool. For an overview of how to write custom PowerShell module, see Creating a PowerShell Module and Writing a Windows PowerShell Module.

    While this is doable (I have not tested it though), it will require considerable efforts to develop and maintain the modules. Also note that the AzCopy itself undergoes updates and you will have to keep track of that to ensure that the custom PowerShell module is using the supported versions of AzCopy.


    Instead, I would suggest using the Az PowerShell modules below to achieve your goal -

    Az.StorageSync

    Az.Storage

    The cmdlet available in these modules should help you achieve most of your requirements without investing much time in developing and maintaining custom module.


    In case the exact features that you are looking for is not available in the cmdlets of the module mentioned earlier, you could also use the Storage REST API to achieve the end goal. Note that AzCopy or the PowerShell module - they all use REST API to perform the operations in the backend. You could get the exact API being used and use it in the Automation Runbook. For details about getting the API call details, see Protocol used by the Azure Storage explorer to connect to Azure storage In this case, you use Fiddler to capture web requests when running the AzCopy cmd.

    Hope this helps.

    If the answer did not help, please add more context/follow-up question for it. Else, if the answer helped, please click Accept answer so that it can help others in the community looking for help on similar topics.

    0 comments No comments