Delete some component in ARM template data factory? - azure

I am trying to delete some components of data factory in ARM template json file. For an example if I have pipeline A,B,C and I would like to only deploy pipeline A into the data factory. Is there any way to accomplish this? I found only command that delete after deploy but I would prefer to delete it before deploying.
I also consider the option of deleting some of json key and value inside "resource" key in template file. Anyone ever tried this?

You could modify the ARM template json file.
Please reference this doc about Continuous integration lifecycle.
Please take a look of this post. The other answers (not mine) provided a better answer.
CI/CD pipeline for Data factory V1 using VSTS

Related

Filter verbose Azure ARM template

Exported Azure ARM template contains a lot's of useless information, let's say snapshots. I would like export actual resource definitions only.
Is it possible to filter unnecessary items out? I would like to convert this template to Bicep (to deploy all the resources into an another subscription) and now I have to clear manually all the unused items from the exported ARM template.
Thank you Gopa. Posting your suggestion as an answer to help other community members.
Exporting an ARM template from the resource group or resource will give you a template that is a snapshot of the current properties so it includes all the properties which were changed after the initial deployment.
You can also try exporting templates from the deployment history too which will give you an option to export your initial version without the changes you made after each deployment.
You can maintain all resources in source control as ARM templates and use CI/CD to deploy, whenever there is a change, so you can have our latest version of ARM templates and use it to build up a new environment when a need comes.
You can export the template that was used to deploy existing resources. The template you get is exactly the one that was used for deployment.
Export template after deployment
Select the resource group you want to export.
Select the link under Deployments.
Select one of the deployments from the deployment history.
Select Template. The template used for this deployment is displayed, and is available for download.

Build fails on CI pipeline

I am trying to build a CI pipeline, which is failing with an error "
Creating deployment parameters. ##[error]Check out the troubleshooting guide to see if your issue is addressed: https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/azure-resource-group-deployment?view=azure-devops#troubleshooting
[error]Error: Could not find any file matching the template file pattern
am not understanding what to be the path exactly is ? am copying the path where the Json file is (which is local)(C:\Testrepos\Templates\TestDEVOPS\dep?loy.json, is this correct? what could be the linked artifact?
I understand that you are getting the error in the task, Azure resource group deployment, right?
You have to upload your ARM templates to some place that Devops can access, not your local, normally I use a blob storage.
Then you put you ARM template urls in his box.
Your ARM templates have to be uploaded somewhere available on the internet for devops to access them. This is the key.
I hope this help you!

Updating Set of Values in ARM Templates Automatically

I have an ARM template, which I will be using it to deploy resources (Mentioned as in Azure Portal) via Azure DevOps Pipeline. These ARM templates were created using my Dev Subscription. If I need to use this same ARM template to move to production, I need to manually update the subscription id etc in the ARM template and then run the respective pipelines. Is there any way to automate this manual updation process in ARM template.
I have tried using File Transform Agent job available under Azure DevOps Release pipeline. But since the values are available inside nested loops of ARM templates, it failed. Is there any PowerShell script that will be suitable for this process of updating values.
I don't want to manually update the ids under the ARM Template. Instead, I want to update it automatically.
Set Json Property task might help to set the property with specific value.
First in the marketplace search for "set Json property" task and install it for your organization.
Then you can set the property path and the value accordingly. check here for detail usage
Instead of hard coding in ARM templates you can use parameters file. For dev and prod you can have separate files and while deploying pass ARM Template along with parameter file whichever is required.
You can use AKV (Azure Key Vault) to access your subscription details in parameter file
subscription().subscriptionid will get you the details

Powershell to download ARM template for Azure data factory Pipeline

i have a requirement to create an ADF pipeline using ARM template in powershell and it has to take inputs/validate few things from existing ADF piepline, for that reason i have to download the ARM tempalte for existing ADF pipeline through powershell. Can we do that for single ADF pipeline or multiple ones?
Note: existing pipeline is not created through ARM deployment, so i cant use "Save-AzureRmDeploymentTemplate" as i dont have deployment name created when pipeline is created through portal..
Any help is really appreciated.
Maybe you want to take a look at Export-AzureRmResourceGroup.
But I guess you can only export the entire resource group which may contain other things. You need put your data factory in a special resource group if you only want to export ADF.
Another way is to export arm template in ADF UI.

Azure Data Factory V2 Copy activity Mapping deployment issue

Consider following test Mapping for Data Factory Copy activity:
"translator": {
"columnMappings": "#json('{\"from\":\"to\"}')",
"type": "TabularTranslator"
}
After deploying pipeline with the help of Set-AzureRmDataFactoryV2Pipeline PowerShell cmdlet we get normally deployed pipeline with the exact columnMappings value as specified in source code. But if you try to be more dynamic:
"translator": {
"columnMappings": "#json(pipeline().parameters.Mapping)",
"type": "TabularTranslator"
}
then after deployment you'll find that translator element is completely missing in pipeline. A workaround - set translator in Azure Portal Data Factory pipeline editing UI (either in Designer or JSON modes - both options work). But if after these manipulations you save pipeline JSON to the file and attempt to deploy it via Set-AzureRmDataFactoryV2Pipeline PowerShell cmdlet - bang, translator becomes missing. Expected result - deployment shall preserve translator element, because Portal JSON Editor preserves it.
We are doing automated deployment of pipelines (as you already figured out - with the help of Set-AzureRmDataFactoryV2Pipeline) and this bug breaks our automated deployment because it requires manual postdeployment pipeline editing on Azure Portal UI.
What may be the reason of such a buggy behavior? Can you suggest an idea how to work around this bug in automated way, or how to fix the code so it can be properly deployed with Set-AzureRmDataFactoryV2Pipeline?
You could try whether "Update-Module -Name AzureRm.DataFactoryV2" helps. It might be caused by that your powershell module is out of date.

Resources