Azure Static Web Apps provides 2 mechanisms for authentication: built-in authentication and custom authentication. Itenables the authentication by simply defining the routing rules and the roles in the configuration file staticwebapp.config.json.
In this blog, we are going to introduce how to enable built-in authentication for Azure Static Web Apps with Azure Active Directory step by step.
1. Create a Static Web App from the Azure Portal
2. Check workflow file for the app_location setting. The default path of app_location in the workflow file should be defined as "/".
3. Manually create the configuration file staticwebapp.config.json in the folder set as the app_location in the workflow file.
4. Configure built-in authentication in the file staticwebapp.config.json by the following sample