question

AndrewFogarty-1127 avatar image
0 Votes"
AndrewFogarty-1127 asked AndrewFogarty-1127 edited

How to restrict Azure Static WebApp to team members?

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-webappsazure-static-web-apps
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Grmacjon-MSFT avatar image
2 Votes"
Grmacjon-MSFT answered AndrewFogarty-1127 edited

Hi @AndrewFogarty-1127 ,

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



· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I think, above mentioned solution should solve the problem and the link has detailed steps mentioned.

1 Vote 1 ·

Thanks -- this is helpful. Can you also recommend ways that this access stays open? For example, it seems that I have to reissue authorization codes repeatedly as they timeout using Role Management and even access that I grant myself leads to a 401 Forbidden error the next day.

100260-invite.png


0 Votes 0 ·