User permissions error Azure Autoscale

Juan Pablo Delgadillo Martinez 91 Reputation points
2024-11-05T13:48:26.2066667+00:00

Hello everyone

I'm creating an AVD environment, everything is fine at the time of creation, however when assigning the hostpool to the autoscale, this indicates a permissions error

ActivityId: id error Error: ≤{"error":{"code":"BadRequest","message":"unable to access host pool with name 'Hostpool', please make sure that you have given the Azure Virtual Desktop service permissions to access your resource (https://docs.microsoft.com/en-us/azure/virtual-desktop/autoscale-scaling-plan#create-a-custom-rbac-role))","target":"/api/scalingPlans/subscriptions/

I have owner permissions, user access administrator, add me some additional permissions to turn on and off machines

And I still can't assign it

Azure Virtual Desktop
Azure Virtual Desktop
A Microsoft desktop and app virtualization service that runs on Azure. Previously known as Windows Virtual Desktop.
1,855 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Anonymous
    2024-11-11T16:21:12.31+00:00

    Hi Juan Pablo Delgadillo Martinez,

    It looks like the issue is due to an incorrect permission name. Specifically, Microsoft.DesktopVirtualization/escaladoPlanes is incorrect due to a language mismatch. The correct permissions you need to add are:

    • Microsoft.DesktopVirtualization/scalingPlans/read
    • Microsoft.DesktopVirtualization/scalingPlans/write
    • Microsoft.DesktopVirtualization/scalingPlans/delete
    • Microsoft.Insights/autoscaleSettings/read
    • Microsoft.Insights/autoscaleSettings/write
    • Microsoft.Insights/autoscaleSettings/delete

    Please ensure these exact permissions are used when creating the custom role. If you continue to encounter issues with PowerShell, you can also try creating the custom role via Azure CLI using the following command:

    az role definition create --role-definition '{
        "Name": "AVD Scaling Plan Custom Role",
        "IsCustom": true,
        "Description": "Role for managing AVD scaling plans",
        "Actions": [
            "Microsoft.DesktopVirtualization/scalingPlans/read",
            "Microsoft.DesktopVirtualization/scalingPlans/write",
            "Microsoft.DesktopVirtualization/scalingPlans/delete",
            "Microsoft.Insights/autoscaleSettings/read",
            "Microsoft.Insights/autoscaleSettings/write",
            "Microsoft.Insights/autoscaleSettings/delete"
        ],
        "AssignableScopes": ["/subscriptions/YOUR_SUBSCRIPTION_ID"]
    }'		
    

    Additionally, if you continue to face issues, ensure that your subscription allows for custom role creation and check for any potential Azure policy restrictions.

    For more details, refer to these Microsoft documents:
    Create and assign an autoscale scaling plan for Azure Virtual Desktop
    Create or update Azure custom roles using the Azure portal

    If you found the information useful, please click "Upvote" on the post to let us know.

    0 comments No comments

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.