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

Revert "Pass principal type during role assignment put operations" #14122

Merged
merged 3 commits into from
Feb 4, 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
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ public void TestNewADServicePrincipalWithoutApp()
TestRunner.RunTestScript("Test-NewADServicePrincipalWithoutApp");
}

[Fact(Skip = "Test is not deterministic, only works on record mode")]
[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewADServicePrincipalWithReaderRole()
{
Expand All @@ -607,8 +607,8 @@ public void TestCreateDeleteAppCredentials()
{
TestRunner.RunTestScript("Test-CreateDeleteAppCredentials");
}

[Fact(Skip = "Test is not deterministic, only works on record mode")]
[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestCreateDeleteSpCredentials()
{
Expand All @@ -633,7 +633,7 @@ public void TestCreateDeleteSpCredentials()
MethodBase.GetCurrentMethod().Name);
}

[Fact(Skip = "Test is not deterministic, only works on record mode")]
[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNewADServicePrincipal()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public void RaGetByUPNWithExpandPrincipalGroups()
TestRunner.RunTestScript("Test-RaGetByUPNWithExpandPrincipalGroups");
}

[Fact(Skip = "Breaking PR in 2 parts needs this test to be disabled temporarily")]
[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void RaCreatedBySP()
{
Expand Down
34 changes: 16 additions & 18 deletions src/Resources/Resources.Test/ScenarioTests/RoleAssignmentTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -707,19 +707,17 @@ function Test-RaCreatedBySP
#Setup
# Conect to azure with SP
# If you need to re-record replace this setup
$passwd = ConvertTo-SecureString 'password' -AsPlainText -Force
$pscredential = New-Object System.Management.Automation.PSCredential('33333333-3333-3333-3333-333333333333' , $passwd)
$tenantId = '33333333-3333-3333-3333-333333333333'
$subId = '33333333-3333-3333-3333-333333333333'
Connect-AzAccount -ServicePrincipal -Credential $pscredential -Tenant $tenantId -Subscription $subId
$passwd = ConvertTo-SecureString 'MCg1SVb3MX' -AsPlainText -Force
$pscredential = New-Object System.Management.Automation.PSCredential('c82180ed-2f4b-4cb2-965f-ec5088751710' , $passwd)
$tenantId = '1462fd46-afe5-491b-a340-31ebae81d1ce'
Connect-AzAccount -ServicePrincipal -Credential $pscredential -Tenant $tenantId

# Create role assignment
$testUser = '11b1042e-d5b6-4f65-b308-d69565f16f1e'
$userUPN = 'daorozco_testuser@rbacclitest.onmicrosoft.com'
$testUser = '1d2121a7-1943-4c7a-a872-b1b2069db55a'
$data = New-AzRoleAssignmentWithId `
-SignInName $userUPN `
-ObjectId $testUser `
-RoleDefinitionName 'Contributor' `
-Scope '/subscriptions/33333333-3333-3333-3333-333333333333/resourceGroups/contoso_rg' `
-Scope '/subscriptions/3e123c33-5ffc-400f-a9f8-a073bf35f8ca/resourceGroups/daorozco_bug_repro' `
-RoleAssignmentId f0f113bd-7ff9-4eb6-b949-5de18d1b38ca

Assert-NotNull $data
Expand Down Expand Up @@ -759,9 +757,9 @@ Create role assignment with v2 conditions
#>
function Test-RaWithV2Conditions{
#Given
$RoleDefinitionId = "0353ee0a-19ae-4380-ba3d-d54767c75d5b"
$PrincipalId = "37f3094a-d6e2-48cf-849e-cfa8546088ee"
$Scope = '/subscriptions/ba90acaf-20c8-48bc-a73d-8643dbe0fee6/resourceGroups/contoso_rg'
$RoleDefinitionId = "acdd72a7-3385-48ef-bd42-f606fba81ae7"
$PrincipalId = "01072e9b-c4a1-4246-a756-031b529bbf66"
$Scope = '/subscriptions/4e5329a6-39ce-4e13-b12e-11b30f015986/resourceGroups/contoso_rg'
$Description = "This test should not fail"
$Condition = "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:Name] StringEqualsIgnoreCase 'foo_storage_container'"
$ConditionVersion = "2.0"
Expand Down Expand Up @@ -796,9 +794,9 @@ Create role assignment with v2 conditions
#>
function Test-RaWithV2ConditionsOnly{
#Given
$RoleDefinitionId = "0353ee0a-19ae-4380-ba3d-d54767c75d5b"
$PrincipalId = "37f3094a-d6e2-48cf-849e-cfa8546088ee"
$Scope = '/subscriptions/ba90acaf-20c8-48bc-a73d-8643dbe0fee6/resourceGroups/contoso_rg'
$RoleDefinitionId = "acdd72a7-3385-48ef-bd42-f606fba81ae7"
$PrincipalId = "01072e9b-c4a1-4246-a756-031b529bbf66"
$Scope = '/subscriptions/4e5329a6-39ce-4e13-b12e-11b30f015986/resourceGroups/contoso_rg'
$Description = "This test should not fail"
$Condition = "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:Name] StringEqualsIgnoreCase 'foo_storage_container'"

Expand Down Expand Up @@ -857,9 +855,9 @@ update role assignment with v2 conditions
function Test-UpdateRa{

# Given
$RoleDefinitionId = "0353ee0a-19ae-4380-ba3d-d54767c75d5b"
$PrincipalId = "37f3094a-d6e2-48cf-849e-cfa8546088ee"
$Scope = '/subscriptions/ba90acaf-20c8-48bc-a73d-8643dbe0fee6/resourceGroups/contoso_rg'
$RoleDefinitionId = "acdd72a7-3385-48ef-bd42-f606fba81ae7"
$PrincipalId = "01072e9b-c4a1-4246-a756-031b529bbf66"
$Scope = '/subscriptions/4e5329a6-39ce-4e13-b12e-11b30f015986/resourceGroups/contoso_rg'
$Description1 = "This test should not fail"
$Condition1 = "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:Name] StringEqualsIgnoreCase 'foo_storage_container'"
$ConditionVersion = "2.0"
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading