Skip to content

Commit 79d8e15

Browse files
authored
Merge pull request Azure#10540 from liubing-microsoft/liubing/express-custom-setup-support
Add Express Custom Setup support by Powershell
2 parents 8809276 + 2c4f84a commit 79d8e15

File tree

6 files changed

+65
-1
lines changed

6 files changed

+65
-1
lines changed

src/DataFactory/DataFactoryV2.Test/ScenarioTests/IntegrationRuntimeTests.ps1

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,33 @@ function Test-SsisAzure-IntegrationRuntime
143143
$secpasswd = ConvertTo-SecureString $catalogAdminPassword -AsPlainText -Force
144144
$mycreds = New-Object System.Management.Automation.PSCredential($catalogAdminUsername, $secpasswd)
145145

146+
# Prepare express custom setup
147+
# Create setup for cmdkey
148+
$targetName = 'fakeserver'
149+
$userName = 'fakeuser'
150+
$password = New-Object Microsoft.Azure.Management.DataFactory.Models.SecureString('fakepassword')
151+
$setup1 = New-Object Microsoft.Azure.Management.DataFactory.Models.CmdkeySetup($targetName, $userName, $password)
152+
153+
# Create setup for environment variable
154+
$variableName = 'name'
155+
$variableValue = 'value'
156+
$setup2 = New-Object Microsoft.Azure.Management.DataFactory.Models.EnvironmentVariableSetup($variableName, $variableValue)
157+
158+
# Create setup for 3rd party component without license Key
159+
$componentName1 = 'componentName1'
160+
$setup3 = New-Object Microsoft.Azure.Management.DataFactory.Models.ComponentSetup($componentName1)
161+
162+
# Create setup for 3rd party component with license Key
163+
$componentName2 = 'componentName2'
164+
$licenseKey = New-Object Microsoft.Azure.Management.DataFactory.Models.SecureString('fakelicensekey')
165+
$setup4 = New-Object Microsoft.Azure.Management.DataFactory.Models.ComponentSetup($componentName2, $licenseKey)
166+
167+
$setups = New-Object System.Collections.ArrayList
168+
$setups.Add($setup1)
169+
$setups.Add($setup2)
170+
$setups.Add($setup3)
171+
$setups.Add($setup4)
172+
146173
$actual = Set-AzDataFactoryV2IntegrationRuntime -ResourceGroupName $rgname `
147174
-DataFactoryName $dfname `
148175
-Name $irname `
@@ -159,6 +186,7 @@ function Test-SsisAzure-IntegrationRuntime
159186
-Edition Enterprise `
160187
-DataProxyIntegrationRuntimeName $proxyIrName `
161188
-DataProxyStagingLinkedServiceName $lsname `
189+
-ExpressCustomSetup $setups `
162190
-Force
163191

164192
$expected = Get-AzDataFactoryV2IntegrationRuntime -ResourceGroupName $rgname `

src/DataFactory/DataFactoryV2/Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
-->
2020
## Upcoming Release
2121
* Update ADF .Net SDK version to 4.4.0
22+
* Add parameter "ExpressCustomSetup" for "Set-AzureRmDataFactoryV2IntegrationRuntime" cmd to enable setup configurations and 3rd party components without custom setup script.
2223

2324
## Version 1.4.1
2425
* Update ADF .Net SDK version to 4.3.0

src/DataFactory/DataFactoryV2/Constants.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ internal static class Constants
140140

141141
public const string HelpIntegrationRuntimeEdition = "The edition for SSIS integration runtime which could be Standard or Enterprise, default is Standard if it is not specified.";
142142

143+
public const string HelpIntegrationRuntimeExpressCustomSetup = "The express custom setup for SSIS integration runtime which could be used to setup configurations and 3rd party components without custom setup script.";
144+
143145
public const string HelpIntegrationRuntimeDataProxyIntegrationRuntimeName = "The Self-Hosted Integration Runtime name which is used as a proxy.";
144146

145147
public const string HelpIntegrationRuntimeDataProxyStagingLinkedServiceName = "The Azure Blob Storage Linked Service name that references the staging data store to be used when moving data between Self-Hosted and Azure-SSIS Integration Runtime.";

src/DataFactory/DataFactoryV2/IntegrationRuntimes/SetAzureDataFactoryIntegrationRuntimeCommand.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,21 @@ public class SetAzureDataFactoryIntegrationRuntimeCommand : IntegrationRuntimeCm
279279
IgnoreCase = true)]
280280
public string Edition { get; set; }
281281

282+
[Parameter(
283+
ParameterSetName = ParameterSetNames.ByIntegrationRuntimeName,
284+
Mandatory = false,
285+
HelpMessage = Constants.HelpIntegrationRuntimeExpressCustomSetup)]
286+
[Parameter(
287+
ParameterSetName = ParameterSetNames.ByResourceId,
288+
Mandatory = false,
289+
HelpMessage = Constants.HelpIntegrationRuntimeExpressCustomSetup)]
290+
[Parameter(
291+
ParameterSetName = ParameterSetNames.ByIntegrationRuntimeObject,
292+
Mandatory = false,
293+
HelpMessage = Constants.HelpIntegrationRuntimeExpressCustomSetup)]
294+
[ValidateNotNullOrEmpty]
295+
public System.Collections.ArrayList ExpressCustomSetup { get; set; }
296+
282297
[Parameter(
283298
ParameterSetName = ParameterSetNames.ByIntegrationRuntimeName,
284299
Mandatory = false,
@@ -724,6 +739,20 @@ private void HandleManagedIntegrationRuntime(ManagedIntegrationRuntime integrati
724739
};
725740
}
726741

742+
if (ExpressCustomSetup != null && ExpressCustomSetup.ToArray().Length > 0)
743+
{
744+
if (integrationRuntime.SsisProperties == null)
745+
{
746+
integrationRuntime.SsisProperties = new IntegrationRuntimeSsisProperties();
747+
}
748+
System.Collections.Generic.IList<CustomSetupBase> setups = new System.Collections.Generic.List<CustomSetupBase>();
749+
foreach (CustomSetupBase setup in ExpressCustomSetup)
750+
{
751+
setups.Add(setup);
752+
}
753+
integrationRuntime.SsisProperties.ExpressCustomSetupProperties = setups;
754+
}
755+
727756
if (!string.IsNullOrEmpty(DataProxyIntegrationRuntimeName))
728757
{
729758
if (integrationRuntime.SsisProperties == null)

src/DataFactory/DataFactoryV2/Models/PSManagedIntegrationRuntime.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,7 @@ public PSManagedIntegrationRuntime(
7272
public string DataProxyStagingPath => ManagedIntegrationRuntime.SsisProperties?.DataProxyProperties?.Path;
7373

7474
public string Edition => ManagedIntegrationRuntime.SsisProperties?.Edition;
75+
76+
public System.Collections.Generic.IList<CustomSetupBase> ExpressCustomSetup => ManagedIntegrationRuntime.SsisProperties?.ExpressCustomSetupProperties;
7577
}
7678
}

src/DataFactory/DataFactoryV2/help/Set-AzDataFactoryV2IntegrationRuntime.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Set-AzDataFactoryV2IntegrationRuntime [-ResourceGroupName] <String> [-DataFactor
2121
[-Edition <String>] [-MaxParallelExecutionsPerNode <Int32>] [-LicenseType <String>] [-AuthKey <SecureString>]
2222
[-DataProxyIntegrationRuntimeName <String>] [-DataProxyStagingLinkedServiceName <String>] [-DataProxyStagingPath <String>]
2323
[-Force] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
24+
[-ExpressCustomSetup <ArrayList>]
2425
```
2526

2627
### ByResourceId
@@ -31,7 +32,7 @@ Set-AzDataFactoryV2IntegrationRuntime [-ResourceId] <String> [-Type <String>] [-
3132
[-SetupScriptContainerSasUri <String>] [-Edition <String>] [-MaxParallelExecutionsPerNode <Int32>]
3233
[-DataProxyIntegrationRuntimeName <String>] [-DataProxyStagingLinkedServiceName <String>] [-DataProxyStagingPath <String>]
3334
[-LicenseType <String>] [-AuthKey <SecureString>] [-Force] [-DefaultProfile <IAzureContextContainer>]
34-
[-WhatIf] [-Confirm] [<CommonParameters>]
35+
[-WhatIf] [-Confirm] [<CommonParameters>] [-ExpressCustomSetup <ArrayList>]
3536
```
3637

3738
### ByLinkedIntegrationRuntimeResourceId
@@ -57,6 +58,7 @@ Set-AzDataFactoryV2IntegrationRuntime [-InputObject] <PSIntegrationRuntime> [-Ty
5758
[-MaxParallelExecutionsPerNode <Int32>] [-LicenseType <String>] [-DataProxyIntegrationRuntimeName <String>]
5859
[-DataProxyStagingLinkedServiceName <String>] [-DataProxyStagingPath <String>] [-AuthKey <SecureString>] [-Force]
5960
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
61+
[-ExpressCustomSetup <ArrayList>]
6062
```
6163

6264
### ByLinkedIntegrationRuntimeObject

0 commit comments

Comments
 (0)