-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
python-flask container example not compatible with AAD express settings #17
Comments
Thanks for the report; it's good to know about the behavior, which we'll have to look into. |
@JoshuaPartlow One for you to look into with the Flask tutorial. |
Is there any update on this issue? I'm getting the same results as @anders-kiaer, except for the last part. We want to host quite a few web apps on Azure, but the lack of AD authentication is preventing us from doing so. |
I have gotten this working using Azure Web Apps (without containers), @HansKallekleiv initially it didn't appear to be working until I set the following setting: I also needed to open the site in an InPrivate session to see the login screen, I think my main browser may have been logged into active directory already. @anders-kiaer I will take a look at the web apps for containers flavor next. |
Thanks for looking into this @qubitron These screenshots might be relevant: There is a warning/information that To enable Authentication / Authorization, please ensure all your custom domains have corresponding SSL bindings, your .NET version is configured to “4.5” or higher and manage pipeline mode is set to “Integrated” , but I'm not sure that is relevant? There are no custom domains atleast. |
I was able to reproduce the issue in containers, and our team has found a workaround, There is known issue with easyauth (middleware) where in some cases, the request header length gets larger than 4096 and the request fails. The mitigation is to set this app setting More information on this setting is here. |
@qubitron Thanks! 🙇 The provided workaround A follow up question regarding Azure web app service + the 🐳 Docker flavor: For Single Container (screenshot below) authentication now works out of the box. However, selecting the Docker Compose functionality and a minimal configuration setup (using the same image as when doing Single container), authentication suddenly is bypassed (i.e. you go directly to the app). version: '3'
services:
web:
image: someregistry.azurecr.io/someimage:latest
ports:
- 80:5000 Tried both with and without the cc: @HansKallekleiv |
Hi all! Sorry @anders-kiaer, @qubitron please can you explain where you add WEBSITE_AUTH_DISABLE_IDENTITY_FLOW = true; in your code (in app.py or in Dockerfile or ...?) |
I added it the same place as Having said that, I have recently created new web apps (using Docker containers), and today it is working without the workaround for my part, so to me it looks like the underlying bug is fixed. |
After I posted this comment, this has now been "fixed" by greying out the Authentication / Authorization tab when you use Docker compose, with a tooltip saying that "This feature is not supported with multi-container apps". I.e. at least indicating that it is not working with Docker compose, even though technically it does not need to be a multi-container app. E.g. this will still not work: version: '3'
services:
web:
image: some_acr.azurecr.io/pythonflasktutorial:latest
ports:
- 80:5000 |
@anders-kiaer, thank you very much for your answer! I added here in the Configuration -> Application settings -> WEBSITE_AUTH_DISABLE_IDENTITY_FLOW = true; but it's fixed my problem. When I turn off Authentication/Authorization(Log in with Azure Active Directory), my flask app worked correct, but when I turn on this function, I have 500 error(without details), in the last step of my workflow in the app. Thank you! |
Sorry @anders-kiaer, why you add WEBSITES_PORT= 5000, I don't add this? |
Based on this line: python-sample-vscode-flask-tutorial/Dockerfile Lines 6 to 11 in 3b80224
|
Thanks for the
python-sample-vscode-flask-tutorial
. Successfully followed the tutorial, and also deployment of the resulting container (following e.g. Deploy Python using Docker containers).Observed behaviour:
The example Azure web app for containers works as expected when AAD with express settings is not enabled in the app. When AAD express is turned on, the app is correctly redirecting to login (https://login.microsoftonline.com) when not authenticated, but when redirected back after successful login, the app returns
HTTP ERROR 500
.Expected behaviour:
The Azure
python-sample-vscode-flask-tutorial
container example works with express settings in App service AAD enabled, or theREADME.md
contains references/information regarding changes needed for express web app AD service settings to work.How to reproduce:
WEBSITES_PORT=5000
application settings as described in the Dockerfile.HTTP ERROR 500
.The text was updated successfully, but these errors were encountered: