Regarding RBAC role & scope for creating static web apps

Sys Admin 6 Reputation points
2021-04-08T13:48:34.42+00:00

A user in our organization needs to create static web apps in Azure. Please let us know the appropriate RBAC role and scope which can be assigned for that user.

Azure Role-based access control
Azure Role-based access control
An Azure service that provides fine-grained access management for Azure resources, enabling you to grant users only the rights they need to perform their jobs.
660 questions
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
757 questions
{count} vote

2 answers

Sort by: Most helpful
  1. Aleksandra C 5 Reputation points
    2023-09-26T13:23:13.27+00:00

    Hello,

    I recently needed to assign a Microsoft.Web/staticSites/Write role for a Service Principal and there was not a straightforward solution for that. The Role was not present in the RBAC on Subscription level.

    The following solution worked for me:

    I created a Custom Role on Subscription level and for the Permissions, I searched for microsoft.web/staticSites. There is a list of several permissions for the staticWebApps. The scope can be on Subscription, but also Resource Group or Management Group level. If you choose the Resource Group scope, then the Role Assignment needs to be executed on Resource Group level.

    After I created the Custom Role, I easily assigned the Role to the Service Principal.

    Here is the official doc for creating a custom role: https://learn.microsoft.com/en-us/azure/role-based-access-control/custom-roles-portal

    Regards,

    Aleksandra

    1 person found this answer helpful.
    0 comments No comments

  2. Ryan Hill 25,476 Reputation points Microsoft Employee
    2021-04-09T02:43:18.243+00:00

    Hi @Sys Admin ,

    If you are looking for least privileged, then Website contributor should be fine; see https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#website-contributor. You don't need to create a separate app service plan when creating a Static Web App. You can apply this at the subscription level or at the resource group level.

    Regards,
    Ryan