How to restrict Azure Static WebApp to team members?

Andrew Fogarty 6 Reputation points Microsoft Employee
2021-05-25T21:52:08.31+00:00

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.
7,913 questions
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
968 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 18,451 Reputation points
    2021-05-26T04:38:05.867+00:00

    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.

    Thanks,

    Grace

    3 people found this answer 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.