Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Generated from 066ee2e6bc386df50ea15da7d750d78a3287cb54
Update afterscript
  • Loading branch information
SDK Automation committed Aug 6, 2020
commit 93f5c90e4d3c01a5bf724790ab8f1f0e4da15f9c
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
<PackageId>Microsoft.Azure.Management.HDInsight</PackageId>
<Description>Azure HDInsight Management SDK Library</Description>
<AssemblyName>Microsoft.Azure.Management.HDInsight</AssemblyName>
<Version>5.4.0</Version>
<Version>5.5.0</Version>
<PackageTags>Microsoft Azure HDInsight Management;HDInsight;HDInsight Management</PackageTags>
<PackageReleaseNotes>
<![CDATA[
This release adds two features:
- Support to list the hosts of the cluster.
- Support to restart specific hosts.
This release supports three features:
- Support to create cluster with private link feature.
- Support to create cluster with encryption in transit feature.
- Support customer to update autoscale configuration
]]>
</PackageReleaseNotes>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
[assembly: AssemblyTitle("Microsoft Azure HDInsight Management Library")]
[assembly: AssemblyDescription("Provides management functionality for Microsoft Azure HDInsight.")]
[assembly: AssemblyVersion("5.0.0.0")]
[assembly: AssemblyFileVersion("5.4.0.0")]
[assembly: AssemblyFileVersion("5.5.0.0")]

[assembly: InternalsVisibleTo("Microsoft.Azure.Management.HDInsight.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.Network" Version="20.0.2-preview" />
<PackageReference Include="WindowsAzure.Storage" Version="8.1.4" />
<PackageReference Include="Microsoft.Azure.KeyVault" Version="3.0.2" />
<PackageReference Include="Microsoft.Azure.Management.Authorization" Version="2.11.0-preview" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Microsoft.Azure.Management.HDInsight.Models;
using Microsoft.Azure.Management.KeyVault.Models;
using Microsoft.Azure.Management.Storage.Models;
using Microsoft.Rest;
using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -653,5 +654,92 @@ public void TestCreateClusterWithTLS12()
Assert.Equal("1.2", cluster.Properties.MinSupportedTlsVersion);
ValidateCluster(clusterName, createParams, cluster);
}

[Fact]
public void TestCreateClusterWithPrivateLink()
{
TestInitialize();

string clusterName = TestUtilities.GenerateName("hdisdk-privatelink");
var createParams = CommonData.PrepareClusterCreateParamsForWasb();
createParams.Location = "South Central US";

var networkSetting = new NetworkSettings(PublicNetworkAccess.OutboundOnly, OutboundOnlyPublicNetworkAccessType.PublicLoadBalancer);
createParams.Properties.NetworkSettings = networkSetting;

//Create Virturl Network
string virtualNetworkName= TestUtilities.GenerateName("hdisdkvnet");
var vnet = CreateVnetForPrivateLink(createParams.Location, virtualNetworkName);

foreach (var role in createParams.Properties.ComputeProfile.Roles)
{
role.VirtualNetworkProfile = new VirtualNetworkProfile(vnet.Id, vnet.Subnets.First().Id);
}

var cluster = HDInsightClient.Clusters.Create(CommonData.ResourceGroupName, clusterName, createParams);

var result = HDInsightClient.Clusters.Get(CommonData.ResourceGroupName, clusterName);
ValidateCluster(clusterName, createParams, result);
}

[Fact]
public void TestCreateClusterWithEncryptionInTransit()
{
TestInitialize();

string clusterName = TestUtilities.GenerateName("hdisdk-encryption");
var createParams = CommonData.PrepareClusterCreateParamsForWasb();
createParams.Location = "South Central US";
createParams.Properties.EncryptionInTransitProperties = new EncryptionInTransitProperties
{
IsEncryptionInTransitEnabled = true
};

var cluster = HDInsightClient.Clusters.Create(CommonData.ResourceGroupName, clusterName, createParams);

var result = HDInsightClient.Clusters.Get(CommonData.ResourceGroupName, clusterName);
ValidateCluster(clusterName, createParams, result);
}

[Fact]
public void TestUpdateAutoScaleConfiguration()
{
TestInitialize();

//create a cluster without autoscale config
string clusterName = TestUtilities.GenerateName("hdisdk-updateautoscale");
var createParams = CommonData.PrepareClusterCreateParamsForWasb();
createParams.Location = "South Central US";

var cluster = HDInsightClient.Clusters.Create(CommonData.ResourceGroupName, clusterName, createParams);
ValidateCluster(clusterName, createParams, cluster);

var clusterWithoutAutoscale = HDInsightClient.Clusters.Get(CommonData.ResourceGroupName, clusterName);
Assert.Null(cluster.Properties.ComputeProfile.Roles.First(role => role.Name.Equals("workernode")).AutoscaleConfiguration);

// enable autoscale
AutoscaleConfigurationUpdateParameter loadBasedAutoScaleConfig = new AutoscaleConfigurationUpdateParameter
{
Autoscale = new Autoscale
{
Capacity = new AutoscaleCapacity
{
MinInstanceCount = 3,
MaxInstanceCount = 4
}
}
};
HDInsightClient.Clusters.UpdateAutoScaleConfiguration(CommonData.ResourceGroupName, clusterName, loadBasedAutoScaleConfig);
var clusterEnabledAutoScale = HDInsightClient.Clusters.Get(CommonData.ResourceGroupName, clusterName);

ValidateAutoScaleConfig(loadBasedAutoScaleConfig.Autoscale, clusterEnabledAutoScale.Properties.ComputeProfile.Roles.First(role => role.Name.Equals("workernode")).AutoscaleConfiguration);

// disable autoscale
loadBasedAutoScaleConfig.Autoscale = null;
HDInsightClient.Clusters.UpdateAutoScaleConfiguration(CommonData.ResourceGroupName, clusterName, loadBasedAutoScaleConfig);
var clusterDisabledAutoScale = HDInsightClient.Clusters.Get(CommonData.ResourceGroupName, clusterName);

Assert.Null(clusterDisabledAutoScale.Properties.ComputeProfile.Roles.First(role => role.Name.Equals("workernode")).AutoscaleConfiguration);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Microsoft.Azure.Management.HDInsight;
using Microsoft.Azure.Management.KeyVault.Models;
using Microsoft.Azure.Management.ManagedServiceIdentity.Models;
using Microsoft.Azure.Management.Network.Models;
using Microsoft.Azure.Test.HttpRecorder;
using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
using System;
Expand Down Expand Up @@ -39,6 +40,7 @@ internal virtual void TestInitialize([System.Runtime.CompilerServices.CallerMemb
HDInsightManagementHelper.RegisterSubscriptionForResource("Microsoft.DataLakeStore");
HDInsightManagementHelper.RegisterSubscriptionForResource("Microsoft.ManagedIdentity");
HDInsightManagementHelper.RegisterSubscriptionForResource("Microsoft.KeyVault");
HDInsightManagementHelper.RegisterSubscriptionForResource("Microsoft.Network");

this.CreateResources();

Expand Down Expand Up @@ -111,6 +113,11 @@ internal Identity CreateMsi(string msiName)
return HDInsightManagementHelper.CreateManagedIdentity(CommonData.ResourceGroupName, msiName, CommonData.Location);
}

internal VirtualNetwork CreateVnetForPrivateLink(string location, string virtualNetworkName, string subnetName = "default")
{
return HDInsightManagementHelper.CreateVirtualNetworkWithSubnet(CommonData.ResourceGroupName, location, virtualNetworkName, subnetName, false, false);
}

#region Dispose

private bool disposed = false;
Expand Down
Loading