Hi João Pedro Tavares Oliveira,
welcome to Microsoft Q&A,
Lets work on limit the users-
- Set the Blob Storage container to Private to prevent anonymous access. This ensures all requests must be authenticated.
- Create an Azure Function or App Service to act as a proxy. Authenticate users via Entra ID. Check the user’s Entra ID group membership using Microsoft Graph API. Authorize access to specific files based on group membership. Generate short-lived User Delegation SAS Tokens to securely access the files.
- Register an App in Entra ID for your proxy. Assign API permissions like GroupMember.Read.All. Implement authentication (if using frontend) or EasyAuth (in Azure App Service).
- In the proxy, map group IDs to file paths. For example: Allow group1 to access project1.html. Allow group2 to access project2.html. Check the user's groups before generating the SAS token.
- If the user is authorized: Generate a short-lived SAS token using the User Delegation Key. Redirect the user to the Blob URL with the SAS token appended.
- To enforce authentication globally, use Azure Front Door or Application Gateway in front of the proxy to require Entra ID login before reaching the Blob Storage.
Please do refer below link for reference-
https://learn.microsoft.com/en-us/azure/static-web-apps/add-authentication
https://learn.microsoft.com/en-us/azure/static-web-apps/authentication-authorization
https://learn.microsoft.com/en-us/azure/static-web-apps/configuration
If you have any further assistant, do let me know.
If the answer is helpful, please click Accept Answer and kindly upvote it so that other people who faces similar issue may get benefitted from it.