Plz refer these 2 MSFT docs:
They provide step by steps details for the same with screenshots/images.
Below is AI content : (summarzied version of the above 2 Docs)
for images, plz refer docs
To set up a build-and-deploy pipeline using an ARM template and artifacts in Azure Data Factory, follow these steps:
- Create a Pipeline in Azure DevOps:
- Open your Azure DevOps project and navigate to Pipelines.
- Select "New Pipeline" and choose the repository where your Data Factory resources are stored.
- Define the YAML Pipeline:
- Use a YAML file to define your pipeline. This file should include steps to validate your code and export the ARM template into a build artifact.
- Ensure your YAML file includes the necessary scripts and dependencies.
- Set Up Release Pipeline:
- In Azure DevOps, go to Pipelines > Releases and select "New Pipeline".
- Choose the "Empty job" template.
- In the stage name, enter the name of your environment.
- Add Artifacts:
- Select "Add artifact" and choose the Git repository configured with your Data Factory.
- Set the default branch to the publish branch (usually
adf_publish
).
- Add ARM Template Deployment Task:
- In the stage view, select "View stage tasks" and add an Azure Resource Manager Deployment task.
- Configure the task with the appropriate subscription, resource group, and location.
- Specify the ARM template file (
ARMTemplateForFactory.json
) from your publish branch.
- Configure Template Parameters:
- Choose the parameters file (
ARMTemplateParametersForFactory.json
) and set the necessary parameter values.- Select "Incremental" for the deployment mode to avoid deleting existing resources.
- Choose the parameters file (
- Specify the ARM template file (
- Configure the task with the appropriate subscription, resource group, and location.
- In the stage view, select "View stage tasks" and add an Azure Resource Manager Deployment task.
- Set the default branch to the publish branch (usually
- Select "Add artifact" and choose the Git repository configured with your Data Factory.
- Choose the "Empty job" template.
- In Azure DevOps, go to Pipelines > Releases and select "New Pipeline".
- Use a YAML file to define your pipeline. This file should include steps to validate your code and export the ARM template into a build artifact.
- Open your Azure DevOps project and navigate to Pipelines.
- Save and Trigger the Release:
- Save the release pipeline and create a release to deploy your Data Factory resources.