Hi Nagesh CL,
Thanks for reaching out to Microsoft Q&A.
You can try these approaches:
ADF with Batch Service:
- Custom Activity: This activity runs code in Azure Batch.
- Azure Batch:
- You would need to upload all your required files, including the '.bat', '.jar', and config files, to azure blob storage.
Steps:
- Create an Azure Batch Account: Set up a Batch account linked to your ADF.
- Upload Files: Store the '.bat', '.jar', config, and any other necessary files in Blob Storage.
- Create a Pool and Job: Use ADF's Custom Activity to create a Batch job. In the job, specify the task to run the '.bat' file.
- Task Setup: In the Batch task, reference the storage location of your files. The '.bat' file will be executed on Batch compute nodes, which will download the required files from Blob Storage.
Key Points:
- The Custom Activity will need an Azure Batch pool to run your tasks.
- You cannot execute files directly from shared folders without using Azure Batch.
- Ensure the Batch nodes (VMs) have access to the Blob Storage where your files are stored.
Logic Apps:
If your VM is on a public network or reachable by a Logic App workflow, you can execute the '.bat' file remotely using Logic Apps.
- PowerShell Execution:
- You can use the Logic Apps PowerShell action to run a PowerShell script that calls your '.bat' file on the client VM.
The Logic App can either:
- Invoke a PowerShell script: To remotely execute the '.bat' file on the client VM using a secure connection (like SSH for Linux or WinRM for windows).
- Use Azure Runbooks: If direct access is not possible, you can trigger an Azure Automation Runbook that runs the '.bat' file on the VM.
Key Points:
- For this approach, you need network connectivity between Logic Apps and your VM.
- You may need to set up authentication mechanisms (like MI, service principals, etc.) to securely execute the script.
Recommendation:
- If you already use Azure Batch or are comfortable setting it up, ADF Custom Activity is a scalable and maintainable solution.
- If you have direct access to the VM and do not want to manage Azure Batch resources, Logic Apps with PowerShell or Azure Automation might be simpler.
Please 'Upvote'(Thumbs-up) and 'Accept' as an answer if the reply was helpful. This will benefit other community members who face the same issue.