I have an Azure app service. Now i want to restrict access to all users except to a certain few users.
I have tried to give access via the Access Control (IAM), what do is i select ,"Add role assignment" and if i do I make the user a contributor. Meanwhile any other user can come in and just click on the default domain url and they can get in ?
Is there an easy way of doing this ?
To allow only specific users to access the App Service, we can use
Microsoft Entra ID(Azure Active Directory) and authenticate the Users.Check the MSDoc to Configure your App Service to use Microsoft Entra sign-in.
Also refer SO Threads 1 and 2 to configure Microsoft Identity Platform from Connected Services in Visual Studio
Connected Servicesto configure for an existing app.Navigate to the
Microsoft Entra ID=>App registrations=> select your App =>App roles=> click onHow do I assign App roles=>Enterprise applicationsAssignment requiredoption inPropertiessection andSave.Select
Users and groupsoption => click onAdd user/groupSearch and assign the Users whom you want to give access to the app and
Assign.Users without access permission will get the below error.
User with access permission