Skip to content

Commit 3ecb37d

Browse files
VeryEarlydagoroz
andauthored
Revert "Pass principal type during role assignment put operations" (#14122)
* Revert "Pass principal type during role assignment put operations (#13590)" This reverts commit 3d473e4. * changelog * update changelog Co-authored-by: Daniel Orozco <[email protected]> Co-authored-by: Daniel Orozco <[email protected]>
1 parent 99ade36 commit 3ecb37d

File tree

19 files changed

+15321
-25775
lines changed

19 files changed

+15321
-25775
lines changed

src/Resources/Resources.Test/ScenarioTests/ActiveDirectoryTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ public void TestNewADServicePrincipalWithoutApp()
587587
TestRunner.RunTestScript("Test-NewADServicePrincipalWithoutApp");
588588
}
589589

590-
[Fact(Skip = "Test is not deterministic, only works on record mode")]
590+
[Fact]
591591
[Trait(Category.AcceptanceType, Category.CheckIn)]
592592
public void TestNewADServicePrincipalWithReaderRole()
593593
{
@@ -607,8 +607,8 @@ public void TestCreateDeleteAppCredentials()
607607
{
608608
TestRunner.RunTestScript("Test-CreateDeleteAppCredentials");
609609
}
610-
611-
[Fact(Skip = "Test is not deterministic, only works on record mode")]
610+
611+
[Fact]
612612
[Trait(Category.AcceptanceType, Category.CheckIn)]
613613
public void TestCreateDeleteSpCredentials()
614614
{
@@ -633,7 +633,7 @@ public void TestCreateDeleteSpCredentials()
633633
MethodBase.GetCurrentMethod().Name);
634634
}
635635

636-
[Fact(Skip = "Test is not deterministic, only works on record mode")]
636+
[Fact]
637637
[Trait(Category.AcceptanceType, Category.CheckIn)]
638638
public void TestNewADServicePrincipal()
639639
{

src/Resources/Resources.Test/ScenarioTests/RoleAssignmentTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public void RaGetByUPNWithExpandPrincipalGroups()
174174
TestRunner.RunTestScript("Test-RaGetByUPNWithExpandPrincipalGroups");
175175
}
176176

177-
[Fact(Skip = "Breaking PR in 2 parts needs this test to be disabled temporarily")]
177+
[Fact]
178178
[Trait(Category.AcceptanceType, Category.CheckIn)]
179179
public void RaCreatedBySP()
180180
{

src/Resources/Resources.Test/ScenarioTests/RoleAssignmentTests.ps1

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -707,19 +707,17 @@ function Test-RaCreatedBySP
707707
#Setup
708708
# Conect to azure with SP
709709
# If you need to re-record replace this setup
710-
$passwd = ConvertTo-SecureString 'password' -AsPlainText -Force
711-
$pscredential = New-Object System.Management.Automation.PSCredential('33333333-3333-3333-3333-333333333333' , $passwd)
712-
$tenantId = '33333333-3333-3333-3333-333333333333'
713-
$subId = '33333333-3333-3333-3333-333333333333'
714-
Connect-AzAccount -ServicePrincipal -Credential $pscredential -Tenant $tenantId -Subscription $subId
710+
$passwd = ConvertTo-SecureString 'MCg1SVb3MX' -AsPlainText -Force
711+
$pscredential = New-Object System.Management.Automation.PSCredential('c82180ed-2f4b-4cb2-965f-ec5088751710' , $passwd)
712+
$tenantId = '1462fd46-afe5-491b-a340-31ebae81d1ce'
713+
Connect-AzAccount -ServicePrincipal -Credential $pscredential -Tenant $tenantId
715714

716715
# Create role assignment
717-
$testUser = '11b1042e-d5b6-4f65-b308-d69565f16f1e'
718-
$userUPN = '[email protected]'
716+
$testUser = '1d2121a7-1943-4c7a-a872-b1b2069db55a'
719717
$data = New-AzRoleAssignmentWithId `
720-
-SignInName $userUPN `
718+
-ObjectId $testUser `
721719
-RoleDefinitionName 'Contributor' `
722-
-Scope '/subscriptions/33333333-3333-3333-3333-333333333333/resourceGroups/contoso_rg' `
720+
-Scope '/subscriptions/3e123c33-5ffc-400f-a9f8-a073bf35f8ca/resourceGroups/daorozco_bug_repro' `
723721
-RoleAssignmentId f0f113bd-7ff9-4eb6-b949-5de18d1b38ca
724722

725723
Assert-NotNull $data
@@ -759,9 +757,9 @@ Create role assignment with v2 conditions
759757
#>
760758
function Test-RaWithV2Conditions{
761759
#Given
762-
$RoleDefinitionId = "0353ee0a-19ae-4380-ba3d-d54767c75d5b"
763-
$PrincipalId = "37f3094a-d6e2-48cf-849e-cfa8546088ee"
764-
$Scope = '/subscriptions/ba90acaf-20c8-48bc-a73d-8643dbe0fee6/resourceGroups/contoso_rg'
760+
$RoleDefinitionId = "acdd72a7-3385-48ef-bd42-f606fba81ae7"
761+
$PrincipalId = "01072e9b-c4a1-4246-a756-031b529bbf66"
762+
$Scope = '/subscriptions/4e5329a6-39ce-4e13-b12e-11b30f015986/resourceGroups/contoso_rg'
765763
$Description = "This test should not fail"
766764
$Condition = "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:Name] StringEqualsIgnoreCase 'foo_storage_container'"
767765
$ConditionVersion = "2.0"
@@ -796,9 +794,9 @@ Create role assignment with v2 conditions
796794
#>
797795
function Test-RaWithV2ConditionsOnly{
798796
#Given
799-
$RoleDefinitionId = "0353ee0a-19ae-4380-ba3d-d54767c75d5b"
800-
$PrincipalId = "37f3094a-d6e2-48cf-849e-cfa8546088ee"
801-
$Scope = '/subscriptions/ba90acaf-20c8-48bc-a73d-8643dbe0fee6/resourceGroups/contoso_rg'
797+
$RoleDefinitionId = "acdd72a7-3385-48ef-bd42-f606fba81ae7"
798+
$PrincipalId = "01072e9b-c4a1-4246-a756-031b529bbf66"
799+
$Scope = '/subscriptions/4e5329a6-39ce-4e13-b12e-11b30f015986/resourceGroups/contoso_rg'
802800
$Description = "This test should not fail"
803801
$Condition = "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:Name] StringEqualsIgnoreCase 'foo_storage_container'"
804802

@@ -857,9 +855,9 @@ update role assignment with v2 conditions
857855
function Test-UpdateRa{
858856

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

src/Resources/Resources.Test/SessionRecords/Microsoft.Azure.Commands.Resources.Test.ScenarioTests.RoleAssignmentTests/RaById.json

Lines changed: 1945 additions & 3172 deletions
Large diffs are not rendered by default.

src/Resources/Resources.Test/SessionRecords/Microsoft.Azure.Commands.Resources.Test.ScenarioTests.RoleAssignmentTests/RaByResource.json

Lines changed: 1573 additions & 3244 deletions
Large diffs are not rendered by default.

src/Resources/Resources.Test/SessionRecords/Microsoft.Azure.Commands.Resources.Test.ScenarioTests.RoleAssignmentTests/RaByResourceGroup.json

Lines changed: 1641 additions & 3209 deletions
Large diffs are not rendered by default.

src/Resources/Resources.Test/SessionRecords/Microsoft.Azure.Commands.Resources.Test.ScenarioTests.RoleAssignmentTests/RaByScope.json

Lines changed: 1247 additions & 1889 deletions
Large diffs are not rendered by default.

src/Resources/Resources.Test/SessionRecords/Microsoft.Azure.Commands.Resources.Test.ScenarioTests.RoleAssignmentTests/RaDelegation.json

Lines changed: 1268 additions & 1886 deletions
Large diffs are not rendered by default.

src/Resources/Resources.Test/SessionRecords/Microsoft.Azure.Commands.Resources.Test.ScenarioTests.RoleAssignmentTests/RaDeleteByPSRoleAssignment.json

Lines changed: 1855 additions & 3104 deletions
Large diffs are not rendered by default.

src/Resources/Resources.Test/SessionRecords/Microsoft.Azure.Commands.Resources.Test.ScenarioTests.RoleAssignmentTests/RaDeletionByScope.json

Lines changed: 1855 additions & 3104 deletions
Large diffs are not rendered by default.

src/Resources/Resources.Test/SessionRecords/Microsoft.Azure.Commands.Resources.Test.ScenarioTests.RoleAssignmentTests/RaDeletionByScopeAtRootScope.json

Lines changed: 1254 additions & 1872 deletions
Large diffs are not rendered by default.

src/Resources/Resources.Test/SessionRecords/Microsoft.Azure.Commands.Resources.Test.ScenarioTests.RoleAssignmentTests/RaGetByScope.json

Lines changed: 2252 additions & 3498 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)