Git Product home page Git Product logo

python-docs-hello-world's Introduction

page_type description languages products
sample
A minimal sample app that can be used to demonstrate deploying Flask apps to Azure App Service on Linux.
python
azure
azure-app-service

Python Flask sample for Azure App Service (Linux)

This is a minimal Flask app that can be deployed to Azure App Service on Linux.

For instructions on running and deploying the code, see Quickstart: Create a Python app in Azure App Service on Linux.

Contributing

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

python-docs-hello-world's People

Contributors

berndverst avatar cephalin avatar charris-msft avatar dependabot[bot] avatar jimacoms4 avatar kraigb avatar microsoftopensource avatar msftgits avatar scottclay avatar supernova-eng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-docs-hello-world's Issues

Use python3 in devops pipeline example

I am currently working on https://github.com/kusl/openroomazurewebsites

If you look at the first commit at kusl/openroomazurewebsites@c673623 , you will see the project used to use Python 2.
Python 2 will EOL on January 01, 2020. https://pythonclock.org/

I have made some changes in the above project to use Python3.
For instance, we don't use Ubuntu anymore.
We use python:stretch (Debian) which automatically gives us the latest Python3.

I think if we devops pipeline to python 3, it will help the azure developer community (especially the students who are trying to learn devops and tomorrow's IT manpower) a lot. Thanks!

Adding another route causes 404 on cloud deploy only

Originally, In main.py there is a function named hello_world

@app.route('/')
def hello_world():
    return 'Hello, World!'

I added another function below

@app.route('/hello')
def hello_path():
    return "HELLO FROM PATH"

So the full script is as follows:

from flask import Flask
app = Flask(__name__)
app.debug = True
    
@app.route('/')
def hello_world():
    return 'Hello, World!'
    
@app.route('/hello')
def hello_path():
    return "HELLO FROM PATH"
    
if __name__ == '__main__':
    app.run()

When I run this on my localhost both endpoints work correctly and return their respective strings. However, after deploying via git to my azure website, I can only get the response from xxx.azurewebsites.net/ to work correctly (returns "Hello, World!"). When I try and hit xxx.azurewebsites.net/hello I get a 404 error.

I'm not sure why it only works with the default route in the cloud when everything works fine locally. Is this a setup issue? Is there anyway I can debug the routing issues on Azure?

pip install -r requirements.txt Fails

When I try to do the pop install I get this error

ImportError: cannot import name 'Feature' from 'setuptools' (c:\users\kkashani\python-docs-hello-world\env\lib\site-packages\setuptools_init_.py)

HTTP Error 500

Hi,

I have followed the tutorial and the deployment were successful. However I am getting HTTP Error 500.0 - Internal Server Error.

That is what appear in the logs:

IIS received the request; however, an internal error occurred during the processing of the request.

IIS was not able to access the web.config file for the Web site or application.
This can occur:

  • if the NTFS permissions are set incorrectly.
  • IIS was not able to process configuration for the Web site or application.
  • The authenticated user does not have permission to use this DLL.
  • The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.

Did I miss some step on the tutorial?

Update python and pip

I need to update pip to install opencv-python package.
I already installed a recent python version through the extension in webapp blade.
That created a folder D:\home\python364x86, and I change the following in the web.config:

<handlers>
      <remove name="Python27_via_FastCGI" />
      <remove name="Python34_via_FastCGI" />
      <add name="Python FastCGI"
           path="handler.fcgi"
           verb="*"
           modules="FastCgiModule"
           scriptProcessor="D:\home\python364x86\python.exe|D:\home\python364x86\Scripts\wfastcgi.py"
           resourceType="Unspecified"
           requireAccess="Script" />
    </handlers>

But it creates the venv with python 3.4 and a version of pip that don't let me install opencv-python.

I think the problem might be in ptvs_virtualenv_proxy.py but I don't really understand what is going there.

Some help please.

Thank you.

Files missing?

Hi there!

Many thanks for this tutorial!

I have a question though, in file web.2.7.config, line 6
D:\home\site\wwwroot\env\Scripts\activate_this.py

and also web.3.4.config:
D:\home\site\wwwroot\env\Scripts\python.exe

Can you confirm how to get this files in env/Scripts folder? From where do we get activate_this.py file?

Thanks!

How to get the email of the authenticated user?

Hello,
I am looking a way to retrieve the user email of the authenticated user.
I can get the first and last name, as showing in the sample example but I can't figure out a way to get the email.
Thanks for your help!
Best Regards,
Romain

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.