Mar 03 2022 10:34 AM
Getting the below error while creating & assigning the scaling plan to hostpool via ARM Template
New-AzResourceGroupDeployment : 23:27:51 - The deployment 'HostPool' failed with error(s). Showing 1 out of 1 error(s).
Status Message: ActivityId: 9876398c-2590-4ef3-8b3d-ddfe2f446ddb Error: ≤{"error":{"code":"BadRequest","message":"unable to access host pool with resource id
'AVDPHOSTPOOL-1', please make sure that you have given the Azure Virtual Desktop service permissions to access your resource (https://docs.microsoft.com/en-us/azu
re/virtual-desktop/autoscale-scaling-plan#create-a-custom-rbac-role)","target":"/api/scalingPlans/subscriptions/39ee65b9-0633-492d-a68c-c1cbdead1ff3/resourceGroups/AVDPRG-1/scalingPlans/AVDPSCALPLAN-1"}}≥ (Code:400)
CorrelationId: 40c66cb1-3a16-4516-bcc8-808ef51602e1
At line:1 char:1
+ New-AzResourceGroupDeployment -ResourceGroupName "AVDPRG-1" -Templ ...
I am found few article to create custom role for AVD via Powershell. but i am trying to achieve it via ARM template.
Is there a way i can add the custom role permission in the scaling plan ARM template .
Sep 15 2022 09:35 AM
@BalajiRanganathan354 Did you ever get this fixed? I am encountering the same error.
Oct 27 2022 04:24 AM
@Fliehigh the avd application requires desktop power on off role on the host pool resource group as well as the resource group containing the session hosts.
Once adding this in it works fine
Mar 20 2023 11:00 AM
@Am549 can you provide some more details here? I am stuck on same error.
How do grant AVD roles on the host pool?
Mar 08 2024 05:09 PM
@Joshua_Matthews I am stuck with the same error. Addin the role Desktop Virtualization Power On Off Contributor on all levels did not help. I created a custom role as the OP suggested... nothing.
What else can I do?
Cheers
MC
Mar 20 2024 06:15 PM
I had the same issue.
There should be one enterprise app called "Windows Virtual Desktop", I assigned Desktop Virtualization Power On Off Contributor to "Windows Virtual Desktop" on the resource level (same resource as your host pool) and it worked for me.
Hope this helps.
Mar 28 2024 03:08 AM - edited Mar 28 2024 03:08 AM
Thank you heaps, you gave me the clue that I was looking for. In my case the app is called "Azure Virtual Desktop" and the end I found the proper documentation here: https://learn.microsoft.com/en-us/azure/virtual-desktop/service-principal-assign-roles?tabs=portal
Thank you Yanbo, I hope this threat helps more people.