Skip to content

Commit 6cf9281

Browse files
aim-for-betterZhenyu Zhou
andauthored
[HDInsight] Add three parameters to support relay outbound and private link and custom Ambari DB (#13413)
* Support Relay Outbound and Private Link * Support Custom Ambari DB as metastore * Fix output type of Restar-AzHDInsightHosts and remove breaking change exception * Fix output issue of Restart-AzHDInsightHosts and update help doc Co-authored-by: Zhenyu Zhou <[email protected]>
1 parent be509a6 commit 6cf9281

23 files changed

+7349
-4198
lines changed

src/HDInsight/HDInsight.Test/HDInsight.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<ItemGroup>
1414
<PackageReference Include="Microsoft.Azure.KeyVault" Version="3.0.5" />
15-
<PackageReference Include="Microsoft.Azure.Management.HDInsight" Version="5.6.0" />
15+
<PackageReference Include="Microsoft.Azure.Management.HDInsight" Version="6.0.0" />
1616
<PackageReference Include="Microsoft.Azure.Management.HDInsight.Job" Version="2.0.7" />
1717
<PackageReference Include="Microsoft.Azure.Management.KeyVault" Version="3.1.0-preview.2" />
1818
<PackageReference Include="Microsoft.Azure.Management.ManagedServiceIdentity" Version="0.11.0" />

src/HDInsight/HDInsight.Test/ScenarioTests/HDInsightClusterTests.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,19 @@ public void TestCreateClusterWithKafkaRestProxy()
7777
{
7878
TestController.NewInstance.RunPowerShellTest(_logger, "Test-CreateClusterWithKafkaRestProxy");
7979
}
80+
81+
[Fact]
82+
[Trait(Category.AcceptanceType, Category.CheckIn)]
83+
public void TestCreateClusterWithRelayOutoundAndPrivateLink()
84+
{
85+
TestController.NewInstance.RunPowerShellTest(_logger, "Test-CreateClusterWithRelayOutoundAndPrivateLink");
86+
}
87+
88+
[Fact]
89+
[Trait(Category.AcceptanceType, Category.CheckIn)]
90+
public void TestCreateClusterWithCustomAmbariDatabase()
91+
{
92+
TestController.NewInstance.RunPowerShellTest(_logger, "Test-CreateClusterWithCustomAmbariDatabase");
93+
}
8094
}
8195
}

src/HDInsight/HDInsight.Test/ScenarioTests/HDInsightClusterTests.ps1

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,3 +275,82 @@ function Test-CreateClusterWithKafkaRestProxy{
275275
Remove-AzResourceGroup -ResourceGroupName $cluster.ResourceGroup
276276
}
277277
}
278+
279+
<#
280+
.SYNOPSIS
281+
Test Create Azure HDInsight Cluster with Relay Outbound and Private Link
282+
#>
283+
284+
function Test-CreateClusterWithRelayOutoundAndPrivateLink{
285+
286+
# Create some resources that will be used throughout test
287+
try
288+
{
289+
# prepare parameter for creating parameter
290+
$params= Prepare-ClusterCreateParameter -location "South Central US"
291+
292+
# Private Link requires vnet has firewall, this is difficult to create dynamically, just hardcode here
293+
$vnetId="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/fakevnet"
294+
$subnetName="default"
295+
296+
# create cluster
297+
$cluster = New-AzHDInsightCluster -Location $params.location -ResourceGroupName $params.resourceGroupName `
298+
-ClusterName $params.clusterName -ClusterSizeInNodes $params.clusterSizeInNodes -ClusterType $params.clusterType `
299+
-StorageAccountResourceId $params.storageAccountResourceId -StorageAccountKey $params.storageAccountKey `
300+
-HttpCredential $params.httpCredential -SshCredential $params.sshCredential `
301+
-MinSupportedTlsVersion $params.minSupportedTlsVersion `
302+
-VirtualNetworkId $vnetId -SubnetName $subnetName -Version 3.6 `
303+
-ResourceProviderConnection Outbound -PrivateLink Enabled
304+
305+
Assert-AreEqual $cluster.NetworkProperties.ResourceProviderConnection Outbound
306+
Assert-AreEqual $cluster.NetworkProperties.PrivateLink Enabled
307+
308+
}
309+
finally
310+
{
311+
# Delete cluster and resource group
312+
Remove-AzHDInsightCluster -ClusterName $cluster.Name
313+
Remove-AzResourceGroup -ResourceGroupName $cluster.ResourceGroup
314+
}
315+
}
316+
317+
<#
318+
.SYNOPSIS
319+
Test Create Azure HDInsight Cluster with custom ambari database
320+
#>
321+
322+
function Test-CreateClusterWithCustomAmbariDatabase{
323+
324+
# Create some resources that will be used throughout test
325+
try
326+
{
327+
# prepare parameter for creating parameter
328+
$params= Prepare-ClusterCreateParameter -location "South Central US"
329+
330+
# prepare custom ambari database
331+
$databaseUserName="databaseuser"
332+
$databasePassword="xxxxxxx"
333+
$databasePassword=ConvertTo-SecureString $databasePassword -AsPlainText -Force
334+
$sqlserverCredential=New-Object System.Management.Automation.PSCredential($databaseUserName, $databasePassword)
335+
$sqlserver="yoursqlserver.database.windows.net"
336+
$database="yourdatabase"
337+
$config=New-AzHDInsightClusterConfig
338+
339+
# create cluster
340+
$cluster = New-AzHDInsightCluster -Location $params.location -ResourceGroupName $params.resourceGroupName `
341+
-ClusterName $params.clusterName -ClusterSizeInNodes $params.clusterSizeInNodes -ClusterType $params.clusterType `
342+
-StorageAccountResourceId $params.storageAccountResourceId -StorageAccountKey $params.storageAccountKey `
343+
-HttpCredential $params.httpCredential -SshCredential $params.sshCredential `
344+
-MinSupportedTlsVersion $params.minSupportedTlsVersion `
345+
-AmbariDatabase $config.AmbariDatabase
346+
347+
Assert-NotNull $cluster
348+
349+
}
350+
finally
351+
{
352+
# Delete cluster and resource group
353+
Remove-AzHDInsightCluster -ClusterName $cluster.Name
354+
Remove-AzResourceGroup -ResourceGroupName $cluster.ResourceGroup
355+
}
356+
}

0 commit comments

Comments
 (0)