Skip to content

Conversation

elprans
Copy link
Collaborator

@elprans elprans commented Jun 26, 2018

Fixes: #133

@elprans elprans changed the title Add support for ServiceBus bindings [WIP, do not merge] Add support for ServiceBus bindings Jun 26, 2018
@elprans elprans requested a review from pragnagopa June 26, 2018 18:28
"disabled": false,
"bindings": [
{
"type": "httpTrigger",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

serviceBusTrigger?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ServiceBusQueue Trigger sample

"bindings": [
    {
      "name": "myQueueItem",
      "type": "serviceBusTrigger",
      "direction": "in",
      "queueName": "myqueue",
      "connection": "pgopafunctestsb_RootManageSharedAccessKey_SERVICEBUS",
      "accessRights": "Manage"
    }

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this is not a trigger. This is an http-triggered check to see if a trigger has fired. Similar to other bindings.

{
"type": "httpTrigger",
"direction": "in",
"name": "req"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ServiceBusTopic Trigger

"bindings": [
    {
      "name": "mySbMsg",
      "type": "serviceBusTrigger",
      "direction": "in",
      "topicName": "mytopic",
      "subscriptionName": "mysubscription",
      "connection": "pgopafunctestsb_RootManageSharedAccessKey_SERVICEBUS",
      "accessRights": "Manage"
    }
  ],

@pragnagopa
Copy link
Member

Update the tests and let me know if still does not work

@@ -0,0 +1,21 @@
{
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the actual trigger function.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the documentation https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-service-bus looks like we only have OutputBinding and ServiceBusTrigger.

Copy link
Collaborator Author

@elprans elprans Jun 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I don't understand. This is a "serviceBusTrigger" function. It does get triggered. My issue is that the data passed by the host to the trigger is incorrect.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is the function triggerred? Are you using storage sdk to input values into ServiceBusQueue?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put a message into a queue by calling another function with an output binding.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add link to that test here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's in the last file in this PR.

function.json:

{
  "scriptFile": "__init__.py",
  "disabled": false,

  "bindings": [
    {
      "type": "httpTrigger",
      "direction": "in",
      "name": "req"
    },
    {
      "direction": "out",
      "name": "msg",
      "queueName": "testqueue",
      "connection": "AzureWebJobsServiceBusConnectionString",
      "type": "serviceBus"
    },
    {
      "direction": "out",
      "name": "$return",
      "type": "http"
    }
  ]
}

init.py:

import azure.functions as azf


def main(req: azf.HttpRequest, msg: azf.Out[str]):
    msg.set(req.get_body())

    return 'OK'

import azure.functions as azf


def main(msg: azf.QueueMessage) -> bytes:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I am looking at the right file. Is this right? QueueMessage? Should it be ServiceBusMessage? It will be easier if you just paste function.json, init.py

Copy link
Collaborator Author

@elprans elprans Jun 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, that's a different trigger, disregard it for now. The correct trigger is in tests/servicebus_functions/servicebus_trigger/__init__.py:

import json

import azure.functions as azf


def main(msg: azf.ServiceBusMessage) -> str:
    result = json.dumps({
        'message_id': msg.message_id,
        'body': msg.get_body().decode('utf-8'),  # the body here is invalid 
        'content_type': msg.content_type,
        'expiration_time': msg.expiration_time,
        'label': msg.label,
        'partition_key': msg.partition_key,
        'reply_to': msg.reply_to,
        'reply_to_session_id': msg.reply_to_session_id,
        'scheduled_enqueue_time': msg.scheduled_enqueue_time,
        'session_id': msg.session_id,
        'time_to_live': msg.time_to_live,
        'to': msg.to,
        'user_properties': msg.user_properties,
    })

    return result

function.json:

{
  "scriptFile": "__init__.py",
  "disabled": false,

  "bindings": [
    {
      "type": "serviceBusTrigger",
      "direction": "in",
      "name": "msg",
      "queueName": "testqueue",
      "connection": "AzureWebJobsServiceBusConnectionString",
    },
    {
      "type": "blob",
      "direction": "out",
      "name": "$return",
      "connection": "AzureWebJobsStorage",
      "path": "python-worker-tests/test-servicebus-triggered.txt"
    }
  ]
}

Copy link
Member

@pragnagopa pragnagopa Jun 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. This helps. Test code that inserts msg into testqueue?

Copy link
Member

@pragnagopa pragnagopa Jun 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried different variations with JavaScript functions - HttpTrigger to ServiceBus Output binding and then verifying serviceBusTrigger gets invoked. I cannot repro this issue.

function.json and test that triggers looks OK.

At this point, we need to debug host. Here are the instructions, please give it a try

@pragnagopa
Copy link
Member

cc: @soninaren - To help unblock while I am OOF

@elprans
Copy link
Collaborator Author

elprans commented Jun 28, 2018

@asavaritayal @soninaren

Here's how the worker is putting the message into the queue:

trce: Worker.python.dc1036ce-8a25-4fa9-9311-189562f33dd5[0]
      {
        "Origin": "Worker",
        "MessageType": "InvocationResponse",
        "WorkerId": "dc1036ce-8a25-4fa9-9311-189562f33dd5",
        "Message": {
          "RequestId": "13125894-8b3b-409a-bd0e-de57b5226650",
          "InvocationResponse": {
            "InvocationId": "06ea352e-e884-4ce1-8fc1-48fc84edc6e8",
            "OutputData": [
              {
                "Name": "msg",
                "Data": {
                  "String": "",
                  "Json": "",
                  "Bytes": [
                    116,
                    101,
                    115,
                    116,
                    45,
                    109,
                    101,
                    115,
                    115,
                    97,
                    103,
                    101
                  ],
                  "Stream": [],
                  "Int": 0,
                  "Double": 0.0,
                  "DataCase": "Bytes"
                }
              }
            ],
            "ReturnValue": {
              "String": "OK",
              "Json": "",
              "Bytes": [],
              "Stream": [],
              "Int": 0,
              "Double": 0.0,
              "DataCase": "String"
            },
            "Result": {
              "Status": "Success",
              "Result": "",
              "Logs": []
            }
          },
          "ContentCase": "InvocationResponse"
        },
        "Name": "InvocationResponse",
        "Source": "Rpc"
      }

Notice that the service bus message data is returned as a byte array. However, when the serviceBusTrigger is fired, the worker is sent the following:

trce: Worker.python.dc1036ce-8a25-4fa9-9311-189562f33dd5[0]
      => System.Collections.Generic.Dictionary`2[System.String,System.Object]
      {
        "Origin": "Host",
        "MessageType": "InvocationRequest",
        "WorkerId": "dc1036ce-8a25-4fa9-9311-189562f33dd5",
        "Message": {
          "RequestId": "",
          "InvocationRequest": {
            "InvocationId": "676e0dbd-b2d6-4909-838a-22f8a72d4cc7",
            "FunctionId": "13972e81-2479-4bc7-ad0e-589830026c12",
            "InputData": [
              {
                "Name": "msg",
                "Data": {
                  "String": "System.Byte[]",
                  "Json": "",
                  "Bytes": [],
                  "Stream": [],
                  "Int": 0,
                  "Double": 0.0,
                  "DataCase": "String"
                }
              }
            ],
            "TriggerMetadata": {
              "DeliveryCount": {
                "String": "",
                "Json": "1",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "Json"
              },
              "DeadLetterSource": {
                "String": "",
                "Json": "",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "None"
              },
              "ExpiresAtUtc": {
                "String": "",
                "Json": "\"2018-07-12T14:36:59.104Z\"",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "Json"
              },
              "EnqueuedTimeUtc": {
                "String": "",
                "Json": "\"2018-06-28T14:36:59.104Z\"",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "Json"
              },
              "MessageId": {
                "String": "cf6fa1fe04ac4cd19b6b625bd284e51c",
                "Json": "",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "String"
              },
              "ContentType": {
                "String": "text/plain",
                "Json": "",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "String"
              },
              "ReplyTo": {
                "String": "",
                "Json": "",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "None"
              },
              "SequenceNumber": {
                "String": "",
                "Json": "31806672368304129",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "Json"
              },
              "To": {
                "String": "",
                "Json": "",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "None"
              },
              "Label": {
                "String": "",
                "Json": "",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "None"
              },
              "CorrelationId": {
                "String": "",
                "Json": "",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "None"
              },
              "UserProperties": {
                "String": "",
                "Json": "{\"$AzureWebJobsParentId\":\"06ea352e-e884-4ce1-8fc1-48fc84edc6e8\",\"x-opt-enqueue-sequence-number\":0}",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "Json"
              },
              "sys": {
                "String": "",
                "Json": "{\"MethodName\":\"servicebus_trigger\",\"UtcNow\":\"2018-06-28T14:36:59.2639206Z\",\"RandGuid\":\"1476de8c-1ae2-4005-a4e2-4eae017ecd46\"}",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "Json"
              }
            }
          },
          "ContentCase": "InvocationRequest"
        },
        "Name": "InvocationRequest",
        "Source": "Rpc"
      }

Note that instead of the original byte array, the message body is instead sent as a String containing Byte[]. I suspect that the bug is not actually in the RPC exchange layer, but rather somewhere in the ServiceBus pipeline (either in the extension, or in the backend). This is because other bindings that exchange data as bytes are OK.

Full trace follows:

Hosting environment: Production
Content root path: /home/elvis/dev/clients/microsoft/azure-functions-python-worker/tests/servicebus_functions
Now listening on: http://[::]:43941
trce: Host.Startup[0]
      Host configuration applied.
info: Host.Startup[0]
      Reading host configuration file '/home/elvis/dev/clients/microsoft/azure-functions-python-worker/tests/servicebus_functions/host.json'
info: Host.Startup[0]
      Host configuration file read:
      {
        "functionTimeout": "00:05:00",
        "http": {
          "routePrefix": "api",
          "maxConcurrentRequests": 5,
          "maxOutstandingRequests": 30
        },
        "queues": {
          "visibilityTimeout": "00:00:10"
        },
        "eventHub": {
          "maxBatchSize": 1000,
          "prefetchCount": 1000,
          "batchCheckpointFrequency": 1
        },
        "logger": {
          "categoryFilter": {
            "defaultLevel": "Trace"
          },
          "categoryLevels": {
            "Worker": "Trace"
          }
        },
        "healthMonitor": {
          "enabled": true,
          "healthCheckInterval": "00:00:10",
          "healthCheckWindow": "00:02:00",
          "healthCheckThreshold": 6,
          "counterThreshold": 0.8
        }
      }
info: Host.General[0]
      Starting Host (HostId=hammer-1249687861, InstanceId=b931b9de-6ad3-4e89-aa86-53c8fd2b3fc0, Version=2.0.11886.0, ProcessId=25870, AppDomainId=1, Debug=False, ConsecutiveErrors=0, StartupCount=1, FunctionsExtensionVersion=)
trce: Host.Startup[0]
      Debug file watch initialized.
trce: Host.Startup[0]
      File event source initialized.
trce: Host.Startup[0]
      Workers Directory set to: /home/elvis/dev/clients/microsoft/azure-functions-python-worker/build/webhost/workers
trce: Host.Startup[0]
      Loading worker providers from the workers directory: /home/elvis/dev/clients/microsoft/azure-functions-python-worker/build/webhost/workers
trce: Host.Startup[0]
      Found worker config: /home/elvis/dev/clients/microsoft/azure-functions-python-worker/build/webhost/workers/node/worker.config.json
trce: Host.Startup[0]
      Will load worker provider for language: node
trce: Host.Startup[0]
      Found worker config: /home/elvis/dev/clients/microsoft/azure-functions-python-worker/python/worker.config.json
trce: Host.Startup[0]
      Will load worker provider for language: python
trce: Host.Startup[0]
      Worker path for language worker java: /home/elvis/dev/clients/microsoft/azure-functions-python-worker/build/webhost/workers/java
trce: Host.Startup[0]
      Worker path for language worker node: /home/elvis/dev/clients/microsoft/azure-functions-python-worker/build/webhost/workers/node
trce: Host.Startup[0]
      Worker path for language worker python: /home/elvis/dev/clients/microsoft/azure-functions-python-worker/python
trce: Host.Startup[0]
      Function metadata read.
trce: Host.Startup[0]
      Binding providers loaded.
trce: Host.Startup[0]
      Binding providers initialized.
info: Host.Startup[0]
      Loading custom extension 'ServiceBusExtensionConfig'
info: Host.Startup[0]
      Loaded custom extension: ServiceBusExtensionConfig from '/home/elvis/dev/clients/microsoft/azure-functions-python-worker/tests/servicebus_functions/bin/Microsoft.Azure.WebJobs.ServiceBus.dll'
info: Host.Startup[0]
      Loading custom extension 'EventGridExtensionConfig'
info: Host.Startup[0]
      Loaded custom extension: EventGridExtensionConfig from '/home/elvis/dev/clients/microsoft/azure-functions-python-worker/tests/servicebus_functions/bin/Microsoft.Azure.WebJobs.Extensions.EventGrid.dll'
info: Host.Startup[0]
      Loading custom extension 'EventHubConfiguration'
info: Host.Startup[0]
      Loaded custom extension: EventHubConfiguration from '/home/elvis/dev/clients/microsoft/azure-functions-python-worker/tests/servicebus_functions/bin/Microsoft.Azure.WebJobs.EventHubs.dll'
info: Host.Startup[0]
      Loading custom extension 'CosmosDBConfiguration'
info: Host.Startup[0]
      Loaded custom extension: CosmosDBConfiguration from '/home/elvis/dev/clients/microsoft/azure-functions-python-worker/tests/servicebus_functions/bin/Microsoft.Azure.WebJobs.Extensions.CosmosDB.dll'
trce: Host.Startup[0]
      Extension loading complete.
trce: Host.Startup[0]
      Metadata provider created.
trce: Host.Startup[0]
      Adding Function descriptor providers for all languages.
info: Worker.python.dc1036ce-8a25-4fa9-9311-189562f33dd5[0]
      Start Process: python  "/home/elvis/dev/clients/microsoft/azure-functions-python-worker/python/worker.py" --host 127.0.0.1 --port 46065 --workerId dc1036ce-8a25-4fa9-9311-189562f33dd5 --requestId 13125894-8b3b-409a-bd0e-de57b5226650 --grpcMaxMessageLength 134217728
trce: Host.Startup[0]
      Function descriptors created.
info: Host.Startup[0]
      Generating 6 job function(s)
info: Host.Startup[0]
      Found the following functions:
      Host.Functions.put_message
      Host.Functions.get_servicebus_triggered
      Host.Functions.servicebus_trigger_return
      Host.Functions.put_message_return
      Host.Functions.ping
      Host.Functions.servicebus_trigger
      
info: Host.Startup[0]
      Host initialized (530ms)
trce: Worker.python.dc1036ce-8a25-4fa9-9311-189562f33dd5[0]
      {
        "Origin": "Worker",
        "MessageType": "StartStream",
        "WorkerId": "dc1036ce-8a25-4fa9-9311-189562f33dd5",
        "Message": {
          "RequestId": "13125894-8b3b-409a-bd0e-de57b5226650",
          "StartStream": {
            "WorkerId": "dc1036ce-8a25-4fa9-9311-189562f33dd5"
          },
          "ContentCase": "StartStream"
        },
        "Name": "StartStream",
        "Source": "Rpc"
      }
info: Function.ping[0]
      => System.Collections.Generic.Dictionary`2[System.String,System.Object] => System.Collections.Generic.Dictionary`2[System.String,System.Object]
      Executing 'Functions.ping' (Reason='This function was programmatically called via the host APIs.', Id=a94d2258-c8e5-4d0e-9b6a-f69f4a7f5a0e)
trce: Worker.python.dc1036ce-8a25-4fa9-9311-189562f33dd5[0]
      {
        "Origin": "Host",
        "MessageType": "WorkerInitRequest",
        "WorkerId": "dc1036ce-8a25-4fa9-9311-189562f33dd5",
        "Message": {
          "RequestId": "",
          "WorkerInitRequest": {
            "HostVersion": "2.0.11886.0",
            "Capabilities": {},
            "LogCategories": {}
          },
          "ContentCase": "WorkerInitRequest"
        },
        "Name": "WorkerInitRequest",
        "Source": "Rpc"
      }
trce: Worker.python.dc1036ce-8a25-4fa9-9311-189562f33dd5[0]
      {
        "Origin": "Worker",
        "MessageType": "WorkerInitResponse",
        "WorkerId": "dc1036ce-8a25-4fa9-9311-189562f33dd5",
        "Message": {
          "RequestId": "13125894-8b3b-409a-bd0e-de57b5226650",
          "WorkerInitResponse": {
            "WorkerVersion": "",
            "Capabilities": {},
            "Result": {
              "Status": "Success",
              "Result": "",
              "Logs": []
            }
          },
          "ContentCase": "WorkerInitResponse"
        },
        "Name": "WorkerInitResponse",
        "Source": "Rpc"
      }
trce: Worker.python.dc1036ce-8a25-4fa9-9311-189562f33dd5[0]
      {
        "Origin": "Host",
        "MessageType": "FunctionLoadRequest",
        "WorkerId": "dc1036ce-8a25-4fa9-9311-189562f33dd5",
        "Message": {
          "RequestId": "",
          "FunctionLoadRequest": {
            "FunctionId": "f794561b-2d65-4155-8e55-1b61d4264342",
            "Metadata": {
              "Name": "put_message",
              "Directory": "/home/elvis/dev/clients/microsoft/azure-functions-python-worker/tests/servicebus_functions/put_message",
              "ScriptFile": "/home/elvis/dev/clients/microsoft/azure-functions-python-worker/tests/servicebus_functions/put_message/__init__.py",
              "EntryPoint": "",
              "Bindings": {
                "req": {
                  "Type": "httpTrigger",
                  "Direction": "In"
                },
                "msg": {
                  "Type": "serviceBus",
                  "Direction": "Out"
                },
                "$return": {
                  "Type": "http",
                  "Direction": "Out"
                }
              }
            }
          },
          "ContentCase": "FunctionLoadRequest"
        },
        "Name": "FunctionLoadRequest",
        "Source": "Rpc"
      }
trce: Worker.python.dc1036ce-8a25-4fa9-9311-189562f33dd5[0]
      {
        "Origin": "Host",
        "MessageType": "FunctionLoadRequest",
        "WorkerId": "dc1036ce-8a25-4fa9-9311-189562f33dd5",
        "Message": {
          "RequestId": "",
          "FunctionLoadRequest": {
            "FunctionId": "de386601-9775-42c9-bb0e-a61629a0266a",
            "Metadata": {
              "Name": "get_servicebus_triggered",
              "Directory": "/home/elvis/dev/clients/microsoft/azure-functions-python-worker/tests/servicebus_functions/get_servicebus_triggered",
              "ScriptFile": "/home/elvis/dev/clients/microsoft/azure-functions-python-worker/tests/servicebus_functions/get_servicebus_triggered/__init__.py",
              "EntryPoint": "",
              "Bindings": {
                "req": {
                  "Type": "httpTrigger",
                  "Direction": "In"
                },
                "file": {
                  "Type": "blob",
                  "Direction": "In"
                },
                "$return": {
                  "Type": "http",
                  "Direction": "Out"
                }
              }
            }
          },
          "ContentCase": "FunctionLoadRequest"
        },
        "Name": "FunctionLoadRequest",
        "Source": "Rpc"
      }
trce: Worker.python.dc1036ce-8a25-4fa9-9311-189562f33dd5[0]
      {
        "Origin": "Host",
        "MessageType": "FunctionLoadRequest",
        "WorkerId": "dc1036ce-8a25-4fa9-9311-189562f33dd5",
        "Message": {
          "RequestId": "",
          "FunctionLoadRequest": {
            "FunctionId": "8c6ea960-b231-4e68-ba6e-f16997a4e459",
            "Metadata": {
              "Name": "servicebus_trigger_return",
              "Directory": "/home/elvis/dev/clients/microsoft/azure-functions-python-worker/tests/servicebus_functions/servicebus_trigger_return",
              "ScriptFile": "/home/elvis/dev/clients/microsoft/azure-functions-python-worker/tests/servicebus_functions/servicebus_trigger_return/__init__.py",
              "EntryPoint": "",
              "Bindings": {
                "msg": {
                  "Type": "serviceBusTrigger",
                  "Direction": "In"
                },
                "$return": {
                  "Type": "blob",
                  "Direction": "Out"
                }
              }
            }
          },
          "ContentCase": "FunctionLoadRequest"
        },
        "Name": "FunctionLoadRequest",
        "Source": "Rpc"
      }
trce: Worker.python.dc1036ce-8a25-4fa9-9311-189562f33dd5[0]
      {
        "Origin": "Host",
        "MessageType": "FunctionLoadRequest",
        "WorkerId": "dc1036ce-8a25-4fa9-9311-189562f33dd5",
        "Message": {
          "RequestId": "",
          "FunctionLoadRequest": {
            "FunctionId": "18523f22-85fd-463c-80cb-7d8d5966153a",
            "Metadata": {
              "Name": "put_message_return",
              "Directory": "/home/elvis/dev/clients/microsoft/azure-functions-python-worker/tests/servicebus_functions/put_message_return",
              "ScriptFile": "/home/elvis/dev/clients/microsoft/azure-functions-python-worker/tests/servicebus_functions/put_message_return/__init__.py",
              "EntryPoint": "",
              "Bindings": {
                "req": {
                  "Type": "httpTrigger",
                  "Direction": "In"
                },
                "$return": {
                  "Type": "serviceBus",
                  "Direction": "Out"
                }
              }
            }
          },
          "ContentCase": "FunctionLoadRequest"
        },
        "Name": "FunctionLoadRequest",
        "Source": "Rpc"
      }
trce: Worker.python.dc1036ce-8a25-4fa9-9311-189562f33dd5[0]
      {
        "Origin": "Host",
        "MessageType": "FunctionLoadRequest",
        "WorkerId": "dc1036ce-8a25-4fa9-9311-189562f33dd5",
        "Message": {
          "RequestId": "",
          "FunctionLoadRequest": {
            "FunctionId": "36eeb8c8-13c6-4019-9ded-ae8da09b6fbc",
            "Metadata": {
              "Name": "ping",
              "Directory": "/home/elvis/dev/clients/microsoft/azure-functions-python-worker/tests/servicebus_functions/ping",
              "ScriptFile": "/home/elvis/dev/clients/microsoft/azure-functions-python-worker/tests/servicebus_functions/ping/main.py",
              "EntryPoint": "",
              "Bindings": {
                "req": {
                  "Type": "httpTrigger",
                  "Direction": "In"
                }
              }
            }
          },
          "ContentCase": "FunctionLoadRequest"
        },
        "Name": "FunctionLoadRequest",
        "Source": "Rpc"
      }
trce: Worker.python.dc1036ce-8a25-4fa9-9311-189562f33dd5[0]
      {
        "Origin": "Host",
        "MessageType": "FunctionLoadRequest",
        "WorkerId": "dc1036ce-8a25-4fa9-9311-189562f33dd5",
        "Message": {
          "RequestId": "",
          "FunctionLoadRequest": {
            "FunctionId": "13972e81-2479-4bc7-ad0e-589830026c12",
            "Metadata": {
              "Name": "servicebus_trigger",
              "Directory": "/home/elvis/dev/clients/microsoft/azure-functions-python-worker/tests/servicebus_functions/servicebus_trigger",
              "ScriptFile": "/home/elvis/dev/clients/microsoft/azure-functions-python-worker/tests/servicebus_functions/servicebus_trigger/__init__.py",
              "EntryPoint": "",
              "Bindings": {
                "msg": {
                  "Type": "serviceBusTrigger",
                  "Direction": "In"
                },
                "$return": {
                  "Type": "blob",
                  "Direction": "Out"
                }
              }
            }
          },
          "ContentCase": "FunctionLoadRequest"
        },
        "Name": "FunctionLoadRequest",
        "Source": "Rpc"
      }
trce: Worker.python.dc1036ce-8a25-4fa9-9311-189562f33dd5[0]
      {
        "Origin": "Worker",
        "MessageType": "FunctionLoadResponse",
        "WorkerId": "dc1036ce-8a25-4fa9-9311-189562f33dd5",
        "Message": {
          "RequestId": "13125894-8b3b-409a-bd0e-de57b5226650",
          "FunctionLoadResponse": {
            "FunctionId": "f794561b-2d65-4155-8e55-1b61d4264342",
            "Result": {
              "Status": "Success",
              "Result": "",
              "Logs": []
            }
          },
          "ContentCase": "FunctionLoadResponse"
        },
        "Name": "FunctionLoadResponse",
        "Source": "Rpc"
      }
trce: Worker.python.dc1036ce-8a25-4fa9-9311-189562f33dd5[0]
      {
        "Origin": "Worker",
        "MessageType": "FunctionLoadResponse",
        "WorkerId": "dc1036ce-8a25-4fa9-9311-189562f33dd5",
        "Message": {
          "RequestId": "13125894-8b3b-409a-bd0e-de57b5226650",
          "FunctionLoadResponse": {
            "FunctionId": "de386601-9775-42c9-bb0e-a61629a0266a",
            "Result": {
              "Status": "Success",
              "Result": "",
              "Logs": []
            }
          },
          "ContentCase": "FunctionLoadResponse"
        },
        "Name": "FunctionLoadResponse",
        "Source": "Rpc"
      }
trce: Worker.python.dc1036ce-8a25-4fa9-9311-189562f33dd5[0]
      {
        "Origin": "Worker",
        "MessageType": "FunctionLoadResponse",
        "WorkerId": "dc1036ce-8a25-4fa9-9311-189562f33dd5",
        "Message": {
          "RequestId": "13125894-8b3b-409a-bd0e-de57b5226650",
          "FunctionLoadResponse": {
            "FunctionId": "8c6ea960-b231-4e68-ba6e-f16997a4e459",
            "Result": {
              "Status": "Failure",
              "Result": "",
              "Exception": {
                "Source": "",
                "StackTrace": "  File \"/home/elvis/dev/clients/microsoft/azure-functions-python-worker/azure/functions_worker/dispatcher.py\", line 205, in _handle__function_load_request\n    function_id, func, func_request.metadata)\n  File \"/home/elvis/dev/clients/microsoft/azure-functions-python-worker/azure/functions_worker/functions.py\", line 168, in add_function\n    f'type of {param.name} binding in function.json '\n",
                "Message": "FunctionLoadError: cannot load the servicebus_trigger_return function: type of msg binding in function.json \"serviceBusTrigger\" does not match its Python annotation \"QueueMessage\""
              },
              "Logs": []
            }
          },
          "ContentCase": "FunctionLoadResponse"
        },
        "Name": "FunctionLoadResponse",
        "Source": "Rpc"
      }
trce: Worker.python.dc1036ce-8a25-4fa9-9311-189562f33dd5[0]
      {
        "Origin": "Worker",
        "MessageType": "FunctionLoadResponse",
        "WorkerId": "dc1036ce-8a25-4fa9-9311-189562f33dd5",
        "Message": {
          "RequestId": "13125894-8b3b-409a-bd0e-de57b5226650",
          "FunctionLoadResponse": {
            "FunctionId": "18523f22-85fd-463c-80cb-7d8d5966153a",
            "Result": {
              "Status": "Success",
              "Result": "",
              "Logs": []
            }
          },
          "ContentCase": "FunctionLoadResponse"
        },
        "Name": "FunctionLoadResponse",
        "Source": "Rpc"
      }
trce: Worker.python.dc1036ce-8a25-4fa9-9311-189562f33dd5[0]
      {
        "Origin": "Worker",
        "MessageType": "FunctionLoadResponse",
        "WorkerId": "dc1036ce-8a25-4fa9-9311-189562f33dd5",
        "Message": {
          "RequestId": "13125894-8b3b-409a-bd0e-de57b5226650",
          "FunctionLoadResponse": {
            "FunctionId": "36eeb8c8-13c6-4019-9ded-ae8da09b6fbc",
            "Result": {
              "Status": "Success",
              "Result": "",
              "Logs": []
            }
          },
          "ContentCase": "FunctionLoadResponse"
        },
        "Name": "FunctionLoadResponse",
        "Source": "Rpc"
      }
trce: Worker.python.dc1036ce-8a25-4fa9-9311-189562f33dd5[0]
      {
        "Origin": "Worker",
        "MessageType": "FunctionLoadResponse",
        "WorkerId": "dc1036ce-8a25-4fa9-9311-189562f33dd5",
        "Message": {
          "RequestId": "13125894-8b3b-409a-bd0e-de57b5226650",
          "FunctionLoadResponse": {
            "FunctionId": "13972e81-2479-4bc7-ad0e-589830026c12",
            "Result": {
              "Status": "Success",
              "Result": "",
              "Logs": []
            }
          },
          "ContentCase": "FunctionLoadResponse"
        },
        "Name": "FunctionLoadResponse",
        "Source": "Rpc"
      }
trce: Worker.python.dc1036ce-8a25-4fa9-9311-189562f33dd5[0]
      {
        "Origin": "Host",
        "MessageType": "InvocationRequest",
        "WorkerId": "dc1036ce-8a25-4fa9-9311-189562f33dd5",
        "Message": {
          "RequestId": "",
          "InvocationRequest": {
            "InvocationId": "a94d2258-c8e5-4d0e-9b6a-f69f4a7f5a0e",
            "FunctionId": "36eeb8c8-13c6-4019-9ded-ae8da09b6fbc",
            "InputData": [
              {
                "Name": "req",
                "Data": {
                  "String": "",
                  "Json": "",
                  "Bytes": [],
                  "Stream": [],
                  "Http": {
                    "Method": "GET",
                    "Url": "http://127.0.0.1:43941/api/ping?code=testFunctionKey",
                    "Headers": {
                      "connection": "keep-alive",
                      "accept": "*/*",
                      "accept-encoding": "gzip, deflate",
                      "host": "127.0.0.1:43941",
                      "user-agent": "python-requests/2.19.1"
                    },
                    "Params": {},
                    "StatusCode": "",
                    "Query": {
                      "code": "testFunctionKey"
                    },
                    "EnableContentNegotiation": false
                  },
                  "Int": 0,
                  "Double": 0.0,
                  "DataCase": "Http"
                }
              }
            ],
            "TriggerMetadata": {
              "$request": {
                "String": "",
                "Json": "",
                "Bytes": [],
                "Stream": [],
                "Http": {
                  "Method": "GET",
                  "Url": "http://127.0.0.1:43941/api/ping?code=testFunctionKey",
                  "Headers": {
                    "connection": "keep-alive",
                    "accept": "*/*",
                    "accept-encoding": "gzip, deflate",
                    "host": "127.0.0.1:43941",
                    "user-agent": "python-requests/2.19.1"
                  },
                  "Params": {},
                  "StatusCode": "",
                  "Query": {
                    "code": "testFunctionKey"
                  },
                  "EnableContentNegotiation": false
                },
                "Int": 0,
                "Double": 0.0,
                "DataCase": "Http"
              },
              "Query": {
                "String": "",
                "Json": "{\"code\":\"testFunctionKey\"}",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "Json"
              },
              "Headers": {
                "String": "",
                "Json": "{\"Connection\":\"keep-alive\",\"Accept\":\"*/*\",\"Accept-Encoding\":\"gzip, deflate\",\"Host\":\"127.0.0.1:43941\",\"User-Agent\":\"python-requests/2.19.1\"}",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "Json"
              },
              "req": {
                "String": "",
                "Json": "",
                "Bytes": [],
                "Stream": [],
                "Http": {
                  "Method": "GET",
                  "Url": "http://127.0.0.1:43941/api/ping?code=testFunctionKey",
                  "Headers": {
                    "connection": "keep-alive",
                    "accept": "*/*",
                    "accept-encoding": "gzip, deflate",
                    "host": "127.0.0.1:43941",
                    "user-agent": "python-requests/2.19.1"
                  },
                  "Params": {},
                  "StatusCode": "",
                  "Query": {
                    "code": "testFunctionKey"
                  },
                  "EnableContentNegotiation": false
                },
                "Int": 0,
                "Double": 0.0,
                "DataCase": "Http"
              },
              "sys": {
                "String": "",
                "Json": "{\"MethodName\":\"ping\",\"UtcNow\":\"2018-06-28T14:36:55.6204414Z\",\"RandGuid\":\"b8f1016b-b4a4-4f94-8c34-e440777686ec\"}",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "Json"
              }
            }
          },
          "ContentCase": "InvocationRequest"
        },
        "Name": "InvocationRequest",
        "Source": "Rpc"
      }
trce: Worker.python.dc1036ce-8a25-4fa9-9311-189562f33dd5[0]
      {
        "Origin": "Worker",
        "MessageType": "InvocationResponse",
        "WorkerId": "dc1036ce-8a25-4fa9-9311-189562f33dd5",
        "Message": {
          "RequestId": "13125894-8b3b-409a-bd0e-de57b5226650",
          "InvocationResponse": {
            "InvocationId": "a94d2258-c8e5-4d0e-9b6a-f69f4a7f5a0e",
            "OutputData": [],
            "Result": {
              "Status": "Success",
              "Result": "",
              "Logs": []
            }
          },
          "ContentCase": "InvocationResponse"
        },
        "Name": "InvocationResponse",
        "Source": "Rpc"
      }
info: Function.ping[0]
      => System.Collections.Generic.Dictionary`2[System.String,System.Object] => System.Collections.Generic.Dictionary`2[System.String,System.Object]
      Executed 'Functions.ping' (Succeeded, Id=a94d2258-c8e5-4d0e-9b6a-f69f4a7f5a0e)
info: Host.Startup[0]
      Host started (1161ms)
info: Host.Startup[0]
      Job host started
info: Host.General[0]
      Host lock lease acquired by instance ID '000000000000000000000000CB48F17E'.
info: Function.put_message[0]
      => System.Collections.Generic.Dictionary`2[System.String,System.Object] => System.Collections.Generic.Dictionary`2[System.String,System.Object]
      Executing 'Functions.put_message' (Reason='This function was programmatically called via the host APIs.', Id=06ea352e-e884-4ce1-8fc1-48fc84edc6e8)
trce: Worker.python.dc1036ce-8a25-4fa9-9311-189562f33dd5[0]
      => System.Collections.Generic.Dictionary`2[System.String,System.Object] => System.Collections.Generic.Dictionary`2[System.String,System.Object]
      {
        "Origin": "Host",
        "MessageType": "InvocationRequest",
        "WorkerId": "dc1036ce-8a25-4fa9-9311-189562f33dd5",
        "Message": {
          "RequestId": "",
          "InvocationRequest": {
            "InvocationId": "06ea352e-e884-4ce1-8fc1-48fc84edc6e8",
            "FunctionId": "f794561b-2d65-4155-8e55-1b61d4264342",
            "InputData": [
              {
                "Name": "req",
                "Data": {
                  "String": "",
                  "Json": "",
                  "Bytes": [],
                  "Stream": [],
                  "Http": {
                    "Method": "POST",
                    "Url": "http://127.0.0.1:43941/api/put_message?code=testFunctionKey",
                    "Headers": {
                      "connection": "keep-alive",
                      "accept": "*/*",
                      "accept-encoding": "gzip, deflate",
                      "host": "127.0.0.1:43941",
                      "user-agent": "python-requests/2.19.1",
                      "content-length": "12"
                    },
                    "Body": {
                      "String": "test-message",
                      "Json": "",
                      "Bytes": [],
                      "Stream": [],
                      "Int": 0,
                      "Double": 0.0,
                      "DataCase": "String"
                    },
                    "Params": {},
                    "StatusCode": "",
                    "Query": {
                      "code": "testFunctionKey"
                    },
                    "EnableContentNegotiation": false,
                    "RawBody": {
                      "String": "test-message",
                      "Json": "",
                      "Bytes": [],
                      "Stream": [],
                      "Int": 0,
                      "Double": 0.0,
                      "DataCase": "String"
                    }
                  },
                  "Int": 0,
                  "Double": 0.0,
                  "DataCase": "Http"
                }
              }
            ],
            "TriggerMetadata": {
              "$request": {
                "String": "",
                "Json": "",
                "Bytes": [],
                "Stream": [],
                "Http": {
                  "Method": "POST",
                  "Url": "http://127.0.0.1:43941/api/put_message?code=testFunctionKey",
                  "Headers": {
                    "connection": "keep-alive",
                    "accept": "*/*",
                    "accept-encoding": "gzip, deflate",
                    "host": "127.0.0.1:43941",
                    "user-agent": "python-requests/2.19.1",
                    "content-length": "12"
                  },
                  "Body": {
                    "String": "test-message",
                    "Json": "",
                    "Bytes": [],
                    "Stream": [],
                    "Int": 0,
                    "Double": 0.0,
                    "DataCase": "String"
                  },
                  "Params": {},
                  "StatusCode": "",
                  "Query": {
                    "code": "testFunctionKey"
                  },
                  "EnableContentNegotiation": false,
                  "RawBody": {
                    "String": "test-message",
                    "Json": "",
                    "Bytes": [],
                    "Stream": [],
                    "Int": 0,
                    "Double": 0.0,
                    "DataCase": "String"
                  }
                },
                "Int": 0,
                "Double": 0.0,
                "DataCase": "Http"
              },
              "Query": {
                "String": "",
                "Json": "{\"code\":\"testFunctionKey\"}",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "Json"
              },
              "Headers": {
                "String": "",
                "Json": "{\"Connection\":\"keep-alive\",\"Accept\":\"*/*\",\"Accept-Encoding\":\"gzip, deflate\",\"Host\":\"127.0.0.1:43941\",\"User-Agent\":\"python-requests/2.19.1\",\"Content-Length\":\"12\"}",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "Json"
              },
              "req": {
                "String": "",
                "Json": "",
                "Bytes": [],
                "Stream": [],
                "Http": {
                  "Method": "POST",
                  "Url": "http://127.0.0.1:43941/api/put_message?code=testFunctionKey",
                  "Headers": {
                    "connection": "keep-alive",
                    "accept": "*/*",
                    "accept-encoding": "gzip, deflate",
                    "host": "127.0.0.1:43941",
                    "user-agent": "python-requests/2.19.1",
                    "content-length": "12"
                  },
                  "Body": {
                    "String": "test-message",
                    "Json": "",
                    "Bytes": [],
                    "Stream": [],
                    "Int": 0,
                    "Double": 0.0,
                    "DataCase": "String"
                  },
                  "Params": {},
                  "StatusCode": "",
                  "Query": {
                    "code": "testFunctionKey"
                  },
                  "EnableContentNegotiation": false,
                  "RawBody": {
                    "String": "test-message",
                    "Json": "",
                    "Bytes": [],
                    "Stream": [],
                    "Int": 0,
                    "Double": 0.0,
                    "DataCase": "String"
                  }
                },
                "Int": 0,
                "Double": 0.0,
                "DataCase": "Http"
              },
              "sys": {
                "String": "",
                "Json": "{\"MethodName\":\"put_message\",\"UtcNow\":\"2018-06-28T14:36:57.7313384Z\",\"RandGuid\":\"ae173338-d124-42b7-9c0b-85028c34649a\"}",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "Json"
              }
            }
          },
          "ContentCase": "InvocationRequest"
        },
        "Name": "InvocationRequest",
        "Source": "Rpc"
      }
trce: Worker.python.dc1036ce-8a25-4fa9-9311-189562f33dd5[0]
      {
        "Origin": "Worker",
        "MessageType": "InvocationResponse",
        "WorkerId": "dc1036ce-8a25-4fa9-9311-189562f33dd5",
        "Message": {
          "RequestId": "13125894-8b3b-409a-bd0e-de57b5226650",
          "InvocationResponse": {
            "InvocationId": "06ea352e-e884-4ce1-8fc1-48fc84edc6e8",
            "OutputData": [
              {
                "Name": "msg",
                "Data": {
                  "String": "",
                  "Json": "",
                  "Bytes": [
                    116,
                    101,
                    115,
                    116,
                    45,
                    109,
                    101,
                    115,
                    115,
                    97,
                    103,
                    101
                  ],
                  "Stream": [],
                  "Int": 0,
                  "Double": 0.0,
                  "DataCase": "Bytes"
                }
              }
            ],
            "ReturnValue": {
              "String": "OK",
              "Json": "",
              "Bytes": [],
              "Stream": [],
              "Int": 0,
              "Double": 0.0,
              "DataCase": "String"
            },
            "Result": {
              "Status": "Success",
              "Result": "",
              "Logs": []
            }
          },
          "ContentCase": "InvocationResponse"
        },
        "Name": "InvocationResponse",
        "Source": "Rpc"
      }
info: Function.put_message[0]
      => System.Collections.Generic.Dictionary`2[System.String,System.Object] => System.Collections.Generic.Dictionary`2[System.String,System.Object]
      Executed 'Functions.put_message' (Succeeded, Id=06ea352e-e884-4ce1-8fc1-48fc84edc6e8)
info: Function.servicebus_trigger[0]
      => System.Collections.Generic.Dictionary`2[System.String,System.Object]
      Executing 'Functions.servicebus_trigger' (Reason='New ServiceBus message detected on 'testqueue'.', Id=676e0dbd-b2d6-4909-838a-22f8a72d4cc7)
trce: Worker.python.dc1036ce-8a25-4fa9-9311-189562f33dd5[0]
      => System.Collections.Generic.Dictionary`2[System.String,System.Object]
      {
        "Origin": "Host",
        "MessageType": "InvocationRequest",
        "WorkerId": "dc1036ce-8a25-4fa9-9311-189562f33dd5",
        "Message": {
          "RequestId": "",
          "InvocationRequest": {
            "InvocationId": "676e0dbd-b2d6-4909-838a-22f8a72d4cc7",
            "FunctionId": "13972e81-2479-4bc7-ad0e-589830026c12",
            "InputData": [
              {
                "Name": "msg",
                "Data": {
                  "String": "System.Byte[]",
                  "Json": "",
                  "Bytes": [],
                  "Stream": [],
                  "Int": 0,
                  "Double": 0.0,
                  "DataCase": "String"
                }
              }
            ],
            "TriggerMetadata": {
              "DeliveryCount": {
                "String": "",
                "Json": "1",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "Json"
              },
              "DeadLetterSource": {
                "String": "",
                "Json": "",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "None"
              },
              "ExpiresAtUtc": {
                "String": "",
                "Json": "\"2018-07-12T14:36:59.104Z\"",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "Json"
              },
              "EnqueuedTimeUtc": {
                "String": "",
                "Json": "\"2018-06-28T14:36:59.104Z\"",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "Json"
              },
              "MessageId": {
                "String": "cf6fa1fe04ac4cd19b6b625bd284e51c",
                "Json": "",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "String"
              },
              "ContentType": {
                "String": "text/plain",
                "Json": "",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "String"
              },
              "ReplyTo": {
                "String": "",
                "Json": "",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "None"
              },
              "SequenceNumber": {
                "String": "",
                "Json": "31806672368304129",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "Json"
              },
              "To": {
                "String": "",
                "Json": "",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "None"
              },
              "Label": {
                "String": "",
                "Json": "",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "None"
              },
              "CorrelationId": {
                "String": "",
                "Json": "",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "None"
              },
              "UserProperties": {
                "String": "",
                "Json": "{\"$AzureWebJobsParentId\":\"06ea352e-e884-4ce1-8fc1-48fc84edc6e8\",\"x-opt-enqueue-sequence-number\":0}",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "Json"
              },
              "sys": {
                "String": "",
                "Json": "{\"MethodName\":\"servicebus_trigger\",\"UtcNow\":\"2018-06-28T14:36:59.2639206Z\",\"RandGuid\":\"1476de8c-1ae2-4005-a4e2-4eae017ecd46\"}",
                "Bytes": [],
                "Stream": [],
                "Int": 0,
                "Double": 0.0,
                "DataCase": "Json"
              }
            }
          },
          "ContentCase": "InvocationRequest"
        },
        "Name": "InvocationRequest",
        "Source": "Rpc"
      }
trce: Worker.python.dc1036ce-8a25-4fa9-9311-189562f33dd5[0]
      {
        "Origin": "Worker",
        "MessageType": "InvocationResponse",
        "WorkerId": "dc1036ce-8a25-4fa9-9311-189562f33dd5",
        "Message": {
          "RequestId": "13125894-8b3b-409a-bd0e-de57b5226650",
          "InvocationResponse": {
            "InvocationId": "676e0dbd-b2d6-4909-838a-22f8a72d4cc7",
            "OutputData": [],
            "ReturnValue": {
              "String": "{\"message_id\": \"cf6fa1fe04ac4cd19b6b625bd284e51c\", \"body\": \"System.Byte[]\", \"content_type\": \"text/plain\", \"expiration_time\": null, \"label\": null, \"partition_key\": null, \"reply_to\": null, \"reply_to_session_id\": null, \"scheduled_enqueue_time\": null, \"session_id\": null, \"time_to_live\": null, \"to\": null, \"user_properties\": {\"$AzureWebJobsParentId\": \"06ea352e-e884-4ce1-8fc1-48fc84edc6e8\", \"x-opt-enqueue-sequence-number\": 0}}",
              "Json": "",
              "Bytes": [],
              "Stream": [],
              "Int": 0,
              "Double": 0.0,
              "DataCase": "String"
            },
            "Result": {
              "Status": "Success",
              "Result": "",
              "Logs": []
            }
          },
          "ContentCase": "InvocationResponse"
        },
        "Name": "InvocationResponse",
        "Source": "Rpc"
      }
info: Function.servicebus_trigger[0]
      => System.Collections.Generic.Dictionary`2[System.String,System.Object]
      Executed 'Functions.servicebus_trigger' (Succeeded, Id=676e0dbd-b2d6-4909-838a-22f8a72d4cc7)

@pragnagopa
Copy link
Member

@elprans - Any remaining work on this?

@elprans
Copy link
Collaborator Author

elprans commented Jul 11, 2018

No, this can be merged once CI issues are figured out (missing .NET build for Travis).

@asavaritayal
Copy link
Contributor

@elprans are you working on the CI issues? Do you need anything from us?

@elprans
Copy link
Collaborator Author

elprans commented Jul 12, 2018

@asavaritayal I sent you an email about this. Quoting below:

[I]t seems like the latest Functions Host has been built with a version
of .NET which has not been published to the Linux packages repo,
so I'm getting these failures on Travis CI:

It was not possible to find any compatible framework version
The specified framework 'Microsoft.AspNetCore.App', version '2.1.0' was
not found.

  • Check application dependencies and target a framework version
    installed at:
    /usr/share/dotnet/
  • Installing .NET Core prerequisites might help resolve this problem:
    http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
  • The .NET Core framework and SDK can be installed from:
    https://aka.ms/dotnet-download
  • The following versions are installed:
    2.1.0-preview2-final at [/usr/share/dotnet/shared/
    Microsoft.AspNetCore.App]
    2.1.0-rc1-final at [/usr/share/dotnet/shared/
    Microsoft.AspNetCore.App]

As you can see, the packages installed from Microsoft's repository are
the preview packages, whereas the Host seems to expect the final
release.

@pragnagopa
Copy link
Member

@fabiocav - Do you know where we can follow up to get the final version of AspNetCore 2.1.0 for Linux?

@elprans elprans changed the title [WIP, do not merge] Add support for ServiceBus bindings Add support for ServiceBus bindings Jul 12, 2018
@fabiocav
Copy link
Member

Those are available from the official download site.

The Linux runtime and SDK packages are available here: https://www.microsoft.com/net/download/linux

If you need to automate the isntallation, you can also look at what we do for the host install here:
https://github.com/Azure/azure-functions-host/blob/dev/dotnet-install.sh

@elprans
Copy link
Collaborator Author

elprans commented Jul 17, 2018

Hi @fabiocav. The download site still mentions '2.1': https://www.microsoft.com/net/download/linux-package-manager/ubuntu14-04/sdk-current

Here's how we install .NET on Travis:

$ sudo -E apt-get -yq --no-install-suggests --no-install-recommends $TRAVIS_APT_OPTS install libunwind8 dotnet-sdk-2.1.300 azure-functions-core-tools
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  aspnetcore-runtime-2.1.0-preview2-final aspnetcore-runtime-2.1.0-rc1-final
  dotnet-host dotnet-hostfxr-2.1.0-preview2-26406-04 dotnet-hostfxr-2.1.0-rc1
  dotnet-runtime-2.1.0-preview2-26406-04 dotnet-runtime-2.1.0-rc1
  dotnet-runtime-deps-2.1 liblttng-ust-ctl2 liblttng-ust0 liburcu1
The following NEW packages will be installed:
  aspnetcore-runtime-2.1.0-preview2-final aspnetcore-runtime-2.1.0-rc1-final
  azure-functions-core-tools dotnet-host
  dotnet-hostfxr-2.1.0-preview2-26406-04 dotnet-hostfxr-2.1.0-rc1
  dotnet-runtime-2.1.0-preview2-26406-04 dotnet-runtime-2.1.0-rc1
  dotnet-runtime-deps-2.1 dotnet-sdk-2.1.300-preview2-008533
  dotnet-sdk-2.1.300-rc1-008673 liblttng-ust-ctl2 liblttng-ust0 libunwind8
  liburcu1

This worked perfectly for previous releases. I feel like throwing in that script will complicate the build unnecessarily.

@fabiocav
Copy link
Member

The script was in case you didn't already have something in place.

These are the installation instructions for the RTM bits:
https://www.microsoft.com/net/learn/get-started/linux/ubuntu18-04

@elprans
Copy link
Collaborator Author

elprans commented Jul 17, 2018

@fabiocav That's for 18.04. Travis is on 14.04, which is where there seems to be no RTM .deb.

@asavaritayal
Copy link
Contributor

Waiting on @pragnagopa to resolve AppVeyor issues.

@asavaritayal asavaritayal mentioned this pull request Aug 4, 2018
@fabiocav
Copy link
Member

fabiocav commented Aug 6, 2018

Btw, this issue is relevant: travis-ci/travis-ci#9684

@elprans
Copy link
Collaborator Author

elprans commented Aug 7, 2018

@fabiocav travis-ci/travis-ci#9684 is mostly about Travis' own support for .NET. We already use an explicit repo+package configuration. Again, the issue here is missing release packages in the Microsoft apt repo, is not about .travis.yml mis-configuration.

@elprans elprans mentioned this pull request Aug 7, 2018
@elprans
Copy link
Collaborator Author

elprans commented Aug 7, 2018

@pragnagopa Travis CI is green on this now.

@pragnagopa
Copy link
Member

Let’s merge this in

@elprans elprans merged commit bdf858e into dev Aug 9, 2018
@elprans elprans deleted the servicebus branch August 9, 2018 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants