Giter VIP home page Giter VIP logo

azure-functions-docker-python-sample's People

Contributors

ahmelsayed avatar asavaritayal avatar jwendl avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar msftgits 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

Watchers

 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

azure-functions-docker-python-sample's Issues

Does not work: Service Unavailable - https://functions.azure.com/api/passthrough

Also not with the latest dockerfile image .

Also changed to new v2 format of host.json wo. success.

{
"version": "2.0",
"healthMonitor": {
"enabled": true,
"healthCheckInterval": "00:00:10",
"healthCheckWindow": "00:02:00",
"healthCheckThreshold": 6,
"counterThreshold": 0.80
},
"functionTimeout": "00:05:00",
"logging": {
"fileLoggingMode": "debugOnly"
},
"extensions": {
"http": {
"routePrefix": "api",
"maxConcurrentRequests": 5,
"maxOutstandingRequests": 30
},
"queues": {
"visibilityTimeout": "00:00:10"
},
"eventHubs": {
"batchCheckpointFrequency": 1,
"eventProcessorOptions": {
"maxBatchSize": 1000,
"prefetchCount": 1000
}
}
},
"swagger": {
"enabled": true
}
}

404 error on HttpTrigger

I've tried publishing this code 3 times to Functions and I haven't been able to hit the http trigger without getting a 404.

Are there any extra steps that should be taken other than what is in the README and the linked documentation?

Create dev branch

It would be helpful to have dev branch with docker file consuming the latest version of worker and host.

HttpTrigger Local Function Returns 406 in the Browser

I cloned and the example which targets base image: microsoft/azure-functions-python3.6:v2.0.11737-alpha

When I go to

http://localhost:8080/api/HttpTrigger?name=hi

I see an Http Error 406. In the docker logs I see that the HttpTrigger was hit.

info: Function.HttpTrigger[0]
      => System.Collections.Generic.Dictionary`2[System.String,System.Object] => System.Collections.Generic.Dictionary`2[System.String,System.Object]
      Executing 'Functions.HttpTrigger' (Reason='This function was programmatically called via the host APIs.', Id=f7d69d25-233a-41da-a569-95a2bdaa9ca1)

Page is ut, but a call to the API gives error code 500

Everything seems fine when I access my python app on this link:
http://funcmandag.azurewebsites.net/

However, when I curl this in terminal:
curl http://funcmandag.azurewebsites.net/api/HttpTriggerJS1?name=erlend
it returns nothing. When I paste it in the browser it gives me http error code 500.

Has anyone else experienced this?

The exact same thing happens locally:
http://localhost:8080/api/HttpTriggerJS1?name=erlend

Dockerfile error

This is from @priyaananthasankar

The latest Docker file that is updated with the alpha doesn’t work, it is unable to find workers path.

FROM microsoft/azure-functions-python3.6:v2.0.11651-alpha
ENV host:logger:consoleLoggingMode=always 
COPY . /home/site/wwwroot 
RUN cd /home/site/wwwroot && \ 
/bin/bash -c \
"source /workers/worker_env/bin/activate &&\
pip3 install -r requirements.txt"

The source /workers/worker_env/bin/activate isn’t working.

HttpTrigger local func start gives the following error

(functions_venv) IIQHost1:SyncWeek prananth$ python3.6 -m venv functions_venv
(functions_venv) IIQHost1:SyncWeek prananth$ mkdir python-functions
(functions_venv) IIQHost1:SyncWeek prananth$ ~/Downloads/Azure.Functions.Cli.osx-x64/func init . --worker-runtime python
Installing wheel package
Installing azure-functions (dev) package
Running pip freeze
Writing .gitignore
Writing host.json
Writing local.settings.json
Writing /Users/prananth/Projects/SyncWeek/.vscode/extensions.json
Initialized empty Git repository in /Users/prananth/Projects/SyncWeek/.git/

(functions_venv) IIQHost1:SyncWeek prananth$ ~/Downloads/Azure.Functions.Cli.osx-x64/func new
Select a language: Select a template:

  1. Blob trigger

  2. HTTP trigger

  3. Queue trigger

  4. Timer trigger
    Choose option: 2
    HTTP trigger
    Function name: [HttpTriggerPython]
    Writing /Users/prananth/Projects/SyncWeek/HttpTriggerPython/sample.dat
    Writing /Users/prananth/Projects/SyncWeek/HttpTriggerPython/init.py
    Writing /Users/prananth/Projects/SyncWeek/HttpTriggerPython/function.json
    (functions_venv) IIQHost1:SyncWeek prananth$ ~/Downloads/Azure.Functions.Cli.osx-x64/func start

               %%%%%%
              %%%%%%
         @   %%%%%%    @
       @@   %%%%%%      @@
    @@@    %%%%%%%%%%%    @@@
    

    @@ %%%%%%%%%% @@
    @@ %%%% @@
    @@ %%% @@
    @@ %% @@
    %%
    %

Hosting environment: Production
Content root path: /Users/prananth/Projects/SyncWeek
Now listening on: http://localhost:7071
Application started. Press Ctrl+C to shut down.
[5/3/18 6:25:57 PM] Reading host configuration file '/Users/prananth/Projects/SyncWeek/host.json'
[5/3/18 6:25:57 PM] Host configuration file read:
[5/3/18 6:25:57 PM] {}
[5/3/18 6:25:57 PM] Starting Host (HostId=prananthsmacbookpro-1384342556, InstanceId=270e2f8b-8f5b-40f5-94b6-08c9c15acf6d, Version=2.0.11651.0, ProcessId=14684, AppDomainId=1, Debug=False, ConsecutiveErrors=0, StartupCount=1, FunctionsExtensionVersion=)
[5/3/18 6:25:57 PM] Unable to configure java worker. Could not find JAVA_HOME app setting.
[5/3/18 6:25:57 PM]
[5/3/18 6:25:57 PM] Could not configure language worker Java.
[5/3/18 6:25:57 PM]
[5/3/18 6:25:57 PM] Start Process: python "/Users/prananth/Downloads/Azure.Functions.Cli.osx-x64/workers/python/worker.py" --host 127.0.0.1 --port 62175 --workerId 1ac9c1ce-b563-4e27-8c5c-37d3045de668 --requestId 2f60cf63-a768-46ae-8870-a3bb80b9f644
[5/3/18 6:25:57 PM] Generating 1 job function(s)
[5/3/18 6:25:57 PM] Found the following functions:
[5/3/18 6:25:57 PM] Host.Functions.HttpTriggerPython
[5/3/18 6:25:57 PM]
[5/3/18 6:25:57 PM] Host initialized (684ms)
[5/3/18 6:25:57 PM] Traceback (most recent call last):
[5/3/18 6:25:57 PM] Traceback (most recent call last):
[5/3/18 6:25:57 PM] File "/Users/prananth/Downloads/Azure.Functions.Cli.osx-x64/workers/python/worker.py", line 33, in
[5/3/18 6:25:57 PM] File "/Users/prananth/Downloads/Azure.Functions.Cli.osx-x64/workers/python/worker.py", line 26, in main
[5/3/18 6:25:57 PM] main()
[5/3/18 6:25:57 PM] args.host, args.port, args.worker_id, args.request_id)
[5/3/18 6:25:57 PM] File "/Users/prananth/Downloads/Azure.Functions.Cli.osx-x64/workers/python/worker.py", line 26, in main
[5/3/18 6:25:57 PM] TypeError: start() missing 1 required positional argument: 'grpc_max_msg_len'
[5/3/18 6:25:57 PM] args.host, args.port, args.worker_id, args.request_id)
[5/3/18 6:25:57 PM] TypeError: start() missing 1 required positional argument: 'grpc_max_msg_len'
Listening on http://localhost:7071/
Hit CTRL-C to exit...

Http Functions:

HttpTriggerPython: http://localhost:7071/api/HttpTriggerPython

[5/3/18 6:25:58 PM] Worker encountered an error.
[5/3/18 6:25:58 PM] Worker process with pid 14685 exited with code 1.
[5/3/18 6:25:58 PM] Start Process: python "/Users/prananth/Downloads/Azure.Functions.Cli.osx-x64/workers/python/worker.py" --host 127.0.0.1 --port 62175 --workerId 27fce02a-6978-403c-99b8-502074b0f2f3 --requestId 799cdbf3-b31c-4f6e-bb36-ea843e678419
[5/3/18 6:25:58 PM] Traceback (most recent call last):
[5/3/18 6:25:58 PM] Traceback (most recent call last):
[5/3/18 6:25:58 PM] File "/Users/prananth/Downloads/Azure.Functions.Cli.osx-x64/workers/python/worker.py", line 26, in main
[5/3/18 6:25:58 PM] File "/Users/prananth/Downloads/Azure.Functions.Cli.osx-x64/workers/python/worker.py", line 33, in
[5/3/18 6:25:58 PM] args.host, args.port, args.worker_id, args.request_id)
[5/3/18 6:25:58 PM] main()
[5/3/18 6:25:58 PM] TypeError: start() missing 1 required positional argument: 'grpc_max_msg_len'
[5/3/18 6:25:58 PM] File "/Users/prananth/Downloads/Azure.Functions.Cli.osx-x64/workers/python/worker.py", line 26, in main
[5/3/18 6:25:58 PM] args.host, args.port, args.worker_id, args.request_id)
[5/3/18 6:25:58 PM] TypeError: start() missing 1 required positional argument: 'grpc_max_msg_len'
[5/3/18 6:25:58 PM] Worker encountered an error.
[5/3/18 6:25:58 PM] Worker process with pid 14686 exited with code 1.
[5/3/18 6:25:58 PM] Start Process: python "/Users/prananth/Downloads/Azure.Functions.Cli.osx-x64/workers/python/worker.py" --host 127.0.0.1 --port 62175 --workerId 806c9aa4-5390-4773-8770-de2bc3e4712c --requestId d131da20-8082-432a-870d-135938d2b448
[5/3/18 6:25:58 PM] Traceback (most recent call last):
[5/3/18 6:25:58 PM] Traceback (most recent call last):
[5/3/18 6:25:58 PM] File "/Users/prananth/Downloads/Azure.Functions.Cli.osx-x64/workers/python/worker.py", line 26, in main
[5/3/18 6:25:58 PM] File "/Users/prananth/Downloads/Azure.Functions.Cli.osx-x64/workers/python/worker.py", line 33, in
[5/3/18 6:25:58 PM] args.host, args.port, args.worker_id, args.request_id)
[5/3/18 6:25:58 PM] main()
[5/3/18 6:25:58 PM] TypeError: start() missing 1 required positional argument: 'grpc_max_msg_len'
[5/3/18 6:25:58 PM] File "/Users/prananth/Downloads/Azure.Functions.Cli.osx-x64/workers/python/worker.py", line 26, in main
[5/3/18 6:25:58 PM] args.host, args.port, args.worker_id, args.request_id)
[5/3/18 6:25:58 PM] TypeError: start() missing 1 required positional argument: 'grpc_max_msg_len'
[5/3/18 6:25:58 PM] Worker encountered an error.
[5/3/18 6:25:58 PM] Worker process with pid 14687 exited with code 1.
^CApplication is shutting down...
[5/3/18 6:26:06 PM] Host started (9318ms)
[5/3/18 6:26:06 PM] Job host started
[5/3/18 6:26:06 PM] Stopping Host
[5/3/18 6:26:06 PM] Job host stopped

Errors w/ Linux binaries

Running with bash via Ubuntu 16.04 subsystem for Windows.

Followed instructions here: https://github.com/Azure/azure-functions-docker-python-sample/wiki/Getting-started-using-Functions-Core-Tools.

Downloaded linux zip file from https://ci.appveyor.com/project/appsvc/azure-functions-cli/build/2.0.1.294/artifacts

Upon using binaries to run func init . --worker-runtime python (or any other call to func), I get the following errors:
Failed to load X{z�, error: libunwind.so.8: cannot open shared object file: No such file or directory
Failed to bind to CoreCLR at '/mnt/c/Users/Administrator/dev/soh-local/func_venv_bash/linux_functions/libcoreclr.so'

Fixed by running apt-get install libunwind8

docker image error

Should the Dockerfile 1st line read
FROM mcr.microsoft.com/azure-functions/python:2.0

I get a docker build error with the stated docker image
manifest for microsoft/azure-functions-python3.6:v2.0.11737-alpha not found
/usr/bin/docker failed with return code: 1

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.