Skip to content

Commit 10c4b10

Browse files
authored
[Az.Resources] Reverted feature reimplementation (#23058)
* Fix Possible error when subscription is null in Get-AzRoleAssignment (#22776) * [Az.Resources] Fix unexplicable error message when subscription and scope are both null. (#22730) * Fix unexplicate error message when subscription and scope are both null * Delete unnecessary namespace * Delete unnecessary namespace * Update ChangeLog * Resolve comments * Resolve Comments * reimplement reverted code * ci: add Azure Static Web Apps workflow file on-behalf-of: @Azure [email protected] * Revert "ci: add Azure Static Web Apps workflow file " This reverts commit 62202e5df34080232f65ac5d57ccf7761bf2abc0. * [Az.Resources] Fix unexplicable error message when subscription and scope are both null. (#22730) * Fix unexplicate error message when subscription and scope are both null * Delete unnecessary namespace * Delete unnecessary namespace * Update ChangeLog * Resolve comments * Resolve Comments * reimplement reverted code * record tests fialed
1 parent 5b2fb61 commit 10c4b10

File tree

14 files changed

+410
-371
lines changed

14 files changed

+410
-371
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -482,23 +482,22 @@ Tests verifies creation and validation of RoleAssignment properties for not null
482482
function Test-RaPropertiesValidation
483483
{
484484
# Setup
485-
# $users = Get-AzADUser | Select-Object -First 1 -Wait
486485
$userId = "66486765-477a-4243-880c-7e1fb3c80f2b"
487486
$subscription = $(Get-AzContext).Subscription
488487
$scope = '/subscriptions/'+$subscription[0].Id
489488
$roleDef = Get-AzRoleDefinition -Name "Reader"
490489
$roleDef.Id = "ff9cd1ab-d763-486f-b253-51a816c92aaf"
491-
$roleDef.Name = "Reader vm For Test 1023"
490+
$roleDef.Name = "Reader vm For Test 1024"
492491
$roleDef.Actions.Add("Microsoft.ClassicCompute/virtualMachines/restart/action")
493492
$roleDef.Description = "Read, monitor and restart virtual machines"
494-
$roleDef.AssignableScopes[0] = '/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590' #"/subscriptions/4004a9fd-d58e-48dc-aeb2-4a4aec58606f"
493+
$roleDef.AssignableScopes[0] = '/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590'
495494

496-
New-AzRoleDefinitionWithId -Role $roleDef -RoleDefinitionId 14347f94-76d9-48f6-932e-7997d99a45b2
497-
$rd = Get-AzRoleDefinition -Name "Reader vm"
495+
New-AzRoleDefinitionWithId -Role $roleDef -RoleDefinitionId 14347f95-76d9-48f6-932e-7997d99a45b2
496+
$rd = Get-AzRoleDefinition -Name "Reader vm For Test 1023"
498497

499498
$newAssignment = New-AzRoleAssignmentWithId `
500499
-ObjectId $userId `
501-
-RoleDefinitionName "Reader vm" `
500+
-RoleDefinitionName "Reader vm For Test 1023" `
502501
-Scope $scope `
503502
-RoleAssignmentId 584d33a3-b14d-4eb4-863e-0df67b178389
504503

0 commit comments

Comments
 (0)