How to deploy multiple ARM with Azure DevOps Pipeline - azure-devops

Ì would like to deploy Storage, SQL Logical Server and SQL database with ARM. Currently templates are all located under own folder in repo /Storage /SQLLogicalServer /SQLDB
I can deploy they one by one with dedicated pipeline currently.
What is best practice to deploy several Azure resources with single pipeline?
Is it good idea to use one master ARM template that call each resource ARM?
Any tutorial or article about this scenario?

What is best practice to deploy several Azure resources with single
pipeline? Is it good idea to use one master ARM template that call
each resource ARM? Any tutorial or article about this scenario?
You can follow Deploy nested Azure Resource Manager templates for testing environments to combine your three templates into one, then you would easily use one single pipeline to deploy them together. Here's a similar scenario like yours.
Note:
If you have separate pipelines for your three ARM templates, you can easily customize them. E.g: You can set the pipeline to be triggered only when the corresponding ARM template repo is changed. If the ARM templates are in one pipeline, they would be deployed even when only one of them is changed. (In that scenario, you can use this as workaround.)
Whether it's good idea totally depends on your needs/scenarios. Hope it helps :)

Related

Selective Deployment in Azure Data Factory (ADF)?

I am using npm package based CI-CD approach for ADF. I want to selectively deploy some pipelines and datasets on prod, instead of deploying everything in repository.
Is there any powershell script where I can send list of ADF objects which I want to deploy using my CI-CD pipeline?
Instead of powershell, if there is any other way, please let me know that as well.
As per official documentation, Data factory entities depend on each other.
For example, triggers depend on pipelines, and pipelines depend on datasets and other pipelines. Selective publishing of a subset of resources could lead to unexpected behaviors and errors.
On rare occasions when you need selective publishing, consider using a hotfix.
Steps to deploy a hotfix

Should I have a distinct CI/CD for dev and prod or can I have one for all of my environments and applications in azure devops

I have a monorepo where a lot of applications and libs are build.
I tried to make the CI/CD process the more readable and performant as possible.
Problem is I'm not so familiar with all the possibilites azure pipeline give me.
Should I have a pipeline for each environement? for each app? or can I create only one and using tags or something like that?
thanks
For monorepo, you can create one pipeline for all applications, or create individual CI/CD for each one. It depends on how you define in the pipeline.
One pipeline for all: you can use different stages, file path filter, conditions...etc to isolate the builds&testing of application, add stage/job name to display which application it's building.
Individual pipeline: define more pipelines for each application, but could be more readable.
There is a monorepo pipeline sample which has one pipeline and seperate pipelines, you can choose the best way for your project.

Is it possible to realease a full set of potentially dependant artifacts (microservices) at once?

Traditionally we have to deliver our applications on the test and pre-production platforms one by one (usually by hand using setups). Applications like the front end javascript SPA UI are linked to backend services and their delivery sometimes goes together.
Each service and each application has its own git repository. (we are using on premise TFS 2018 for now )
Then when it is necessary to go into production, we deliver all of the front end services and applications at once that have been validated at once.
We would like to automate our process but we don't know if Azure Devops is suitable.
From what I understand with Azure Devops, we can make an independent artifact for each microservice and each front end application. We can also deliver them independently.
It seems to me that Azure Devops by default allows you to manage the delivery cycle for a particular microservice but not for an assembly making up a complete system, right?
But is it possible to deliver a set of projects each with a particular version? For that, must all of our projects be in the same solution or the same git repository?
Yes, you can use multiple artifacts from different sources (build artifacts, repositories, package feeds, github, docker hub, Azure Container Registry, ++) within a single pipeline or release definition. That's true for both the classic release definitions and the modern multi-stage pipeline implementation.
For example you can define a pipeline or release definition that consumes a front-end web app from a build artifact sourced from RepoA, a back-end service artifact consumed from a container registry originally from RepoB, and say a script library in the form of a Git artifact from RepoC. From there you could deploy each of those artifacts together, or in parallel stages, in sequence, partially, with approvals, conditionally, etc, all from the same pipeline.
The full configuration as code YAML multi-stage pipelines are still in preview, so there are some workflow orchestrations that are a little tougher to implement. But there is enough feature parity with the classic release definitions that I would default to using multi-stage for any net new needs.

How to complete CI/CD pipelines with Azure DevOps for Azure API Management

I need help to understand better how to create complete CI/CD with Azure Devops for APim. Ok I already has explored the tools and read docs:
https://github.com/Azure/azure-api-management-devops-resource-kit
But I still have questions, my scenario:
APim dev instance with APi and operations created and others settings, as well APim prod instance created but empty.
I ran the extract tool and got the templates (not all), still need the Master (linked templates), and on this point seat my doubt, I already have 2 repos too(dev and prod).
How can I create the Master template, and how my changes from dev environment will be automatically applied to prod?
I didn't used the policyXMLBaseUrl parameters not sure what Path insert there, although seems #miaojiang inserted a folder from azure storage.
After some search and tries I deployed API's and Operations from an environment to another, but we still don't have a full automated scenario, where I make a change in a instance and that is automatically available.Is necessary to edit policies and definitions directly on the repositories or run the extract tool again.

Best practice for scripting Azure resource creation

I'm creating a test environment in Azure. I want to have an accurate script of what of the configuration so it's easy to replicate for other test, pre-prod and prod environments later on. The environment has an existing subscription, and I want the entire hierarchy of resources from Resource Groups through to Web Apps to be created by script.
I'm currently rolling my own script in PowerShell utilising AzureRm. This is working well, but I can't help feel I'm reinventing the wheel. What is the existing method for creating an entire Azure environment by script?
Yes, that way is called Azure Resource Manager Templates. Quote:
With Resource Manager, you can create a template (in JSON format) that defines the infrastructure and configuration of your Azure solution. By using a template, you can repeatedly deploy your solution throughout its lifecycle and have confidence your resources are deployed in a consistent state. When you create a solution from the portal, the solution automatically includes a deployment template. You do not have to create your template from scratch because you can start with the template for your solution and customize it to meet your specific needs. You can retrieve a template for an existing resource group by either exporting the current state of the resource group, or viewing the template used for a particular deployment. Viewing the exported template is a helpful way to learn about the template syntax.
Reference: https://learn.microsoft.com/en-us/azure/azure-resource-manager/resource-group-overview#template-deployment
Edit: you can use powershell, azure cli, azure cli2, azure sdk to deploy those templates (or simply Azure portal, search for "Template Deployment")