Skip to content

Commit d1508fe

Browse files
authored
Merge pull request Azure#5095 from darshanhs90/preview2
Fix ServicePrincipalName misnaming in new-azurermroleassignment command
2 parents 014755f + 81140e7 commit d1508fe

File tree

18 files changed

+4557
-3841
lines changed

18 files changed

+4557
-3841
lines changed

src/ResourceManager/Resources/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
* Allow users to create RoleAssignment using delegation flag
3030
- Users can now use New-AzureRMRoleAssignment with an option of adding the delegation flag
3131
* Fix RoleAssignment get to respect the scope parameter
32+
* Add an alias for ServicePrincipalName in the New-AzureRmRoleAssignment Commandlet
33+
- Users can now use the ApplicationId instead of the ServicePrincipalName when using the New-AzureRmRoleAssignment commandlet
3234

3335
## Version 5.0.0
3436
* Add support for online help

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,19 @@ function Test-RaByServicePrincipal
255255
-RoleDefinitionName $definitionName `
256256
-Scope $scope
257257

258-
259258
# cleanup
260259
DeleteRoleAssignment $newAssignment
261260

261+
# Test
262+
[Microsoft.Azure.Commands.Resources.Models.Authorization.AuthorizationClient]::RoleAssignmentNames.Enqueue("0b018870-59ba-49ca-9405-9ba5dce77311")
263+
$newAssignment = New-AzureRmRoleAssignment `
264+
-ApplicationId $servicePrincipals[0].ServicePrincipalNames[0] `
265+
-RoleDefinitionName $definitionName `
266+
-Scope $scope
267+
268+
# cleanup
269+
DeleteRoleAssignment $newAssignment
270+
262271
# Assert
263272
Assert-NotNull $newAssignment
264273
Assert-AreEqual $definitionName $newAssignment.RoleDefinitionName

0 commit comments

Comments
 (0)