Skip to content

Commit

Permalink
Revert "Pass principal type during role assignment put operations" (#…
Browse files Browse the repository at this point in the history
…14122)

* Revert "Pass principal type during role assignment put operations (#13590)"

This reverts commit 3d473e4.

* changelog

* update changelog

Co-authored-by: Daniel Orozco <64658732+dagoroz@users.noreply.github.com>
Co-authored-by: Daniel Orozco <Daniel.Orozco@microsoft.com>
  • Loading branch information
3 people authored Feb 4, 2021
1 parent 99ade36 commit 3ecb37d
Show file tree
Hide file tree
Showing 19 changed files with 15,321 additions and 25,775 deletions.
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

0 comments on commit 3ecb37d

Please sign in to comment.