Git Product home page Git Product logo

yokawasa / azure-functions-python-samples Goto Github PK

View Code? Open in Web Editor NEW
389.0 21.0 177.0 17.58 MB

Azure Functions Python Sample Codes. NOTE: The project, hosted in a repository, is no longer actively maintained by its creators or contributors. There won't be any further updates, bug fixes, or support from the original developers in the project.

License: MIT License

Python 70.10% Shell 29.41% HTML 0.15% Dockerfile 0.34%
azure azure-functions serverless python azure-functions-v2

azure-functions-python-samples's Introduction

azure-functions-python-samples

Azure Functions Python Sample Codes

Table of Contents

Python functions on Azure Functions 2.X (Public Preview)

This is a collection of Python function samples on Azure Functions 2.X. For a comprehensive development and debugging experience, use the Azure Functions Core Tools or VS Code extension.

Samples

Sample Description Trigger In Bindings Out Bindings
cosmosdb-trigger-cosmosdb-in-binding Azure Functions Blob Storage Trigger Python Sample. The function gets image data from Azure Blob Trigger, gets tags for the image with Computer Vision API (Azure Cognitive Services), and store the tags into Azure Cosmos DB by leveraging Cosmos DB output binding Blob Storage NONE CosmosDB
cosmos-trigger-cosmodb-output-binding Azure Functions Cosmos DB Trigger Python Sample. The function gets document data from Azure Cosmos DB Trigger, ROT13 encodes obtained clear text, and store encoded data into Azure Cosmos DB by using Cosmos DB output binding CosmosDB NONE CosmosDB
queue-trigger-blob-in-out-binding Azure Functions Queue Trigger Python Sample. The function gets a file name from queue message, reads a blob file named the file name using Blob Input Binding, then ROT13 encodes the obtained clear text, and finally stores it into Azure Blob Storage using Blob Output Binding Queue Storage Blob Storage Blob Storage
timer-trigger-cosmos-output-binding Azure Functions Timer Trigger Python Sample. The function gets blog RSS feed and store the results into CosmosDB using Cosmos DB output binding Timer NONE CosmosDB
http-trigger-blob-sas-token Azure Function HTTP Trigger Python Sample that returns a SAS token for Azure Storage for the specified container and blob name HTTP NONE HTTP
http-trigger-dump-request Azure Function HTTP Trigger Python Sample that returns request dump info with JSON format HTTP NONE HTTP
http-trigger-onnx-model This function demonstrates running an inference using an ONNX model. It is triggered by an HTTP request. HTTP NONE HTTP
blob-trigger-watermark-blob-out-binding Azure Function Python Sample that watermarks an image. This function triggers on an input blob (image) and adds a watermark by calling into the Pillow library. The resulting composite image is then written back to blob storage using a blob output binding. Blob Storage Blob Storage Blob Storage
sbqueue-trigger-sbqueue-out-binding Azure Functions Service Bus Queue Trigger Python Sample. The function demonstrates reading from a Service Bus queue and placing a message into an output Service Bus queue. Service Bus Queue None Service Bus Queue

Documents


Python functions on Azure Functions 1.X (Experimental)

IMPORTANT

  • By default, function apps created in the Azure portal are set to version 2.x. When possible, you should use this runtime version, where new feature investments are being made. Please see this for more detail on Azure Function runtime versions and supported languages.
  • Please consider to use 2.X Python funciton as Python function in Azure function 1.X is experimental and new feature investments won't be added to 1.X Python function.
Sample Description Trigger In Bindings Out Bindings
cosmosdb-trigger-cosmosdb-in-binding Azure Functions CosmosDB Trigger Python Sample. The function simply read & dump documets which are added to or changed in Azure Cosmos DB by leveraging CosmosDB input binding CosmosDB CosmosDB NONE
blob-trigger-blob-in-out-bindings Azure Functions Blob Trigger Python Sample that simply read file from Azure Blob Storage and write an output file to Azure Blob Storage using Blob Storage input and output bindings respectively Blob Storage Blob Storage Blob Storage
queue-trigger-blob-in-bindings Azure Functions Queue Trigger Python Sample that obtain a blog file name from Queue as a queue message and read a file named the blog file name in Azure Blob Storage using Blob Input Binding Queue Storage Blob Storage NONE
queue-trigger-rssfeed-crawler Azure Functions Queue Trigger Python Sample that get RSS feed URL from Queue and dump all items that obtained from RSS feed Queue Storage NONE NONE
queue-trigger-tagging-images Azure Functions Queue Trigger Python Sample that tags images stored on Azure Blob Storage by using Cognitive Vision API Queue Storage NONE NONE
queue-trigger-sendgrid Azure Functions Queue Trigger Python Sample that send email by using SendGrid bindings Queue Storage NONE SendGrid
queue-trigger-cosmosdb-in-binding Azure Functions Queue Trigger that obtains a document ID from Queue as a queue message, select a document object from Cosmos DB by using the document ID, and finally dump the object Queue Storage CosmosDB NONE
http-trigger-dump-request Azure Functions HTTP Trigger Python Sample that get and dump HTTPS request info that the trigger receives HTTP NONE HTTP
blob-sas-token-generator Azure Function HTTP Trigger Python Sample that returns a SAS token for Azure Storage for the specified container and blob name HTTP NONE HTTP
timer-trigger-azuresearch-index-monitoring Azure Functions Timer Trigger Python Sample that get Azure Search index statistics via API and store the results into CosmosDB Timer NONE CosmosDB
eventhub-trigger-table-out-bindings Azure Functions EventHub Trigger Python Sample that read message (device info) in EventHub that sent from sender and write an output record to Azure Table Storage using Table bindings EventHub NONE Table Storage
proxies-simple-condition-matches Azure Functions Python Sample that re-write dynamic and static page url using Azure Functions Proxies HTTP NONE HTTP

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/yokawasa/azure-functions-python-samples

azure-functions-python-samples's People

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

azure-functions-python-samples's Issues

test and Trigger is not working

Hello
when I test this and I try the
HTTP Request body to include the following parameters:

{
'permission': '<Signed permission for shared access signature (Required)>',
'container': '<Container name to access (Required)>',
'blobname': '<Blob object name to access (Optional)>'
'ttl': '<Token time to live period in hours. 1hour by default (Optional)>'
}

I get the following errors

Invalid blob path specified : '{"body":" {'permission': "rwl",\r\n 'container': "sample-workitems\logomalek.jpg",\r\n 'ttl': 2\r\n }"}'. Blob identifiers must be in the format 'container/blob'.

please can you let us know what should we do? i am testing with python 3.7 - Azure function v2

Extract a compressed file within azure blob

Would be great if there is a function to extract compressed files within azure blob.
Could not find any ready or work around solution to do this.

What is the best way it can acheived as of today.

How do you parse a file posted to a HTTP Trigger

When posting a file to an Azure Function running Python, how can I get access to the binary file?

Using the command "request = open(os.environ['req'], encoding='utf8').read()" I see the following.

How can I get the file back into a binary file so I can work with it?

contents of the req file:

--------------------------75f5275367eceed8
Content-Disposition: form-data; name="file"; filename="2018-11-02-12-59-58.wav"
Content-Type: application/octet-stream

RIFF�( WAVEfmt � � � D� ��� � � data�_( ��������ëëͫͫثث������������ � �����!�!�,�,�6�6�A�A�K�K�V�V��`�k�k�u�u�����������������������������ɬɬӬӬ
����h���
��������
��t

| �
c���
--------------------------75f5275367eceed8
Content-Disposition: form-data; name="output"

json
--------------------------75f5275367eceed8--

Simple fix

localsettings.json missing comma near the end

Kudu tools not opening

Hi @yokawasa

The hyperlink in platform features to kudu tools is not responding and also
https://(your-function-app-name).scm.azurewebsites.net/ is not working.

Do you know what could be the reason?

its python function app

Thank you

examples of output binding to service bus queue

Is there a way to read/write from service bus queue using python? I know there might not be a way to using an explicit binding, but perhaps there's a manual way where we establish a connection and manually put a message on a service bus queue? My main interest is in triggering with servicebus and then output to servicebus

blob-in blob-out sample

Is there interest for a blob triggered, image watermarking sample?

Blob trigger -> input blob (image) -> watermarking with Pillow -> output blob (image)

I see no blob output as binary sample, and it's not very obvious how typing works for that case.

I can send a PR if the outlook is positive here.

[CosmosDB Trigger Sample] Need to retrieve only documents that actually created or updated

Currently cosmosDB Trigger Sample return all documents in the collection. This is a feature request that cosmosDB trigger sample retrieves only documents that actually created or updated.

[NOTE] if anyone know the way to achieve this in Python, please contribute to the project!

Azure functions || python httptrigger || client before deployment || error posting file

error
[12/09/2019 15:25:33] Error writing message type InvocationRequest to workerId: 44de9e70-9290-4fcb-a8e2-0a5d188e2f9a
[12/09/2019 15:25:33] System.Private.CoreLib: Error sending from server.

Post req from postman with File Key imgfile includeded in body - getting server error and the req never gets to the function
#####################

import logging
import azure.functions as func

def main(req: func.HttpRequest) -> func.HttpResponse:

logging.info('Python HTTP trigger function processed a request.')

decodeType = req.form['decodeType']

imgfile = req.files['imgfile']

#####.......#######

Function returns a 500 server error, function log says req_body being accessed before it is set

Successfully deployed the http trigger sas token generator to azure but when I test it using the azure test utility the console gives the following error.

2019-06-07T12:11:57.118 [Information] Executing 'Functions.GLNorton287Func' (Reason='This function was programmatically called via the host APIs.', Id=00cf0c14-75be-4070-b48e-292dfcefd3ae)
2019-06-07T12:11:57.222 [Information] Python HTTP trigger function processed a request.
2019-06-07T12:11:57.251 [Information] Executed 'Functions.GLNorton287Func' (Succeeded, Id=00cf0c14-75be-4070-b48e-292dfcefd3ae)ailure
Exception: UnboundLocalError: local variable 'req_body' referenced before assignment
Stack:   File "/home/site/wwwroot/.python_packages/lib/python3.6/site-packages/azure/functions_worker/dispatcher.py", line 300, in _handle__invocation_request
    self.__run_sync_func, invocation_id, fi.func, args)
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/site/wwwroot/.python_packages/lib/python3.6/site-packages/azure/functions_worker/dispatcher.py", line 389, in __run_sync_func
    return func(**params)
  File "/home/site/wwwroot/GLNorton287Func/__init__.py", line 164, in main
    permission = req_body.get('permission')

Any ideas why this is happening?

Thank you

John

Could use example for Http Trigger based file upload

I am trying to create a function app that has two parts:

  1. Http Trigger File upload which uploads a file to blob-storage
  2. Blob trigger that downloads the file and performs some operations.

From the examples that are provided it is clear how to imlement 2. But I cannot seem to find an example of an HTTP file upload, and I think it would make these examples very useful if one were to be included.

Cheers!

1 functions loaded; Generating 0 job function(s)

I am struggling to test one of the samples from this repository, eventhub-trigger-table-out-bindings, in Azure Functions Core Tools. It appears that I've successfully populated the connection strings in local.settings.json and resource names in function.json: the function loads without any errors. However, I get a message I don't understand staying:

No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).

It appears there is some distinction between "functions" and "job functions" (I know nothing about it), but this error message doesn't explain it and seems maybe intended for a different programming language? I don't know why the __init__.py file in eventhub-trigger-table-out-bindings doesn't qualify as a job function nor how to fix the problem. (It appears that there is a problem, because nothing happens when I run the associated send-event.py script to trigger the function.)

Here is the full output displayed when I launch local execution with Azure Functions Core Tools:

> func start

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

Azure Functions Core Tools (2.1.748 Commit hash: 5db20665cf0c11bedaffc96d81c9baef7456acb3)
Function Runtime Version: 2.0.12134.0
[11/13/2018 10:56:45 PM] Building host: startup suppressed:False, configuration suppressed: False
[11/13/2018 10:56:45 PM] Reading host configuration file 'C:\Users\mawah\Documents\dni\featurization\host.json'
[11/13/2018 10:56:45 PM] Host configuration file read:
[11/13/2018 10:56:45 PM] {
[11/13/2018 10:56:45 PM]   "version": "2.0"
[11/13/2018 10:56:45 PM] }
[11/13/2018 10:56:46 PM] Initializing Host.
[11/13/2018 10:56:46 PM] Host initialization: ConsecutiveErrors=0, StartupCount=1
[11/13/2018 10:56:46 PM] Starting JobHost
[11/13/2018 10:56:46 PM] Starting Host (HostId=37438110424-384678464, InstanceId=cc3bd0ed-d82f-4a4c-85da-0301b6824a16, Version=2.0.12134.0, ProcessId=9320, AppDomainId=1, Debug=False, FunctionsExtensionVersion=~2)
[11/13/2018 10:56:46 PM] Loading functions metadata
[11/13/2018 10:56:46 PM] 1 functions loaded
[11/13/2018 10:56:46 PM] Generating 0 job function(s)
[11/13/2018 10:56:46 PM] No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
[11/13/2018 10:56:46 PM] Host initialized (207ms)
[11/13/2018 10:56:47 PM] Host started (222ms)
[11/13/2018 10:56:47 PM] Job host started
Hosting environment: Production
Content root path: C:\Users\mawah\Documents\dni\featurization
Now listening on: http://0.0.0.0:7071
Application started. Press Ctrl+C to shut down.
Listening on http://0.0.0.0:7071/
Hit CTRL-C to exit...

Any advice appreciated!

How to UPSERT an item

Hi, I am using python Azure functions with CosmosDB output binding, I want to update my container regularly and the items need to be the latest copies, not the previous ones. the doc.set method gives 409 error since the items have the uid field same but some other field changes every time the function runs, lets say the timestamp, how can upsert the item? I cannot remove the unique key feature. Is there any other method than .set() ?

Sample does not show how to use blobname and blobextension

The blob-trigger-watermark-blob-out-binding example specifies two parts to a path pattern that should be accessible as arguments to the function, but it does not show how to do that.

function.json:
"path": "input/{blobname}.{blobextension}",

if you add them as arguments to the function get an error similar to:
FunctionLoadError: cannot load the DocTrigger function: the following parameters are declared in Python but not in function.json: {'orgId', 'jobId'}

CosmosDB output

I am trying to use cosmosdb (mongo) as an output based on the inputs you used.

data = {
    "timestamp": datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
    "image":"path/image.jpg",
    "device":subject.split(",")[1],
    "detected":"false",
    "detection_type":"null"
}

with open(os.environ['outputCosmosDB'], 'wb') as f:
    json.dump(data,f)

I keep getting this error when I explore the data in cosmosdb:

Detected corrupted documents without _id identifier, verify that you are only storing documents through Mongo protocol and not SQL API or DocumentDB SDK.

How should this be done? Would really appreciate an example on this too, your code has been super helpfull

How to use Timer output

Thank you for sharing these code samples of using azure functions. I am learning how to use it now it is helpful. I have one concern today of how to add input and output in Timer function. From the official document function reference I read that "Input" and "Output" bindings seem to be not allowed in Timer functions.

Bindings
Type | 1.x | 2.x1 | Trigger | Input | Output|
Timer | ✔ | ✔ | ✔ |  -- | -- |

I also spent some time to research the material on the web and think a workaround to reloved this. This is because my project manager ask me to move the VM script to azure functions.

When i saw your code example of Timer i think maybe this is what i want. But, can you explain this to me?

{
      "type": "documentDB",
      "name": "outputDocument",
      "databaseName": "functions2docdb",
      "collectionName": "indexstats",
      "createIfNotExists": true,
      "connection": "<Connection string for your documentdb account>",
      "direction": "out"
    }

How can you use the "direction": "out"? This usage seems contrdict to the Microsoft azure functions document usage.

Thanks.

How to import a custom python module file into azure function

How to import a custom python module file into azure function.
My python class needs to import my custom class. For instance

import os
import time
from optparse import OptionParser
**from mlutil import HTMLPath**

How can I upload/where to upload my mlutil.py file so that my import from mlutil class won't throw error in my azure function ?

[question] pass data from function code to function.json

Hi @yokawasa,

I hope you are doing well.

Do you know if is possible to pass data from the azure function code to the function.json in order to dynamically name the blob file in the container?

I am using this function.json, but the output filename in my case is:

"path": "integration-portopt/daniel/mx-uat-report-{blobname}-{DateTime}.json",

I would like to make the "uat" name dynamically so that from the code I can pass the uat, dev, or prod values. Do you know if this is possible with azure functions without using an external SDK?

One thing I woluld like to know that about azure functions by written python3

First of all, Thank you for my PR.

At this moment, I wolud like to make automatically python crawler application included http.
But, I don't know how to use Azure function effiently

As your repository, 'https://github.com/yokawasa/azure-functions-python-samples/tree/master/blob-trigger-blob-in-out-bindings' mention that using blob storage seems like possible.

why I need blob storage is that I would like make .csv files from python3 files then I stores those .csv files to Blob storage

How can I solve this problem??

Again, I would like make the process automatically crawer written by pyhton3 with Azure functions. What is the most effient way to make the process ?

Thank you.

Output Cosmos Multi documents

In C# it is possible to output more than one document to cosmos. Is there a way to output in python as well more than one document.

It works with one document but I found now way to pass to doc.set a array

ModuleNotFoundError when using virtual environments in VS Code

Environment data

VS Code version: 1.19.0
Python Extension version: 0.2.3
Python Version: 3.6.3
OS and version: Windows 10 x64 bit

I am trying to run python app that runs on a virtual environment perfectly with no issues. When i copy this code to run in VS Code as azure function i get the following error:

from fbprophet import Prophet\r\nModuleNotFoundError: No module named 'fbprophet'\r\n","errorDetails":"Microsoft.Azure.WebJobs.Host.FunctionInvocationException : Exception while executing function: Functions.MLLoaderInsight

I am expecting to run this app in VS Code with no issues as i run it on IPython on the same machine using the same virtual environment.

Full code of the app to test loading a prophet model in azure function app in VS Code:

import pickle
from fbprophet import Prophet

# load the model from disk
filename = "c:/prophet_quickstart_model.sav"

with open(filename, "rb") as input_file:
    m=pickle.load(input_file)


future = m.make_future_dataframe(periods=100)
future.tail()

forecast = m.predict(future)
forecast[['ds', 'yhat', 'yhat_lower', 'yhat_upper']].tail()

A screen shot below shows the selected virtual envionment in VS Code which case prophet package:

image

Output from TERMINAL Window in VS Code:

Response Status Code: InternalServerError
{"id":"9fbd89de-bf6c-4d35-b8b7-46c43ebe6151","requestId":"50d80248-c769-496d-a587-95730e5065cc","statusCode":500,"errorCode":0,"messsage":"Exception while executing function: Functions.MLLoaderInsight -> Traceback (most recent call last):\r\n  File \"C:\\ColumbiaCode\\InsightsPython\\MLLoaderInsight\\run.py\", line 3, in <module>\r\n    from fbprophet import Prophet\r\nModuleNotFoundError: No module named 'fbprophet'\r\n","errorDetails":"Microsoft.Azure.WebJobs.Host.FunctionInvocationException : Exception while executing function: Functions.MLLoaderInsight ---> System.ApplicationException : Traceback (most recent call last):\r\n  File \"C:\\ColumbiaCode\\InsightsPython\\MLLoaderInsight\\run.py\", line 3, in <module>\r\n    from fbprophet import Prophet\r\nModuleNotFoundError: No module named 'fbprophet'\r\n\r\n   at async Microsoft.Azure.WebJobs.Script.Description.ScriptFunctionInvoker.ExecuteScriptAsync(String path,String arguments,Object[] invocationParameters,FunctionInvocationContext context)\r\n   at async Microsoft.Azure.WebJobs.Script.Description.ScriptFunctionInvoker.InvokeCore(Object[] parameters,FunctionInvocationContext context)\r\n   at async Microsoft.Azure.WebJobs.Script.Description.FunctionInvokerBase.Invoke(Object[] parameters)\r\n   at async Microsoft.Azure.WebJobs.Host.Executors.FunctionInvoker`1.InvokeAsync[TReflected](Object[] arguments)\r\n   at async Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.InvokeAsync(IFunctionInvoker invoker,Object[] invokeParameters,CancellationTokenSource timeoutTokenSource,CancellationTokenSource functionCancellationTokenSource,Boolean throwOnTimeout,TimeSpan timerInterval,IFunctionInstance instance)\r\n   at async Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithWatchersAsync(IFunctionInstance instance,IReadOnlyDictionary`2 parameters,TraceWriter traceWriter,ILogger logger,CancellationTokenSource functionCancellationTokenSource)\r\n   at async Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithLoggingAsync(??)\r\n   at async Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithLoggingAsync(??) \r\n   End of inner exception\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at async
Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithLoggingAsync(??)\r\n   at async Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.TryExecuteAsync(IFunctionInstance functionInstance,CancellationToken cancellationToken)\r\n   at Microsoft.Azure.WebJobs.Host.Executors.ExceptionDispatchInfoDelayedException.Throw()\r\n   at async Microsoft.Azure.WebJobs.JobHost.CallAsyncCore(MethodInfo method,IDictionary`2 arguments,CancellationToken cancellationToken)\r\n
at async Microsoft.Azure.WebJobs.Script.ScriptHost.CallAsync(String method,Dictionary`2 arguments,CancellationToken cancellationToken)\r\n   at async Microsoft.Azure.WebJobs.Script.WebHost.WebScriptHostManager.HandleRequestAsync(FunctionDescriptor function,HttpRequestMessage request,CancellationToken cancellationToken)\r\n   at async Microsoft.Azure.WebJobs.Script.WebHost.Controllers.FunctionsController.ProcessRequestAsync(HttpRequestMessage request,FunctionDescriptor function,CancellationToken cancellationToken)\r\n   at async Microsoft.Azure.WebJobs.Script.WebHost.Controllers.FunctionsController.<>c__DisplayClass3_0.<ExecuteAsync>b__0(??)\r\n   at async Microsoft.Azure.WebJobs.Extensions.Http.HttpRequestManager.ProcessRequestAsync(HttpRequestMessage request,Func`3 processRequestHandler,CancellationToken cancellationToken)\r\n   at async Microsoft.Azure.WebJobs.Script.WebHost.Controllers.FunctionsController.ExecuteAsync(HttpControllerContext controllerContext,CancellationToken cancellationToken)\r\n   at async System.Web.Http.Dispatcher.HttpControllerDispatcher.SendAsync(HttpRequestMessage request,CancellationToken cancellationToken)\r\n   at async System.Web.Http.Dispatcher.HttpControllerDispatcher.SendAsync(HttpRequestMessage request,CancellationToken cancellationToken)\r\n   at async Microsoft.Azure.WebJobs.Script.WebHost.Handlers.SystemTraceHandler.SendAsync(HttpRequestMessage request,CancellationToken cancellationToken)\r\n   at async Microsoft.Azure.WebJobs.Script.WebHost.Handlers.WebScriptHostHandler.SendAsync(HttpRequestMessage request,CancellationToken cancellationToken)\r\n   at async System.Web.Http.HttpServer.SendAsync(HttpRequestMessage request,CancellationToken cancellationToken)"}

Any help is appreciated.

Unhandled exception in request pipeline: System.Net.Http.HttpRequestException: Connection refused

I was trying to run sample code(:v2functions/blob-trigger-watermark-blob-out-binding)
after uploading the image,I see this error pasted below.
I am getting error :

�[41m�[30mfail�[39m�[22m�[49m: Middleware[0]
2020-09-17T17:20:29.688239244Z: [INFO] Unhandled exception in request pipeline: System.Net.Http.HttpRequestException: Connection refused
2020-09-17T17:20:29.688247643Z: [INFO] ---> System.Net.Sockets.SocketException (111): Connection refused
2020-09-17T17:20:29.690374430Z: [INFO] at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
2020-09-17T17:20:29.690390930Z: [INFO] --- End of inner exception stack trace ---
2020-09-17T17:20:29.690396930Z: [INFO] at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
2020-09-17T17:20:29.690784128Z: [INFO] at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken)
2020-09-17T17:20:29.690797528Z: [INFO] at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
2020-09-17T17:20:29.690802928Z: [INFO] at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
2020-09-17T17:20:29.690807628Z: [INFO] at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
2020-09-17T17:20:29.690812228Z: [INFO] at System.Net.Http.DiagnosticsHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
2020-09-17T17:20:29.690817228Z: [INFO] at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) 2020-09-17T17:20:29.690822128Z: [INFO] at Microsoft.Azure.AppService.MiddlewareShim.Startup.ForwardRequestAsync(HttpContext context) in /EasyAuth/Middleware.Host/Startup.cs:line 197 2020-09-17T17:20:29.690826728Z: [INFO] at Microsoft.Azure.AppService.MiddlewareShim.Startup.OnRequest(HttpContext context) in /EasyAuth/Middleware.Host/Startup.cs:line 151 2020-09-17T17:20:29.694881303Z: [INFO] �[41m�[30mfail�[39m�[22m�[49m: Microsoft.AspNetCore.Server.Kestrel[13] 2020-09-17T17:20:29.694899302Z: [INFO] Connection id "0HM2R5NDLDREG", Request id "0HM2R5NDLDREG:00000001": An unhandled exception was thrown by the application. 2020-09-17T17:20:29.694905702Z: [INFO] System.Net.Http.HttpRequestException: Connection refused 2020-09-17T17:20:29.695281200Z: [INFO] ---> System.Net.Sockets.SocketException (111): Connection refused 2020-09-17T17:20:29.695294000Z: [INFO] at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) 2020-09-17T17:20:29.695299400Z: [INFO] --- End of inner exception stack trace --- 2020-09-17T17:20:29.695303700Z: [INFO] at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) 2020-09-17T17:20:29.695308200Z: [INFO] at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken) 2020-09-17T17:20:29.695313200Z: [INFO] at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) 2020-09-17T17:20:29.695325400Z: [INFO] at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) 2020-09-17T17:20:29.695330200Z: [INFO] at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) 2020-09-17T17:20:29.695334700Z: [INFO] at System.Net.Http.DiagnosticsHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) 2020-09-17T17:20:29.695880996Z: [INFO] at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
2020-09-17T17:20:29.695897196Z: [INFO] at Microsoft.Azure.AppService.MiddlewareShim.Startup.ForwardRequestAsync(HttpContext context) in /EasyAuth/Middleware.Host/Startup.cs:line 197
2020-09-17T17:20:29.695902896Z: [INFO] at Microsoft.Azure.AppService.MiddlewareShim.Startup.OnRequest(HttpContext context) in /EasyAuth/Middleware.Host/Startup.cs:line 151
2020-09-17T17:20:29.695907496Z: [INFO] at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
2020-09-17T17:20:44.568918921Z: [INFO] Starting OpenBSD Secure Shell server: sshd.

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.