Skip to content

Commit f16ce88

Browse files
authored
Az.DataFactory update to include Global Parameters (#12290)
* Added global parameters to Data Factory * Updated ADF changelog * Updated Doc * Revert "Updated Doc" This reverts commit a7fc37f. * Updated cmdlets doc and bug fix * Updated global parameters parameter name
1 parent ffc760c commit f16ce88

File tree

11 files changed

+670
-8
lines changed

11 files changed

+670
-8
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ public void TestGetDataFactoriesInSubscriptionV2()
3535
RunPowerShellTest(_logger, "Test-GetDataFactoriesInSubscription");
3636
}
3737

38+
[Fact]
39+
[Trait(Category.AcceptanceType, Category.CheckIn)]
40+
public void TestUpdateFactoryGlobalParameters()
41+
{
42+
RunPowerShellTest(_logger, "Test-UpdateFactoryGlobalParameters");
43+
}
44+
3845
[Fact]
3946
[Trait(Category.AcceptanceType, Category.CheckIn)]
4047
public void TestGetNonExistingDataFactoryV2()

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

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,44 @@ function Test-GetNonExistingDataFactory
6363
Assert-ThrowsContains { Get-AzDataFactoryV2 -ResourceGroupName $rgname -Name $dfname } "NotFound"
6464
}
6565

66+
<#
67+
.SYNOPSIS
68+
Gets and updates a Data Factory global parameters object.
69+
#>
70+
function Test-UpdateFactoryGlobalParameters
71+
{
72+
$dfname = Get-DataFactoryName
73+
$rgname = Get-ResourceGroupName
74+
$rglocation = Get-ProviderLocation ResourceManagement
75+
$dflocation = Get-ProviderLocation DataFactoryManagement
76+
77+
New-AzResourceGroup -Name $rgname -Location $rglocation -Force
78+
79+
try
80+
{
81+
$actual = Get-AzDataFactoryV2 -ResourceGroupName $rgname -Name $dfname
82+
83+
if($actual.GlobalParameters -eq $null) {
84+
$actual.GlobalParameters = New-Object 'system.collections.generic.dictionary[string,Microsoft.Azure.Management.DataFactory.Models.GlobalParameterSpecification]'
85+
}
86+
87+
$actual.GlobalParameters.add("paramFromPs", @{ Type="String"; Value="String param from PS"})
88+
89+
$expected = Set-AzDataFactoryV2 -InputObject $actual -Force
90+
91+
ValidateFactoryProperties $expected $actual
92+
ValidateFactoryProperties $expected.GlobalParameters $actual.GlobalParameters
93+
94+
$actual.GlobalParameters.GetEnumerator() | ForEach-Object {
95+
ValidateFactoryProperties $_.Value $expected.GlobalParameters[$_.Key]
96+
}
97+
}
98+
finally
99+
{
100+
CleanUp $rgname $dfname
101+
}
102+
}
103+
66104
<#
67105
.SYNOPSIS
68106
Creates a data factory and then does a Get to verify that both are identical.

0 commit comments

Comments
 (0)