How to add user to the Azure Active directory Group?

kavya madda 60 Reputation points
2024-09-04T13:41:49.5066667+00:00

Hi All,

I provisioned AVD using ARM template . within that i want to add user to the application group.

So, here my challenge is i want to make it done through ARM template.

If possible please share me the ways how can i achieve it.

Thanks in advance.

Azure Virtual Desktop
Azure Virtual Desktop
A Microsoft desktop and app virtualization service that runs on Azure. Previously known as Windows Virtual Desktop.
1,516 questions
0 comments No comments
{count} votes

Accepted answer
  1. deherman-MSFT 36,831 Reputation points Microsoft Employee
    2024-09-04T17:35:20.04+00:00

    @kavya madda

    The method for assign users to an application group can be found here, this includes the portal, PowerShell and CLI. More details about the ARM template format can be found here. You can try this format to see if it works for you:

    {
      "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
      "contentVersion": "1.0.0.0",
      "parameters": {
        "principalId": {
          "type": "string",
          "metadata": {
            "description": "Specifies the principal ID assigned to the role."
          }
        },
        "roleDefinitionId": {
          "type": "string",
          "metadata": {
            "description": "Specifies the role definition ID used in the role assignment."
          }
        },
        "applicationGroupName": {
          "type": "string",
          "metadata": {
            "description": "Specifies the name of the application group."
          }
        },
        "resourceGroupName": {
          "type": "string",
          "metadata": {
            "description": "Specifies the name of the resource group."
          }
        }
      },
      "resources": [
        {
          "type": "Microsoft.Authorization/roleAssignments",
          "apiVersion": "2022-04-01",
          "name": "[guid(parameters('principalId'), parameters('roleDefinitionId'), resourceGroup().id)]",
          "properties": {
            "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', parameters('roleDefinitionId'))]",
            "principalId": "[parameters('principalId')]",
            "scope": "[resourceId('Microsoft.DesktopVirtualization/applicationGroups', parameters('resourceGroupName'), parameters('applicationGroupName'))]"
          }
        }
      ]
    }
    
    

    Hope this helps! Let me know if you still have questions or need further assistance.


    If you still have questions, please let us know in the "comments" and we would be happy to help you. Comment is the fastest way of notifying the experts.

    If the answer has been helpful, we appreciate hearing from you and would love to help others who may have the same question. Accepting answers helps increase visibility of this question for other members of the Microsoft Q&A community.

    Thank you for helping to improve Microsoft Q&A! User's image

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.