Skip unnecessary and misleading role assignment warnings in local test resource deployment (#2954)
Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
This commit is contained in:
parent
bcfbe44a73
commit
e7747b4af9
@ -463,7 +463,10 @@ try {
|
||||
# service principal without permissions to grant RBAC roles to other service principals. That should not be
|
||||
# considered a critical failure, as the test application may have subscription-level permissions and not require
|
||||
# the explicit grant.
|
||||
if (!$resourceGroupRoleAssigned) {
|
||||
#
|
||||
# Ignore this check if $AzureTestPrincipal is specified as role assignment will already have been attempted on a
|
||||
# previous run, and these error messages can be misleading for local runs.
|
||||
if (!$resourceGroupRoleAssigned -and !$AzureTestPrincipal) {
|
||||
Log "Attempting to assigning the 'Owner' role for '$ResourceGroupName' to the Test Application '$TestApplicationId'"
|
||||
$principalOwnerAssignment = New-AzRoleAssignment -RoleDefinitionName "Owner" -ApplicationId "$TestApplicationId" -ResourceGroupName "$ResourceGroupName" -ErrorAction SilentlyContinue
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user