From 724ead524f1c85a13bfd254516f5590e4561631e Mon Sep 17 00:00:00 2001 From: jikma Date: Fri, 17 Apr 2020 17:32:48 -0700 Subject: [PATCH 1/2] support data flow properties in azure ir --- src/DataFactory/DataFactoryV2/Changelog.md | 1 + src/DataFactory/DataFactoryV2/Constants.cs | 6 ++ ...ureDataFactoryIntegrationRuntimeCommand.cs | 63 ++++++++++++++- .../Models/PSManagedIntegrationRuntime.cs | 6 ++ .../Set-AzDataFactoryV2IntegrationRuntime.md | 79 +++++++++++++++---- 5 files changed, 138 insertions(+), 17 deletions(-) diff --git a/src/DataFactory/DataFactoryV2/Changelog.md b/src/DataFactory/DataFactoryV2/Changelog.md index f2e7b3f0a689..15fb3cde221e 100644 --- a/src/DataFactory/DataFactoryV2/Changelog.md +++ b/src/DataFactory/DataFactoryV2/Changelog.md @@ -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 diff --git a/src/DataFactory/DataFactoryV2/Constants.cs b/src/DataFactory/DataFactoryV2/Constants.cs index 16ddea8081ac..761745502ede 100644 --- a/src/DataFactory/DataFactoryV2/Constants.cs +++ b/src/DataFactory/DataFactoryV2/Constants.cs @@ -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."; diff --git a/src/DataFactory/DataFactoryV2/IntegrationRuntimes/SetAzureDataFactoryIntegrationRuntimeCommand.cs b/src/DataFactory/DataFactoryV2/IntegrationRuntimes/SetAzureDataFactoryIntegrationRuntimeCommand.cs index 0a844e292842..3e369198c5b1 100644 --- a/src/DataFactory/DataFactoryV2/IntegrationRuntimes/SetAzureDataFactoryIntegrationRuntimeCommand.cs +++ b/src/DataFactory/DataFactoryV2/IntegrationRuntimes/SetAzureDataFactoryIntegrationRuntimeCommand.cs @@ -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))] @@ -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, @@ -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)) diff --git a/src/DataFactory/DataFactoryV2/Models/PSManagedIntegrationRuntime.cs b/src/DataFactory/DataFactoryV2/Models/PSManagedIntegrationRuntime.cs index 04225170a1e9..6ecc4313b1a9 100644 --- a/src/DataFactory/DataFactoryV2/Models/PSManagedIntegrationRuntime.cs +++ b/src/DataFactory/DataFactoryV2/Models/PSManagedIntegrationRuntime.cs @@ -62,6 +62,12 @@ public PSManagedIntegrationRuntime( public string[] PublicIPs => ManagedIntegrationRuntime.ComputeProperties?.VNetProperties?.PublicIPs == null ? null : new List(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; diff --git a/src/DataFactory/DataFactoryV2/help/Set-AzDataFactoryV2IntegrationRuntime.md b/src/DataFactory/DataFactoryV2/help/Set-AzDataFactoryV2IntegrationRuntime.md index 8419ea8c8c17..99a58a9b5e60 100644 --- a/src/DataFactory/DataFactoryV2/help/Set-AzDataFactoryV2IntegrationRuntime.md +++ b/src/DataFactory/DataFactoryV2/help/Set-AzDataFactoryV2IntegrationRuntime.md @@ -17,23 +17,26 @@ Updates an integration runtime. Set-AzDataFactoryV2IntegrationRuntime [-ResourceGroupName] [-DataFactoryName] [-Name] [-Type ] [-Description ] [-Location ] [-NodeSize ] [-NodeCount ] [-CatalogServerEndpoint ] [-CatalogAdminCredential ] - [-CatalogPricingTier ] [-VNetId ] [-Subnet ] - [-PublicIPs ] [-SetupScriptContainerSasUri ] - [-Edition ] [-MaxParallelExecutionsPerNode ] [-LicenseType ] [-AuthKey ] - [-DataProxyIntegrationRuntimeName ] [-DataProxyStagingLinkedServiceName ] [-DataProxyStagingPath ] - [-Force] [-DefaultProfile ] [-WhatIf] [-Confirm] [] - [-ExpressCustomSetup ] + [-CatalogPricingTier ] [-VNetId ] [-Subnet ] [-PublicIPs ] + [-DataFlowComputeType ] [-DataFlowCoreCount ] [-DataFlowTimeToLive ] + [-SetupScriptContainerSasUri ] [-Edition ] [-ExpressCustomSetup ] + [-DataProxyIntegrationRuntimeName ] [-DataProxyStagingLinkedServiceName ] + [-DataProxyStagingPath ] [-MaxParallelExecutionsPerNode ] [-LicenseType ] + [-AuthKey ] [-Force] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] ``` ### ByResourceId ``` Set-AzDataFactoryV2IntegrationRuntime [-ResourceId] [-Type ] [-Description ] [-Location ] [-NodeSize ] [-NodeCount ] [-CatalogServerEndpoint ] - [-CatalogAdminCredential ] [-CatalogPricingTier ] [-VNetId ] [-Subnet ] [-PublicIPs ] - [-SetupScriptContainerSasUri ] [-Edition ] [-MaxParallelExecutionsPerNode ] - [-DataProxyIntegrationRuntimeName ] [-DataProxyStagingLinkedServiceName ] [-DataProxyStagingPath ] - [-LicenseType ] [-AuthKey ] [-Force] [-DefaultProfile ] - [-WhatIf] [-Confirm] [] [-ExpressCustomSetup ] + [-CatalogAdminCredential ] [-CatalogPricingTier ] [-VNetId ] [-Subnet ] + [-PublicIPs ] [-DataFlowComputeType ] [-DataFlowCoreCount ] + [-DataFlowTimeToLive ] [-SetupScriptContainerSasUri ] [-Edition ] + [-ExpressCustomSetup ] [-DataProxyIntegrationRuntimeName ] + [-DataProxyStagingLinkedServiceName ] [-DataProxyStagingPath ] + [-MaxParallelExecutionsPerNode ] [-LicenseType ] [-AuthKey ] [-Force] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ### ByLinkedIntegrationRuntimeResourceId @@ -55,12 +58,12 @@ Set-AzDataFactoryV2IntegrationRuntime [-ResourceGroupName] [-DataFactor Set-AzDataFactoryV2IntegrationRuntime [-InputObject] [-Type ] [-Description ] [-Location ] [-NodeSize ] [-NodeCount ] [-CatalogServerEndpoint ] [-CatalogAdminCredential ] [-CatalogPricingTier ] - [-VNetId ] [-Subnet ] [-PublicIPs ] - [-SetupScriptContainerSasUri ] [-Edition ] - [-MaxParallelExecutionsPerNode ] [-LicenseType ] [-DataProxyIntegrationRuntimeName ] - [-DataProxyStagingLinkedServiceName ] [-DataProxyStagingPath ] [-AuthKey ] [-Force] + [-VNetId ] [-Subnet ] [-PublicIPs ] [-DataFlowComputeType ] + [-DataFlowCoreCount ] [-DataFlowTimeToLive ] [-SetupScriptContainerSasUri ] + [-Edition ] [-ExpressCustomSetup ] [-DataProxyIntegrationRuntimeName ] + [-DataProxyStagingLinkedServiceName ] [-DataProxyStagingPath ] + [-MaxParallelExecutionsPerNode ] [-LicenseType ] [-AuthKey ] [-Force] [-DefaultProfile ] [-WhatIf] [-Confirm] [] - [-ExpressCustomSetup ] ``` ### ByLinkedIntegrationRuntimeObject @@ -217,6 +220,50 @@ 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 From aba0a6104430cd121333e10a9227a7a4812b0681 Mon Sep 17 00:00:00 2001 From: jikma Date: Fri, 17 Apr 2020 18:19:04 -0700 Subject: [PATCH 2/2] fix md --- .../DataFactoryV2/help/Set-AzDataFactoryV2IntegrationRuntime.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/DataFactory/DataFactoryV2/help/Set-AzDataFactoryV2IntegrationRuntime.md b/src/DataFactory/DataFactoryV2/help/Set-AzDataFactoryV2IntegrationRuntime.md index 99a58a9b5e60..f951079732bf 100644 --- a/src/DataFactory/DataFactoryV2/help/Set-AzDataFactoryV2IntegrationRuntime.md +++ b/src/DataFactory/DataFactoryV2/help/Set-AzDataFactoryV2IntegrationRuntime.md @@ -263,6 +263,7 @@ 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