Skip to content

Commit cb7ad31

Browse files
rachelxj-msXuejun Li
andauthored
Fixed Get-AzRoleAssignment BadRequest when scope is '/' [#20323] (#20433)
* Fixed `Get-AzRoleAssignment` BadRequest when scope is '/' [#20323] * check root scope '/' only to fix bad request. * update comment Co-authored-by: Xuejun Li <[email protected]>
1 parent ab30df3 commit cb7ad31

File tree

4 files changed

+208
-187
lines changed

4 files changed

+208
-187
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ function Test-RaDeleteByPSRoleAssignment
9292
{
9393
# Setup
9494
$definitionName = 'Reader'
95-
$principalId = "f2dc21ac-702a-4bde-a4ce-146edf751d81" # Change this if testing in another tenant
95+
$principalId = "3ca07eea-188c-4b0b-988a-ef610a51a316" # Change this if testing in another tenant
9696
$subscription = $(Get-AzContext).Subscription
9797
$scope = '/subscriptions/'+ $subscription[0].Id +'/resourceGroups/PowershellTest'
9898

99-
$expectedMessage = "Succesfully removed role assignment for AD object 'f2dc21ac-702a-4bde-a4ce-146edf751d81' on scope '/subscriptions/4004a9fd-d58e-48dc-aeb2-4a4aec58606f/resourceGroups/PowershellTest' with role definition 'Reader'"
99+
$expectedMessage = "Succesfully removed role assignment for AD object '3ca07eea-188c-4b0b-988a-ef610a51a316' on scope '/subscriptions/" + $subscription[0].Id + "/resourceGroups/PowershellTest' with role definition 'Reader'"
100100

101101
# Test
102102
$newAssignment = New-AzRoleAssignmentWithId -ObjectId $principalId -RoleDefinitionName $definitionName -Scope $scope -RoleAssignmentId 305df7f7-c560-4577-8f38-257fdfa1f93e

0 commit comments

Comments
 (0)