Azure / Azure/azure-powershell

Fix ActiveDirectroy secenario test

Open
#10,569 0 comments 0 reactions 0 assignees View on GitHub
bug Test Infra
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
2d 17h
Merged PRs (30d)
51

Description

## Description
Test-NewADServicePrincipalWithoutApp in ActiveDirectroy secenario test is legary now.

````
# Test
$servicePrincipal = New-AzADServicePrincipal -DisplayName $displayName
$role = Get-AzRoleAssignment -ObjectId $servicePrincipal.Id

# Assert
Assert-NotNull $servicePrincipal
Assert-AreEqual $servicePrincipal.DisplayName $displayName
Assert-Null $role
````
When role is not specified explicitly, New-AzADServicePrincipal has a default role, which is "Contributor". And so the $role is not nul in the test case.
## Cost

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.