Skip to content

Commit d2ff6b1

Browse files
authored
[DataFactory] Support outboundNetworkDependency API and subnetId for Azure-SSIS IR (Azure#15739)
* add new command * add subnetID * add readme * add readme * fix doc * add doc * add senario test * add output * merge * add ut * fix default value * remove field * fix test * address issues * update changelog.md * update example * fix readme * remove change * update doc * fix doc * update doc * rename * rename file * fix test * fix name error * fix markdown
1 parent 7d1138c commit d2ff6b1

18 files changed

+1250
-48
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ public void TestSsisAzureIntegrationRuntime()
5757
RunPowerShellTest(_logger, "Test-SsisAzure-IntegrationRuntime");
5858
}
5959

60+
[Fact]
61+
[Trait(Category.AcceptanceType, Category.CheckIn)]
62+
public void TestSsisAzureIntegrationRuntimeWithSubnetId()
63+
{
64+
RunPowerShellTest(_logger, "Test-Azure-IntegrationRuntime-SubnetId");
65+
}
66+
6067
[Fact(Skip = "New-AzureRMRoleAssignmentWithId and Remove-AzureRmRoleAssignment rely on Resources module. Needs fixed in AzureRM.Resources.ps1.")]
6168
[Trait(Category.AcceptanceType, Category.CheckIn)]
6269
public void TestSharedIntegrationRuntime()

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

Lines changed: 70 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ function Test-SsisAzure-IntegrationRuntime
230230
-Name $irname
231231
Assert-AreEqual $actual.Name $expected.Name
232232

233+
Get-AzDataFactoryV2IntegrationRuntimeOutboundNetworkDependenciesEndpoint -ResourceGroupName $rgname `
234+
-DataFactoryName $dfname `
235+
-Name $irname
236+
233237
Start-AzDataFactoryV2IntegrationRuntime -ResourceId $actual.Id -Force
234238
$status = Get-AzDataFactoryV2IntegrationRuntime -ResourceId $actual.Id -Status
235239
Stop-AzDataFactoryV2IntegrationRuntime -ResourceId $actual.Id -Force
@@ -267,21 +271,85 @@ function Test-Azure-IntegrationRuntime
267271
-Name $dfname `
268272
-Location $dflocation `
269273
-Force
270-
274+
271275
$irname = "test-ManagedElastic-integrationruntime"
272276
$description = "ManagedElastic"
273-
277+
278+
$actual = Set-AzDataFactoryV2IntegrationRuntime -ResourceGroupName $rgname `
279+
-DataFactoryName $dfname `
280+
-Name $irname `
281+
-Type Managed `
282+
-Description $description `
283+
-Force
284+
285+
$expected = Get-AzDataFactoryV2IntegrationRuntime -ResourceGroupName $rgname `
286+
-DataFactoryName $dfname `
287+
-Name $irname
288+
Assert-AreEqual $actual.Name $expected.Name
289+
Get-AzDataFactoryV2IntegrationRuntime -ResourceId $actual.Id -Status
290+
291+
Remove-AzDataFactoryV2IntegrationRuntime -ResourceGroupName $rgname -DataFactoryName $dfname -Name $irname -Force
292+
}
293+
finally
294+
{
295+
CleanUp $rgname $dfname
296+
}
297+
}
298+
299+
<#
300+
.SYNOPSIS
301+
Creates an azure integration runtime with subnetId.
302+
Deletes the created integration runtime at the end.
303+
304+
To record this test, please prepare a subnet, to which the Azure SSIS IR could join.
305+
#>
306+
function Test-Azure-IntegrationRuntime-SubnetId
307+
{
308+
$dfname = Get-DataFactoryName
309+
$rgname = Get-ResourceGroupName
310+
$rglocation = Get-ProviderLocation ResourceManagement
311+
$dflocation = Get-ProviderLocation DataFactoryManagement
312+
313+
New-AzResourceGroup -Name $rgname -Location $rglocation -Force
314+
315+
try
316+
{
317+
Set-AzDataFactoryV2 -ResourceGroupName $rgname `
318+
-Name $dfname `
319+
-Location $dflocation `
320+
-Force
321+
322+
$irname = "test-Azure-SSIS-IR-subnetId"
323+
$description = "Managed SSIS IR"
324+
325+
# Get SubnetId from environment variable.
326+
$IsSubnetIdSet = Test-Path env:SSIS_IR_SUBNETID
327+
if ($IsSubnetIdSet) {
328+
$subnetId = $Env:SSIS_IR_SUBNETID
329+
} else {
330+
$subnetId = "fakeId"
331+
}
332+
274333
$actual = Set-AzDataFactoryV2IntegrationRuntime -ResourceGroupName $rgname `
275334
-DataFactoryName $dfname `
276335
-Name $irname `
277336
-Type Managed `
278337
-Description $description `
338+
-Location $dflocation `
339+
-NodeSize Standard_A4_v2 `
340+
-NodeCount 1 `
341+
-MaxParallelExecutionsPerNode 1 `
342+
-Edition standard `
343+
-subnetId $subnetId `
279344
-Force
280345

281346
$expected = Get-AzDataFactoryV2IntegrationRuntime -ResourceGroupName $rgname `
282347
-DataFactoryName $dfname `
283348
-Name $irname
284349
Assert-AreEqual $actual.Name $expected.Name
350+
if ($IsSubnetIdSet) {
351+
Assert-AreEqual $subnetId $expected.SubnetId
352+
}
285353
Get-AzDataFactoryV2IntegrationRuntime -ResourceId $actual.Id -Status
286354

287355
Remove-AzDataFactoryV2IntegrationRuntime -ResourceGroupName $rgname -DataFactoryName $dfname -Name $irname -Force

src/DataFactory/DataFactoryV2.Test/SessionRecords/Microsoft.Azure.Commands.DataFactoryV2.Test.IntegrationRuntimeTests/TestSsisAzureIntegrationRuntime.json

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,73 @@
348348
"ResponseBody": "{\r\n \"id\": \"/subscriptions/cb715d05-3337-4640-8c43-4f943c50d06e/resourceGroups/ps6306/providers/Microsoft.DataFactory/factories/ps3174/linkedservices/proxy-linkedservice\",\r\n \"name\": \"proxy-linkedservice\",\r\n \"type\": \"Microsoft.DataFactory/factories/linkedservices\",\r\n \"properties\": {\r\n \"type\": \"AzureStorage\",\r\n \"typeProperties\": {\r\n \"connectionString\": \"DefaultEndpointsProtocol=https;AccountName=myaccount;\",\r\n \"encryptedCredential\": \"ew0KICAiVmVyc2lvbiI6ICIyMDE3LTExLTMwIiwNCiAgIlByb3RlY3Rpb25Nb2RlIjogIktleSIsDQogICJTZWNyZXRDb250ZW50VHlwZSI6ICJQbGFpbnRleHQiLA0KICAiQ3JlZGVudGlhbElkIjogIlBTMzE3NF9mOGY5ZTk2Yi1hOGY4LTQ3NTgtYjIzMy01ZTRiMDJkZTdlOTQiDQp9\"\r\n }\r\n },\r\n \"etag\": \"ab000141-0000-0d00-0000-5e0315c40000\"\r\n}",
349349
"StatusCode": 200
350350
},
351-
{
351+
{
352+
"RequestUri": "/subscriptions/cb715d05-3337-4640-8c43-4f943c50d06e/resourceGroups/ps6306/providers/Microsoft.DataFactory/factories/ps3174/integrationRuntimes/ssis-azure-ir/outboundNetworkDependenciesEndpoints?api-version=2018-06-01",
353+
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2I3MTVkMDUtMzMzNy00NjQwLThjNDMtNGY5NDNjNTBkMDZlL3Jlc291cmNlR3JvdXBzL3BzNjMwNi9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFGYWN0b3J5L2ZhY3Rvcmllcy9wczMxNzQvaW50ZWdyYXRpb25SdW50aW1lcy9zc2lzLWF6dXJlLWlyL291dGJvdW5kTmV0d29ya0RlcGVuZGVuY2llc0VuZHBvaW50cz9hcGktdmVyc2lvbj0yMDE4LTA2LTAx",
354+
"RequestMethod": "GET",
355+
"RequestBody": "",
356+
"RequestHeaders": {
357+
"x-ms-client-request-id": [
358+
"92399414-b8c9-44dd-876b-c7305459f28e"
359+
],
360+
"Accept-Language": [
361+
"en-US"
362+
],
363+
"User-Agent": [
364+
"FxVersion/4.6.30321.06",
365+
"OSName/Windows",
366+
"OSVersion/Microsoft.Windows.10.0.19043.",
367+
"Microsoft.Azure.Management.DataFactory.DataFactoryManagementClient/4.22.0.0"
368+
]
369+
},
370+
"ResponseHeaders": {
371+
"Cache-Control": [
372+
"no-cache"
373+
],
374+
"Pragma": [
375+
"no-cache"
376+
],
377+
"Strict-Transport-Security": [
378+
"max-age=31536000; includeSubDomains"
379+
],
380+
"X-Content-Type-Options": [
381+
"nosniff"
382+
],
383+
"Server": [
384+
"Microsoft-IIS/10.0"
385+
],
386+
"X-Powered-By": [
387+
"ASP.NET"
388+
],
389+
"x-ms-ratelimit-remaining-subscription-reads": [
390+
"11999"
391+
],
392+
"x-ms-request-id": [
393+
"318b109d-c684-480e-8f60-1035a9c2dc20"
394+
],
395+
"x-ms-correlation-request-id": [
396+
"318b109d-c684-480e-8f60-1035a9c2dc20"
397+
],
398+
"x-ms-routing-request-id": [
399+
"EASTUS2:20210816T075350Z:318b109d-c684-480e-8f60-1035a9c2dc20"
400+
],
401+
"Date": [
402+
"Mon, 16 Aug 2021 07:53:50 GMT"
403+
],
404+
"Content-Length": [
405+
"809"
406+
],
407+
"Content-Type": [
408+
"application/json; charset=utf-8"
409+
],
410+
"Expires": [
411+
"-1"
412+
]
413+
},
414+
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"category\": \"Azure Data Factory (Management)\",\r\n \"endpoints\": [\r\n {\r\n \"domainName\": \"wu.frontend.clouddatahub.net\",\r\n \"endpointDetails\": [\r\n {\r\n \"port\": 443\r\n }\r\n ]\r\n }\r\n ]\r\n },\r\n {\r\n \"category\": \"Azure Storage (Management)\",\r\n \"endpoints\": [\r\n {\r\n \"domainName\": \"*.blob.core.windows.net\",\r\n \"endpointDetails\": [\r\n {\r\n \"port\": 443\r\n }\r\n ]\r\n },\r\n {\r\n \"domainName\": \"*.table.core.windows.net\",\r\n \"endpointDetails\": [\r\n {\r\n \"port\": 443\r\n }\r\n ]\r\n }\r\n ]\r\n },\r\n {\r\n \"category\": \"Event Hub (Logging)\",\r\n \"endpoints\": [\r\n {\r\n \"domainName\": \"*.servicebus.windows.net\",\r\n \"endpointDetails\": [\r\n {\r\n \"port\": 443\r\n }\r\n ]\r\n }\r\n ]\r\n },\r\n {\r\n \"category\": \"Microsoft Logging service (Internal Use)\",\r\n \"endpoints\": [\r\n {\r\n \"domainName\": \"gcs.prod.monitoring.core.windows.net\",\r\n \"endpointDetails\": [\r\n {\r\n \"port\": 443\r\n }\r\n ]\r\n },\r\n {\r\n \"domainName\": \"prod.warmpath.msftcloudes.com\",\r\n \"endpointDetails\": [\r\n {\r\n \"port\": 443\r\n }\r\n ]\r\n },\r\n {\r\n \"domainName\": \"azurewatsonanalysis-prod.core.windows.net\",\r\n \"endpointDetails\": [\r\n {\r\n \"port\": 443\r\n }\r\n ]\r\n }\r\n ]\r\n }\r\n ]\r\n}",
415+
"StatusCode": 200
416+
},
417+
{
352418
"RequestUri": "/subscriptions/cb715d05-3337-4640-8c43-4f943c50d06e/resourceGroups/ps6306/providers/Microsoft.DataFactory/factories/ps3174/integrationRuntimes/ssis-azure-ir?api-version=2018-06-01",
353419
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvY2I3MTVkMDUtMzMzNy00NjQwLThjNDMtNGY5NDNjNTBkMDZlL3Jlc291cmNlR3JvdXBzL3BzNjMwNi9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFGYWN0b3J5L2ZhY3Rvcmllcy9wczMxNzQvaW50ZWdyYXRpb25SdW50aW1lcy9zc2lzLWF6dXJlLWlyP2FwaS12ZXJzaW9uPTIwMTgtMDYtMDE=",
354420
"RequestMethod": "GET",

0 commit comments

Comments
 (0)