Azure logic app to connect to Virtual machine and run azcopy

2.1k Views Asked by At

I need to put together a logic app. The trigger in that if/when a new file comes to a blob storage the new file will be moved to a new location say 'XYZ'.

The way the file will move to new location XYZ is, the logic app in actions will connect to virtual machine which will run azcopy tool and pick file from the blob storage and put it in the new location XYZ

And I am new to logic apps connecting to Virtual machines and somehow trigger azcopy command within a virtual machine when the logic app runs.

Blob storage, virtual machine and logic apps are all in the same resource group, same subscription.

Would really appreciate some pointers.

  1. I heard that I need to create a ISE in order for the logic app to work with virtual machine but I am not sure if I really need this. This is the article that I saw. https://learn.microsoft.com/en-us/azure/logic-apps/connect-virtual-network-vnet-isolated-environment

Is that the only way? 2) How would I run AZCopy command within a virtual machine from logic app?

Thanks so much for your help.

1

There are 1 best solutions below

0
On

In theory, the Logic App can connect to Azure VM with the public IP or FQDN assigned to the VM over the Internet. If you only intend to connect from a VNet, you need ISE for the logic APP.

As far as I know, It's not easy to run scripts within the Azure VM from Azure logic App, you may invoke the API with an HTTP connector from the logic App, refer to this answer for more details.

Finally, If you just want to move the blob files in the Azure storage account, it would be easier if using the Azure function with a blob storage trigger. You could search the similarities like this.