Skip to content

Commit

Permalink
Add logging statements to check role assignment in Bicep Landing Zone…
Browse files Browse the repository at this point in the history
… tests
  • Loading branch information
sebassem committed Dec 25, 2023
1 parent 6cd741c commit b551ca5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/pester/full.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ Describe "Bicep Landing Zone (Sub) Vending Tests" {
$iterationCount = 0
do {
#$roleAssignment = Get-AzRoleAssignment -Scope "/subscriptions/$subId" -RoleDefinitionName "Reader" -ObjectId "7eca0dca-6701-46f1-b7b6-8b424dab50b3" -ErrorAction SilentlyContinue
Write-Host "Sub Id: $subId"
$roleAssignment = Get-AzRoleAssignment -Scope "/subscriptions/$subId" -ErrorAction SilentlyContinue
Write-Host "Role assignment: $roleAssignment"
$roleAssignment = Get-AzRoleAssignment -Scope "/subscriptions/$subId" -ErrorAction SilentlyContinue | Where-Object { $_.ObjectId -eq "7eca0dca-6701-46f1-b7b6-8b424dab50b3" -and $_.RoleDefinitionName -eq "Reader"}
if ($null -eq $roleAssignment) {
Write-Host "Waiting for Subscription Role Assignments to be eventually consistent... Iteration: $($iterationCount)" -ForegroundColor Yellow
Expand Down

0 comments on commit b551ca5

Please sign in to comment.