Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DataFactory] Add User Assigned Identity to DataFactory #14672

Merged
merged 5 commits into from
Apr 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 6 additions & 2 deletions src/DataFactory/DataFactory.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2042
# Visual Studio Version 16
VisualStudioVersion = 16.0.31129.286
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataFactoryV2", "DataFactoryV2\DataFactoryV2.csproj", "{26B676D3-E448-4FA5-A23C-C79E7753D280}"
EndProject
Expand Down Expand Up @@ -42,6 +42,10 @@ Global
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU
{6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6BD6B80A-06AF-4B5B-9230-69CCFC6C8D64}.Release|Any CPU.Build.0 = Release|Any CPU
{238C90D1-1EB1-4DFB-A738-4E5ED7B030A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{238C90D1-1EB1-4DFB-A738-4E5ED7B030A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{238C90D1-1EB1-4DFB-A738-4E5ED7B030A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ public void TestUpdateFactoryGlobalParameters()
RunPowerShellTest(_logger, "Test-UpdateFactoryGlobalParameters");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestCreateDataFactoryV2WithUserAssignedIdentity()
{
RunPowerShellTest(_logger, "Test-CreateDataFactoryV2WithUserAssignedIdentity");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestGetNonExistingDataFactoryV2()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,3 +271,31 @@ function Test-CreateDataFactoryV2WithGitHubRepoConfig
}
}

<#
.SYNOPSIS
Creates a data factory with VSTS repo config and then does a Get to verify that both are identical.
#>
function Test-CreateDataFactoryV2WithUserAssignedIdentity
{
$dfname = Get-DataFactoryName
$rgname = Get-ResourceGroupName
$rglocation = Get-ProviderLocation ResourceManagement
$dflocation = Get-ProviderLocation DataFactoryManagement
$userAssignedIdentities = New-Object 'system.collections.generic.dictionary[string,object]'
$userAssignedIdentities.add("/subscriptions/1e42591f-1f0c-4c5a-b7f2-a268f6105ec5/resourcegroups/ADF/providers/Microsoft.ManagedIdentity/userAssignedIdentities/PacoTestUAMI2", @{})

New-AzResourceGroup -Name $rgname -Location $rglocation -Force

try
{
$actual = Set-AzDataFactoryV2 -ResourceGroupName $rgname -Name $dfname -Location $dflocation -Force -UserAssignedIdentity $userAssignedIdentities
$expected = Get-AzDataFactoryV2 -ResourceGroupName $rgname -Name $dfname

ValidateFactoryProperties $expected $actual
}
finally
{
CleanUp $rgname $dfname
}
}

Loading