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

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.

Related

Azure DevOps : I want to add a task in my pipeline that can copy some files from my Azure Repo into an On premise VM. Any leads?

I have a requirement to create an Azure DevOps pipeline that can copy files from my Azure Repo to a path on an On-premise VM (a SQL server to be precise). Could anyone advise on how to get started on this?
You would need to add a checkout task to the pipeline. You would define the repo as a source and then add a step to checkout the repo. Here's some documentation concerning checking out multiple repos using yaml that should get you started

Azure Data Factory CI/CD Improvements integrated with 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!

Best way to create CI/CD pipeline for GCP BigQuery using Azure DevOps

I am looking for the best way to create CI/CD pipeline for GCP BigQuery using Azure DevOps.
I need repositories in Azure Devops, and automatically have CI and CD to our Dev/QA and PROD environments in GCP. Also, how to set up automatic builds in Azure DevOps for GCP master branch code? Is there a way to integrate BigQuery and Azure Devops repositories ?
We have to use Azure DevOps for Project, repository and pipeline management. So trying ways to build and deploy to GCP Bigquery from Azure Devops. Any insights would be helpful.
First of all congratulations on your first post.
Yes definitely you can integrate Azure Devops with BigQuery.
A good read here.
But from your question, I failed to understand what you are trying to deploy. Is it some client code which will connect to BQ to run query and fetch data or is it a Dataflow job starting from ingesting data?
There are different ways to do each of them.

create Azure release pipeline using ansible

Whether ansible can be used to create release and build pipelines in azure is there any existing or custom modules for creating pipelines?
The answer is yes. Ansible can be used in azure devops pipelines.
You can click here to install Ansible extension in your azure devops organization. After it is installed, you can use Ansible task in the pipeline to run playbook.
To get started with azure devops pipeline. You can check out this document.
You can check below detailed tutorial about using ansible in azure devops pipeline.
Automating Infrastructure Deployments in the Cloud with Ansible and Azure Pipelines

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.