Skip to content

Commit 54a1b51

Browse files
committed
updating ci/cd script info
1 parent bd21660 commit 54a1b51

File tree

2 files changed

+21
-11
lines changed

2 files changed

+21
-11
lines changed

articles/data-factory/continuous-integration-deployment.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ms.author: daperlov
1010
ms.reviewer: maghan
1111
manager: jroth
1212
ms.topic: conceptual
13-
ms.date: 08/14/2019
13+
ms.date: 02/12/2020
1414
---
1515

1616
# Continuous integration and delivery in Azure Data Factory
@@ -134,6 +134,9 @@ Following is a guide for setting up an Azure Pipelines release, which automates
134134

135135
![Select Create release](media/continuous-integration-deployment/continuous-integration-image10.png)
136136

137+
> [!IMPORTANT]
138+
> In CI/CD scenarios, the integration runtime (IR) type in different environments must be the same. For example, if you have a self-hosted IR in the development environment, the same IR must also be of type self-hosted in other environments, such as test and production. Similarly, if you're sharing integration runtimes across multiple stages, you have to configure the integration runtimes as linked self-hosted in all environments, such as development, test, and production.
139+
137140
### Get secrets from Azure Key Vault
138141

139142
If you have secrets to pass in an Azure Resource Manager template, we recommend that you use Azure Key Vault with the Azure Pipelines release.
@@ -179,33 +182,40 @@ There are two ways to handle secrets:
179182

180183
Deployment can fail if you try to update active triggers. To update active triggers, you need to manually stop them and then restart them after the deployment. You can do this by using an Azure PowerShell task:
181184

182-
1. On the **Tasks** tab of the release, add an **Azure PowerShell** task.
185+
1. On the **Tasks** tab of the release, add an **Azure PowerShell** task. Choose task version 4.*.
183186

184-
1. Select **Azure Resource Manager** as the connection type, and then select your subscription.
187+
1. Select the subscription your factory is in.
185188

186-
1. Select **Inline Script** as the script type, and then provide your code. The following code stops the triggers:
189+
1. Select **Script File Path** as the script type. This requires you to save your PowerShell script in your repository. The following PowerShell script can be used to stop triggers:
187190

188191
```powershell
189192
$triggersADF = Get-AzDataFactoryV2Trigger -DataFactoryName $DataFactoryName -ResourceGroupName $ResourceGroupName
190193

191194
$triggersADF | ForEach-Object { Stop-AzDataFactoryV2Trigger -ResourceGroupName $ResourceGroupName -DataFactoryName $DataFactoryName -Name $_.name -Force }
192195
```
193196

194-
![Azure PowerShell task](media/continuous-integration-deployment/continuous-integration-image11.png)
195-
196197
You can complete similar steps (with the `Start-AzDataFactoryV2Trigger` function) to restart the triggers after deployment.
197198

198-
> [!IMPORTANT]
199-
> In CI/CD scenarios, the integration runtime (IR) type in different environments must be the same. For example, if you have a self-hosted IR in the development environment, the same IR must also be of type self-hosted in other environments, such as test and production. Similarly, if you're sharing integration runtimes across multiple stages, you have to configure the integration runtimes as linked self-hosted in all environments, such as development, test, and production.
199+
### Sample pre- and post-deployment script
200200

201-
#### Sample pre- and post-deployment script
201+
The following sample script can be used to stop triggers before deployment and restart them afterward. The script also includes code to delete resources that have been removed. Save the script in an Azure DevOps git repository and reference it via an Azure PowerShell task using version 4.*.
202+
203+
When running a pre-deployment script, you will need to specify a variation of the following parameters in the **Script Arguments** field.
204+
205+
`-armTemplate "$(System.DefaultWorkingDirectory)/<your-arm-template-location>" -ResourceGroupName <your-resource-group-name> -DataFactoryName <your-data-factory-name> -predeployment $true -deleteDeployment $false`
206+
207+
208+
When running a post-deployment script, you will need to specify a variation of the following parameters in the **Script Arguments** field.
209+
210+
`-armTemplate "$(System.DefaultWorkingDirectory)/<your-arm-template-location>" -ResourceGroupName <your-resource-group-name> -DataFactoryName <your-data-factory-name> -predeployment $false -deleteDeployment $true`
211+
212+
![Azure PowerShell task](media/continuous-integration-deployment/continuous-integration-image11.png)
202213

203-
The following sample script shows how to stop triggers before deployment and restart them afterward. The script also includes code to delete resources that have been removed. To install the latest version of Azure PowerShell, see [Install Azure PowerShell on Windows with PowerShellGet](https://docs.microsoft.com/powershell/azure/install-az-ps).
214+
Here is the script that can be used for pre- and post-deployment. It accounts for deleted resources and resource references.
204215

205216
```powershell
206217
param
207218
(
208-
[parameter(Mandatory = $false)] [String] $rootFolder,
209219
[parameter(Mandatory = $false)] [String] $armTemplate,
210220
[parameter(Mandatory = $false)] [String] $ResourceGroupName,
211221
[parameter(Mandatory = $false)] [String] $DataFactoryName,
47.6 KB
Loading

0 commit comments

Comments
 (0)