How to execute java command on Azure Virtual Machine from Azure Data Factory

satya 0 Reputation points
2024-03-19T01:29:08.2466667+00:00

I have executable fat jar deployed on Azure Virtual Machine (LINUX). I want to run this jar using java command from Azure Data Factory. Basically, I want to create a pipeline to call several java commands, one at a time in pipeline. I tried to create linked service in ADF but I couldnt see Virtual Machine in the list.

Please note that I dont want to convert this into web based Spring boot, or Azure Function or compute. I want to keep the jar within Azure Virtual Machine.

Can you please send me step by step instructions.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,900 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,700 questions
{count} votes

1 answer

Sort by: Most helpful
  1. PRADEEPCHEEKATLA-MSFT 89,571 Reputation points Microsoft Employee
    2024-03-19T06:39:13.46+00:00

    @satya - Thanks for the question and using MS Q&A paltform.

    Unfortunately, Azure Data Factory does not support executing commands on Azure Virtual Machines directly.

    This is an official document which shows the supported data sources in Azure data factory.

    User's image

    However, you can use Azure Automation to run PowerShell scripts on your Azure Virtual Machine.

    Here are the high-level steps to achieve this:

    1. Create an Azure Automation account.
    2. Create a PowerShell runbook in Azure Automation.
    3. Add the necessary code to the runbook to execute the Java command on your Azure Virtual Machine.
    4. Create a webhook for the runbook.
    5. Use the webhook URL in Azure Data Factory to trigger the runbook.

    User's image

    For more details, refer to Start a runbook from a webhook and How to configure Webhook activity for runbooks execution in Azure Data Factory v2?.

    Hope this helps. Do let us know if you any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.