Giter Site home page Giter Site logo

Comments (13)

kraigb avatar kraigb commented on May 22, 2024 1

Thanks for the report; it's good to know about the behavior, which we'll have to look into.

from python-sample-vscode-flask-tutorial.

qubitron avatar qubitron commented on May 22, 2024 1

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:
image

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.

from python-sample-vscode-flask-tutorial.

kraigb avatar kraigb commented on May 22, 2024

@JoshuaPartlow One for you to look into with the Flask tutorial.

from python-sample-vscode-flask-tutorial.

HansKallekleiv avatar HansKallekleiv commented on May 22, 2024

Is there any update on this issue? I'm getting the same results as @anders-kiaer, except for the last part.
In my case turning on authentication (using Azure AD) does not appear to do anything at all.

We want to host quite a few web apps on Azure, but the lack of AD authentication is preventing us from doing so.

from python-sample-vscode-flask-tutorial.

HansKallekleiv avatar HansKallekleiv commented on May 22, 2024

Thanks for looking into this @qubitron
I'm also using containers, and have tried adding that action without success.
Using anonymous session does not help.

These screenshots might be relevant:
1

2

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.

from python-sample-vscode-flask-tutorial.

qubitron avatar qubitron commented on May 22, 2024

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 WEBSITE_AUTH_DISABLE_IDENTITY_FLOW to true, can you try that and let us know if it works?

More information on this setting is here.

from python-sample-vscode-flask-tutorial.

anders-kiaer avatar anders-kiaer commented on May 22, 2024

@qubitron Thanks! πŸ™‡ The provided workaround WEBSITE_AUTH_DISABLE_IDENTITY_FLOW = true worked, tried it some weeks ago for the first time. Tried again now - and now it appears to work also without that application setting. Perhaps the underlying issue has been fixed? πŸŽ‰πŸ‘·

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 ports setting. Are you able to reproduce? Is there something that should be changed/added in the 🐳 Docker compose configuration snippet above?

image

cc: @HansKallekleiv

from python-sample-vscode-flask-tutorial.

VladyslavHnatchenko avatar VladyslavHnatchenko commented on May 22, 2024

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 ...?)
Thank you for your answer.

from python-sample-vscode-flask-tutorial.

anders-kiaer avatar anders-kiaer commented on May 22, 2024

I added it the same place as WEBSITES_PORT=5000, i.e. under Configuration in the Azure web app.

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.

from python-sample-vscode-flask-tutorial.

anders-kiaer avatar anders-kiaer commented on May 22, 2024

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).

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

from python-sample-vscode-flask-tutorial.

VladyslavHnatchenko avatar VladyslavHnatchenko commented on May 22, 2024

@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!

from python-sample-vscode-flask-tutorial.

VladyslavHnatchenko avatar VladyslavHnatchenko commented on May 22, 2024

Sorry @anders-kiaer, why you add WEBSITES_PORT= 5000, I don't add this?

from python-sample-vscode-flask-tutorial.

anders-kiaer avatar anders-kiaer commented on May 22, 2024

Based on this line:

# IMPORTANT: When deploying to Azure App Service, go to the App Service on the Azure
# portal, navigate to the Applications Settings blade, and create a setting named
# WEBSITES_PORT with a value that matches the port here (the Azure default is 80).
# You can also create a setting through the App Service Extension in VS Code.
ENV LISTEN_PORT=5000
EXPOSE 5000

from python-sample-vscode-flask-tutorial.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.