Skip to content

Commit f78b0b1

Browse files
authored
Update deploy-azure-virtual-desktop.md
1 parent 3dcc270 commit f78b0b1

File tree

1 file changed

+73
-73
lines changed

1 file changed

+73
-73
lines changed

articles/virtual-desktop/deploy-azure-virtual-desktop.md

Lines changed: 73 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -690,87 +690,87 @@ Here's how to assign users or user groups to an application group by using the A
690690

691691
# [Azure PowerShell](#tab/powershell)
692692

693-
Here's how to assign users or user groups to an application group by using the [Az.Resources](/powershell/module/az.resources) Azure PowerShell module:
693+
Here's how to assign users or user groups to an application group by using the [Az.Resources](/powershell/module/az.resources) Azure PowerShell module.
694694

695-
- In the same PowerShell session, use the `New-AzRoleAssignment` cmdlet with the following examples to assign users or user groups to an application group:
695+
In the same PowerShell session, use the `New-AzRoleAssignment` cmdlet with the following examples to assign users or user groups to an application group:
696696

697-
- To assign users to the application group, run the following commands:
697+
- To assign users to the application group, run the following commands:
698698

699-
```azurepowershell
700-
$parameters = @{
701-
SignInName = '<UserPrincipalName>'
702-
ResourceName = '<ApplicationGroupName>'
703-
ResourceGroupName = '<ResourceGroupName>'
704-
RoleDefinitionName = 'Desktop Virtualization User'
705-
ResourceType = 'Microsoft.DesktopVirtualization/applicationGroups'
706-
}
699+
```azurepowershell
700+
$parameters = @{
701+
SignInName = '<UserPrincipalName>'
702+
ResourceName = '<ApplicationGroupName>'
703+
ResourceGroupName = '<ResourceGroupName>'
704+
RoleDefinitionName = 'Desktop Virtualization User'
705+
ResourceType = 'Microsoft.DesktopVirtualization/applicationGroups'
706+
}
707707
708-
New-AzRoleAssignment @parameters
709-
```
710-
711-
- To assign user groups to the application group, run the following commands:
712-
713-
```azurepowershell
714-
# Get the object ID of the user group that you want to assign to the application group
715-
$userGroupId = (Get-AzADGroup -DisplayName "<UserGroupName>").Id
716-
717-
# Assign users to the application group
718-
$parameters = @{
719-
ObjectId = $userGroupId
720-
ResourceName = '<ApplicationGroupName>'
721-
ResourceGroupName = '<ResourceGroupName>'
722-
RoleDefinitionName = 'Desktop Virtualization User'
723-
ResourceType = 'Microsoft.DesktopVirtualization/applicationGroups'
724-
}
708+
New-AzRoleAssignment @parameters
709+
```
710+
711+
- To assign user groups to the application group, run the following commands:
712+
713+
```azurepowershell
714+
# Get the object ID of the user group that you want to assign to the application group
715+
$userGroupId = (Get-AzADGroup -DisplayName "<UserGroupName>").Id
716+
717+
# Assign users to the application group
718+
$parameters = @{
719+
ObjectId = $userGroupId
720+
ResourceName = '<ApplicationGroupName>'
721+
ResourceGroupName = '<ResourceGroupName>'
722+
RoleDefinitionName = 'Desktop Virtualization User'
723+
ResourceType = 'Microsoft.DesktopVirtualization/applicationGroups'
724+
}
725725
726-
New-AzRoleAssignment @parameters
727-
```
726+
New-AzRoleAssignment @parameters
727+
```
728728

729729
# [Azure CLI](#tab/cli)
730730

731-
Here's how to assign users or user groups to an application group by using the [role](/cli/azure/role/assignment) extension for the Azure CLI:
732-
733-
- In the same CLI session, use the `az role assignment create` command with the following examples to assign users or user groups to an application group:
734-
735-
- To assign users to the application group, run the following commands:
736-
737-
```azurecli
738-
# Get the resource ID of the application group that you want to add to the workspace
739-
appGroupPath=$(az desktopvirtualization applicationgroup show \
740-
--name <Name> \
741-
--resource-group <ResourceGroupName> \
742-
--query [id] \
743-
--output tsv)
744-
745-
# Assign users to the application group
746-
az role assignment create \
747-
--assignee '<UserPrincipalName>' \
748-
--role 'Desktop Virtualization User' \
749-
--scope $appGroupPath
750-
```
751-
752-
- To assign user groups to the application group, run the following commands:
753-
754-
```azurecli
755-
# Get the resource ID of the application group that you want to add to the workspace
756-
appGroupPath=$(az desktopvirtualization applicationgroup show \
757-
--name <Name> \
758-
--resource-group <ResourceGroupName> \
759-
--query [id] \
760-
--output tsv)
761-
762-
# Get the object ID of the user group that you want to assign to the application group
763-
userGroupId=$(az ad group show \
764-
--group <UserGroupName> \
765-
--query [id] \
766-
--output tsv)
767-
768-
# Assign users to the application group
769-
az role assignment create \
770-
--assignee $userGroupId \
771-
--role 'Desktop Virtualization User' \
772-
--scope $appGroupPath
773-
```
731+
Here's how to assign users or user groups to an application group by using the [role](/cli/azure/role/assignment) extension for the Azure CLI.
732+
733+
In the same CLI session, use the `az role assignment create` command with the following examples to assign users or user groups to an application group:
734+
735+
- To assign users to the application group, run the following commands:
736+
737+
```azurecli
738+
# Get the resource ID of the application group that you want to add to the workspace
739+
appGroupPath=$(az desktopvirtualization applicationgroup show \
740+
--name <Name> \
741+
--resource-group <ResourceGroupName> \
742+
--query [id] \
743+
--output tsv)
744+
745+
# Assign users to the application group
746+
az role assignment create \
747+
--assignee '<UserPrincipalName>' \
748+
--role 'Desktop Virtualization User' \
749+
--scope $appGroupPath
750+
```
751+
752+
- To assign user groups to the application group, run the following commands:
753+
754+
```azurecli
755+
# Get the resource ID of the application group that you want to add to the workspace
756+
appGroupPath=$(az desktopvirtualization applicationgroup show \
757+
--name <Name> \
758+
--resource-group <ResourceGroupName> \
759+
--query [id] \
760+
--output tsv)
761+
762+
# Get the object ID of the user group that you want to assign to the application group
763+
userGroupId=$(az ad group show \
764+
--group <UserGroupName> \
765+
--query [id] \
766+
--output tsv)
767+
768+
# Assign users to the application group
769+
az role assignment create \
770+
--assignee $userGroupId \
771+
--role 'Desktop Virtualization User' \
772+
--scope $appGroupPath
773+
```
774774

775775
---
776776

0 commit comments

Comments
 (0)