Skip to content

Commit 8d9d757

Browse files
PacodelBethanyZhou
andauthored
[DataFactory] Add User Assigned Identity to DataFactory (#14672)
* DataFactoryUAMI * Added descriptions * Change to singular * Update src/DataFactory/DataFactoryV2/Changelog.md Co-authored-by: Beisi Zhou <[email protected]>
1 parent cde7307 commit 8d9d757

File tree

10 files changed

+688
-3
lines changed

10 files changed

+688
-3
lines changed

src/DataFactory/DataFactory.sln

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
2-
# Visual Studio 15
3-
VisualStudioVersion = 15.0.27703.2042
2+
# Visual Studio Version 16
3+
VisualStudioVersion = 16.0.31129.286
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataFactoryV2", "DataFactoryV2\DataFactoryV2.csproj", "{26B676D3-E448-4FA5-A23C-C79E7753D280}"
66
EndProject
@@ -42,6 +42,10 @@ Global
4242
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
4343
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
4444
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU
45+
{6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
46+
{6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Debug|Any CPU.Build.0 = Debug|Any CPU
47+
{6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Release|Any CPU.ActiveCfg = Release|Any CPU
48+
{6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Release|Any CPU.Build.0 = Release|Any CPU
4549
{238C90D1-1EB1-4DFB-A738-4E5ED7B030A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4650
{238C90D1-1EB1-4DFB-A738-4E5ED7B030A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
4751
{238C90D1-1EB1-4DFB-A738-4E5ED7B030A4}.Release|Any CPU.ActiveCfg = Release|Any CPU

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ public void TestUpdateFactoryGlobalParameters()
4242
RunPowerShellTest(_logger, "Test-UpdateFactoryGlobalParameters");
4343
}
4444

45+
[Fact]
46+
[Trait(Category.AcceptanceType, Category.CheckIn)]
47+
public void TestCreateDataFactoryV2WithUserAssignedIdentity()
48+
{
49+
RunPowerShellTest(_logger, "Test-CreateDataFactoryV2WithUserAssignedIdentity");
50+
}
51+
4552
[Fact]
4653
[Trait(Category.AcceptanceType, Category.CheckIn)]
4754
public void TestGetNonExistingDataFactoryV2()

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,3 +271,31 @@ function Test-CreateDataFactoryV2WithGitHubRepoConfig
271271
}
272272
}
273273

274+
<#
275+
.SYNOPSIS
276+
Creates a data factory with VSTS repo config and then does a Get to verify that both are identical.
277+
#>
278+
function Test-CreateDataFactoryV2WithUserAssignedIdentity
279+
{
280+
$dfname = Get-DataFactoryName
281+
$rgname = Get-ResourceGroupName
282+
$rglocation = Get-ProviderLocation ResourceManagement
283+
$dflocation = Get-ProviderLocation DataFactoryManagement
284+
$userAssignedIdentities = New-Object 'system.collections.generic.dictionary[string,object]'
285+
$userAssignedIdentities.add("/subscriptions/1e42591f-1f0c-4c5a-b7f2-a268f6105ec5/resourcegroups/ADF/providers/Microsoft.ManagedIdentity/userAssignedIdentities/PacoTestUAMI2", @{})
286+
287+
New-AzResourceGroup -Name $rgname -Location $rglocation -Force
288+
289+
try
290+
{
291+
$actual = Set-AzDataFactoryV2 -ResourceGroupName $rgname -Name $dfname -Location $dflocation -Force -UserAssignedIdentity $userAssignedIdentities
292+
$expected = Get-AzDataFactoryV2 -ResourceGroupName $rgname -Name $dfname
293+
294+
ValidateFactoryProperties $expected $actual
295+
}
296+
finally
297+
{
298+
CleanUp $rgname $dfname
299+
}
300+
}
301+

0 commit comments

Comments
 (0)