Skip to content

Commit

Permalink
[Data Factory] Support CRUD of data flow runtime properties in Manage…
Browse files Browse the repository at this point in the history
…d IR. (#11626)

* support data flow properties in azure ir

* fix md
  • Loading branch information
jackmagic313 authored Apr 20, 2020
1 parent 499c0ad commit 5247512
Show file tree
Hide file tree
Showing 5 changed files with 139 additions and 17 deletions.
1 change: 1 addition & 0 deletions src/DataFactory/DataFactoryV2/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Additional information about change #1
-->
## Upcoming Release
* Support CRUD of data flow runtime properties in Managed IR.

## Version 1.7.0
* Updated ADF .Net SDK version to 4.8.0
Expand Down
6 changes: 6 additions & 0 deletions src/DataFactory/DataFactoryV2/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ internal static class Constants

public const string HelpIntegrationRuntimePublicIP = "The static public IP addresses which the integration runtime will use.";

public const string HelpIntegrationRuntimeDataFlowCoreCount = "Core count of the data flow cluster which will execute data flow job.";

public const string HelpIntegrationRuntimeDataFlowComputeType = "Compute type of the data flow cluster which will execute data flow job.";

public const string HelpIntegrationRuntimeDataFlowTimeToLive = "Time to live (in minutes) setting of the data flow cluster which will execute data flow job.";

public const string HelpIntegrationRuntimeSetupScriptContainerSasUri = "The SAS URI of the Azure blob container that contains the custom setup script.";

public const string HelpIntegrationRuntimeEdition = "The edition for SSIS integration runtime which could be Standard or Enterprise, default is Standard if it is not specified.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
using Microsoft.Azure.Management.Internal.Resources.Utilities.Models;
using Microsoft.Rest.Azure;


namespace Microsoft.Azure.Commands.DataFactoryV2
{
[Cmdlet("Set", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "DataFactoryV2IntegrationRuntime",DefaultParameterSetName = ParameterSetNames.ByIntegrationRuntimeName,SupportsShouldProcess = true),OutputType(typeof(PSIntegrationRuntime))]
Expand Down Expand Up @@ -260,6 +259,52 @@ public class SetAzureDataFactoryIntegrationRuntimeCommand : IntegrationRuntimeCm
[ValidateNotNull]
public string[] PublicIPs { get; set; }

[Parameter(
ParameterSetName = ParameterSetNames.ByIntegrationRuntimeName,
Mandatory = false,
HelpMessage = Constants.HelpIntegrationRuntimeDataFlowComputeType)]
[Parameter(
ParameterSetName = ParameterSetNames.ByResourceId,
Mandatory = false,
HelpMessage = Constants.HelpIntegrationRuntimeDataFlowComputeType)]
[Parameter(
ParameterSetName = ParameterSetNames.ByIntegrationRuntimeObject,
Mandatory = false,
HelpMessage = Constants.HelpIntegrationRuntimeDataFlowComputeType)]
[PSArgumentCompleter(Management.DataFactory.Models.DataFlowComputeType.General,
Management.DataFactory.Models.DataFlowComputeType.MemoryOptimized,
Management.DataFactory.Models.DataFlowComputeType.ComputeOptimized)]
[ValidateNotNullOrEmpty]
public string DataFlowComputeType { get; set; }

[Parameter(
ParameterSetName = ParameterSetNames.ByIntegrationRuntimeName,
Mandatory = false,
HelpMessage = Constants.HelpIntegrationRuntimeDataFlowCoreCount)]
[Parameter(
ParameterSetName = ParameterSetNames.ByResourceId,
Mandatory = false,
HelpMessage = Constants.HelpIntegrationRuntimeDataFlowCoreCount)]
[Parameter(
ParameterSetName = ParameterSetNames.ByIntegrationRuntimeObject,
Mandatory = false,
HelpMessage = Constants.HelpIntegrationRuntimeDataFlowCoreCount)]
public int? DataFlowCoreCount { get; set; }

[Parameter(
ParameterSetName = ParameterSetNames.ByIntegrationRuntimeName,
Mandatory = false,
HelpMessage = Constants.HelpIntegrationRuntimeDataFlowTimeToLive)]
[Parameter(
ParameterSetName = ParameterSetNames.ByResourceId,
Mandatory = false,
HelpMessage = Constants.HelpIntegrationRuntimeDataFlowTimeToLive)]
[Parameter(
ParameterSetName = ParameterSetNames.ByIntegrationRuntimeObject,
Mandatory = false,
HelpMessage = Constants.HelpIntegrationRuntimeDataFlowTimeToLive)]
public int? DataFlowTimeToLive { get; set; }

[Parameter(
ParameterSetName = ParameterSetNames.ByIntegrationRuntimeName,
Mandatory = false,
Expand Down Expand Up @@ -728,6 +773,22 @@ private void HandleManagedIntegrationRuntime(ManagedIntegrationRuntime integrati
}
}

if (!string.IsNullOrWhiteSpace(DataFlowComputeType) || DataFlowCoreCount != null || DataFlowTimeToLive != null)
{
if (integrationRuntime.ComputeProperties == null)
{
integrationRuntime.ComputeProperties = new IntegrationRuntimeComputeProperties();
}
if (integrationRuntime.ComputeProperties.DataFlowProperties == null)
{
integrationRuntime.ComputeProperties.DataFlowProperties = new IntegrationRuntimeDataFlowProperties();
}

integrationRuntime.ComputeProperties.DataFlowProperties.ComputeType = DataFlowComputeType ?? integrationRuntime.ComputeProperties.DataFlowProperties.ComputeType;
integrationRuntime.ComputeProperties.DataFlowProperties.CoreCount = DataFlowCoreCount ?? integrationRuntime.ComputeProperties.DataFlowProperties.CoreCount;
integrationRuntime.ComputeProperties.DataFlowProperties.TimeToLive = DataFlowTimeToLive ?? integrationRuntime.ComputeProperties.DataFlowProperties.TimeToLive;
}

if (PublicIPs != null)
{
if (string.IsNullOrWhiteSpace(VNetId))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ public PSManagedIntegrationRuntime(

public string[] PublicIPs => ManagedIntegrationRuntime.ComputeProperties?.VNetProperties?.PublicIPs == null ? null : new List<string>(ManagedIntegrationRuntime.ComputeProperties?.VNetProperties?.PublicIPs).ToArray();

public int? DataFlowCoreCount => ManagedIntegrationRuntime.ComputeProperties?.DataFlowProperties?.CoreCount;

public string DataFlowComputeType => ManagedIntegrationRuntime.ComputeProperties?.DataFlowProperties?.ComputeType;

public int? DataFlowTimeToLive => ManagedIntegrationRuntime.ComputeProperties?.DataFlowProperties?.TimeToLive;

public string State => ManagedIntegrationRuntime.State;

public string LicenseType => ManagedIntegrationRuntime.SsisProperties?.LicenseType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,26 @@ Updates an integration runtime.
Set-AzDataFactoryV2IntegrationRuntime [-ResourceGroupName] <String> [-DataFactoryName] <String>
[-Name] <String> [-Type <String>] [-Description <String>] [-Location <String>] [-NodeSize <String>]
[-NodeCount <Int32>] [-CatalogServerEndpoint <String>] [-CatalogAdminCredential <PSCredential>]
[-CatalogPricingTier <String>] [-VNetId <String>] [-Subnet <String>]
[-PublicIPs <String[]>] [-SetupScriptContainerSasUri <String>]
[-Edition <String>] [-MaxParallelExecutionsPerNode <Int32>] [-LicenseType <String>] [-AuthKey <SecureString>]
[-DataProxyIntegrationRuntimeName <String>] [-DataProxyStagingLinkedServiceName <String>] [-DataProxyStagingPath <String>]
[-Force] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
[-ExpressCustomSetup <ArrayList>]
[-CatalogPricingTier <String>] [-VNetId <String>] [-Subnet <String>] [-PublicIPs <String[]>]
[-DataFlowComputeType <String>] [-DataFlowCoreCount <Int32>] [-DataFlowTimeToLive <Int32>]
[-SetupScriptContainerSasUri <String>] [-Edition <String>] [-ExpressCustomSetup <ArrayList>]
[-DataProxyIntegrationRuntimeName <String>] [-DataProxyStagingLinkedServiceName <String>]
[-DataProxyStagingPath <String>] [-MaxParallelExecutionsPerNode <Int32>] [-LicenseType <String>]
[-AuthKey <SecureString>] [-Force] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
[<CommonParameters>]
```

### ByResourceId
```
Set-AzDataFactoryV2IntegrationRuntime [-ResourceId] <String> [-Type <String>] [-Description <String>]
[-Location <String>] [-NodeSize <String>] [-NodeCount <Int32>] [-CatalogServerEndpoint <String>]
[-CatalogAdminCredential <PSCredential>] [-CatalogPricingTier <String>] [-VNetId <String>] [-Subnet <String>] [-PublicIPs <String[]>]
[-SetupScriptContainerSasUri <String>] [-Edition <String>] [-MaxParallelExecutionsPerNode <Int32>]
[-DataProxyIntegrationRuntimeName <String>] [-DataProxyStagingLinkedServiceName <String>] [-DataProxyStagingPath <String>]
[-LicenseType <String>] [-AuthKey <SecureString>] [-Force] [-DefaultProfile <IAzureContextContainer>]
[-WhatIf] [-Confirm] [<CommonParameters>] [-ExpressCustomSetup <ArrayList>]
[-CatalogAdminCredential <PSCredential>] [-CatalogPricingTier <String>] [-VNetId <String>] [-Subnet <String>]
[-PublicIPs <String[]>] [-DataFlowComputeType <String>] [-DataFlowCoreCount <Int32>]
[-DataFlowTimeToLive <Int32>] [-SetupScriptContainerSasUri <String>] [-Edition <String>]
[-ExpressCustomSetup <ArrayList>] [-DataProxyIntegrationRuntimeName <String>]
[-DataProxyStagingLinkedServiceName <String>] [-DataProxyStagingPath <String>]
[-MaxParallelExecutionsPerNode <Int32>] [-LicenseType <String>] [-AuthKey <SecureString>] [-Force]
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### ByLinkedIntegrationRuntimeResourceId
Expand All @@ -55,12 +58,12 @@ Set-AzDataFactoryV2IntegrationRuntime [-ResourceGroupName] <String> [-DataFactor
Set-AzDataFactoryV2IntegrationRuntime [-InputObject] <PSIntegrationRuntime> [-Type <String>]
[-Description <String>] [-Location <String>] [-NodeSize <String>] [-NodeCount <Int32>]
[-CatalogServerEndpoint <String>] [-CatalogAdminCredential <PSCredential>] [-CatalogPricingTier <String>]
[-VNetId <String>] [-Subnet <String>] [-PublicIPs <String[]>]
[-SetupScriptContainerSasUri <String>] [-Edition <String>]
[-MaxParallelExecutionsPerNode <Int32>] [-LicenseType <String>] [-DataProxyIntegrationRuntimeName <String>]
[-DataProxyStagingLinkedServiceName <String>] [-DataProxyStagingPath <String>] [-AuthKey <SecureString>] [-Force]
[-VNetId <String>] [-Subnet <String>] [-PublicIPs <String[]>] [-DataFlowComputeType <String>]
[-DataFlowCoreCount <Int32>] [-DataFlowTimeToLive <Int32>] [-SetupScriptContainerSasUri <String>]
[-Edition <String>] [-ExpressCustomSetup <ArrayList>] [-DataProxyIntegrationRuntimeName <String>]
[-DataProxyStagingLinkedServiceName <String>] [-DataProxyStagingPath <String>]
[-MaxParallelExecutionsPerNode <Int32>] [-LicenseType <String>] [-AuthKey <SecureString>] [-Force]
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
[-ExpressCustomSetup <ArrayList>]
```

### ByLinkedIntegrationRuntimeObject
Expand Down Expand Up @@ -217,6 +220,51 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -DataFlowComputeType
Compute type of the data flow cluster which will execute data flow job.
```yaml
Type: System.String
Parameter Sets: ByIntegrationRuntimeName, ByResourceId, ByIntegrationRuntimeObject
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -DataFlowCoreCount
Core count of the data flow cluster which will execute data flow job.
```yaml
Type: System.Nullable`1[System.Int32]
Parameter Sets: ByIntegrationRuntimeName, ByResourceId, ByIntegrationRuntimeObject
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -DataFlowTimeToLive
Time to live (in minutes) setting of the data flow cluster which will execute data flow job.
```yaml
Type: System.Nullable`1[System.Int32]
Parameter Sets: ByIntegrationRuntimeName, ByResourceId, ByIntegrationRuntimeObject
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -DataProxyIntegrationRuntimeName
The Self-Hosted Integration Runtime name which is used as a proxy
Expand Down

0 comments on commit 5247512

Please sign in to comment.