How to restrict Azure Static WebApp to team members?

Andrew Fogarty 6 Reputation points

I am building a static webapp for my team but I do not want its availability to be public.

How can I restrict its access to just my teammates, perhaps using Azure Active Directory. I am publishing the website from Azure DevOps with pipelines if that matters.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,496 questions
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
697 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 13,961 Reputation points

    Hi @Andrew Fogarty ,

    You can achieve this using Role management, Every user who accesses a static web app belongs to one or more roles. There are two built-in roles that users can belong to:

    • anonymous: All users automatically belong to the anonymous role.
    • authenticated: All users who are logged in belong to the authenticated role.

    Beyond the built-in roles, you can create new roles, assign them to users via invitations, and reference them in the staticwebapp.config.json file.

    follow the steps in this doc to assign roles for your team: Authentication and authorization for Azure Static Web Apps. You can also check out this similar Github thread.



    3 people found this answer helpful.