Azure Data Factory CI/CD Improvements integrated with DevOps - azure-devops

I've been reading the following link.
https://learn.microsoft.com/en-us/azure/data-factory/continuous-integration-delivery-improvements
It mentions using npm to build the Data Factory ARM templates and use the resulting artefact to deploy to UAT/Prod etc instead of using the adf_publish branch.
Has anyone got a sample Yaml file that does this?
Also, how would you handle overriding the ARM Template Parameters Json file for changing over parameterization such as the Environments Key Vault etc e.g. Dev-KV -> UAT-KV, Prod-KV

This is what I did. I followed this article to get my yaml file setup, there is a github repo in the article that has all of this persons code.
Azure Data Factory CI-CD made simple: Building and deploying ARM templates with Azure DevOps YAML Pipelines
Then I used Global parameters and referenced those everywhere in my pipelines. Here is a ref for that: Global parameters in Azure Data Factory
And finally, I used the overrideParameters option in my yaml pipeline to deploy the correct version of the parameter to the correct environment. Here is a ref for that: ADF Release - Set global params during deployment
Hope that helps!

Related

is it possible to create azure build pipelines using terraform code?

I want to Create Azure Build pipelines using Terraform code, but not able to find any proper documentation on this. Is it possible ?
I tried terraform documentation, expecting some documentation or video guide how to create Azure build pipelines using terraform code
is it possible to create azure build pipelines using terraform code?
The answer is impossible.
Hashicorp doesn't have a terraform provider for Azure DevOps now.
If you check the azurerm provider, only azurerm_data_factory_pipeline is available, no Azure DevOps build pipeline.
You should look at the Azure DevOps provider From Microsoft. It does contain a resource for build definitions but you will need to pass it the path to an existing YAML file, you can't create the YAML from Terraform.
If you have a "templated" YAML then you could create a process that commits the YAML to a repo then use Terraform to set up the definition.

Cloning an Azure Devops yaml Pipeline

Azure Devops pipelines provide a clone functionality. This is super useful functionality for scaffolding pipelines. My yaml pipelines have a lot of variables, and it's difficult and error prone to reassign all of these variables from scratch.
The Azure Devops UI updated in the last week or so, and there doesn't seem to be an option to clone yaml pipelines anymore. Classic pipelines still have the clone option.
Can anyone figure out how to clone a yaml pipeline with the new UI?
Hmm I haven't used the clone feature, but have you investigated using variable groups or variable templates to make your life easier? You can link a variable group to Azure Key Vault to facilitate secrets.
I've never used a cloning option in YAML. But I wouldn't use so many Azure DevOps variables which were created in the UI. You have multiple options here:
Store the variables in your YAML file (not for secrets)
Store the variables in a YAML template (not for secrets)
Store the variables in a variable group (use Azure Key Vault or the Secure flag for secrets)
The variable group can be linked to multiple pipelines. But there is currently no scope available. So, if you have multiple environments, you have to name it like "myvariablegroup-dev", "myvariablegroup-prod". Hopefully, this feature to attach a variable group to an environment is coming in the near feature.
1,You can disable the multi-stage pipelines feature in preview features
On the top right corner of the page click the user profile and choose Preview features
Then disable the Multi-stage pipelines. Then you will see the clone option appear again.
2,The other workaround is to create a new pipeline and choose to use the Existing Azure PipelineS Yaml file while following the wizard. (which has the same effect with cloning yaml, they use the same azure-pipelines.yml file)
Then choose the same yaml file with the original pipeline.

Is there a json schema file for Azure Devops Pipelines

I have exported my pipeline from Azure Devops. This results in a json file I can import to create a new build definition. Is there a schema definition that defines this file. I would like to edit it (using VS) and a schema serve as documentation-instead of hacking it.
There's yamlschema endpoint in Azure DevOps REST API that returns schema for YAML pipeline:
GET https://dev.azure.com/{organization}/_apis/distributedtask/yamlschema?api-version=5.1
Seems like this is where azure pipelines extension takes it from.
I use vscode and I'm trying out the yaml extension. However, I found there is also an azure pipeline extension, but the yaml extension is more popular.
In order for me to get azure pipelines working on the yaml extension, I was able to find the json schema that azure pipelines used here. I referenced using the raw file, but there are still bugs here and there.
On the https://www.schemastore.org/json/ there are a lot of schemas, and especially for Azure Devops Pipelines
The file tasks.schema.json seems a schema definition for the tasks in pipeline. And this repo(https://github.com/microsoft/azure-pipelines-tasks) includes examples on how we write tasks which will help you write other tasks which can be uploaded to your account or server.

All Build and Release Definition Export At Once?

Is there a way to export all Build and/or Release Definitions at once in Azure DevOps, instead of doing it one by one ?
Thank you.
You can do that by calling Azure DevOps Pipelines REST API. Start by query all build and release definitions, and iterate on each of the definitions to get the JSON detail of the definition.
But if your build is using YAML file, then the build definition will only container definition of where to search the YAML file and also the variable and trigger settings.

Azure data factory - Continuous deployment using VSTS

I need to know how can i build continuous deployment for Azure Data factory using VSTS. I know there is an Azure data factory deployment available in VSTS release. But I'm looking for other options using Powershell for deployment.
If anyone has already done anything specific to this provide the links.
This blog should get you started. I'm using a comparable method for deployment. Before deploying the JSON files using a PowerShell command, I edit them to insert environment specific values into the Data Factory definitions. You can pass these values as parameters from the TFS deployment-pipeline.