Skip to content

Commit

Permalink
[Az.Resources] Reverted feature reimplementation (#23058)
Browse files Browse the repository at this point in the history
* 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 opensource@microsoft.com

* 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
  • Loading branch information
NoriZC authored Oct 25, 2023
1 parent 5b2fb61 commit 10c4b10
Show file tree
Hide file tree
Showing 14 changed files with 410 additions and 371 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -482,23 +482,22 @@ Tests verifies creation and validation of RoleAssignment properties for not null
function Test-RaPropertiesValidation
{
# Setup
# $users = Get-AzADUser | Select-Object -First 1 -Wait
$userId = "66486765-477a-4243-880c-7e1fb3c80f2b"
$subscription = $(Get-AzContext).Subscription
$scope = '/subscriptions/'+$subscription[0].Id
$roleDef = Get-AzRoleDefinition -Name "Reader"
$roleDef.Id = "ff9cd1ab-d763-486f-b253-51a816c92aaf"
$roleDef.Name = "Reader vm For Test 1023"
$roleDef.Name = "Reader vm For Test 1024"
$roleDef.Actions.Add("Microsoft.ClassicCompute/virtualMachines/restart/action")
$roleDef.Description = "Read, monitor and restart virtual machines"
$roleDef.AssignableScopes[0] = '/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590' #"/subscriptions/4004a9fd-d58e-48dc-aeb2-4a4aec58606f"
$roleDef.AssignableScopes[0] = '/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590'

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

$newAssignment = New-AzRoleAssignmentWithId `
-ObjectId $userId `
-RoleDefinitionName "Reader vm" `
-RoleDefinitionName "Reader vm For Test 1023" `
-Scope $scope `
-RoleAssignmentId 584d33a3-b14d-4eb4-863e-0df67b178389

Expand Down
Loading

0 comments on commit 10c4b10

Please sign in to comment.