-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Azure AD Authentication for app service is not working #20913
Comments
During troubleshooting, we noticed that allowedGroup node is added in jwtClaimChecks, which is the actual cause of this issue. The application starts working by removing this property (with the help of resource explorer). "validation": { |
@muk-shobhit I think I'm having a similar issue as my configuration looks exactly as you posted, however your workaround didn't work for me. I too get HTTP 500 Internal Server Error after the user login and when the browser is redirected to the I'll share below what I've tried so far and will post here in this thread any updates. I downloaded the az rest --uri /subscriptions/<SUBSCRIPTION>/resourceGroups/<RESOURCE_GROUP>/providers/Microsoft.Web/sites/<APP_SERVICE>/config/authsettingsV2?api-version=2022-03-01 --method get > auth.json Then I removed the Finally, I uploaded the new configuration: az rest --uri /subscriptions/<SUBSCRIPTION>/resourceGroups/<RESOURCE_GROUP>/providers/Microsoft.Web/sites/<APP_SERVICE>/config/authsettingsV2?api-version=2022-03-01 --method put --body @auth.json I checked the API again and was able to confirm that the "validation": {
"allowedAudiences": [
"api://myprivateapp9b346f24ae5eb3e0"
],
"defaultAuthorizationPolicy": {
"allowedApplications": [],
"allowedPrincipals": {
"groups": [],
"identities": []
}
},
"jwtClaimChecks": {
"allowedClientApplications": []
}
} |
I was able to solve my issue as well, and I'll explain how.
I then downloaded both of the az rest --uri /subscriptions/<SUBSCRIPTION>/resourceGroups/<RESOURCE_GROUP>/providers/Microsoft.Web/sites/<APP_SERVICE>/config/authsettingsV2?api-version=2022-03-01 --method get > auth.json After comparing the Portal webapp with my Terraform webapp, I noticed a few differences and removed the following fields which are being added when using the Terraform Azurerm provider:
Updated the edited Terraform webapp JSON:
After that, my authentication worked as expected. |
This functionality has been released in v3.49.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Is there an existing issue for this?
Community Note
Terraform Version
1.4.0
AzureRM Provider Version
3.47.0
Affected Resource(s)/Data Source(s)
auth_settings_v2
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
Authentication should work as usual
Actual Behaviour
Authentication is not working. We get "Internal server error"
Steps to Reproduce
Using below implement the Authentication to a web app
Important Factoids
No
References
No response
The text was updated successfully, but these errors were encountered: