Skip to content

Custom binding error #408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
asavaritayal opened this issue May 6, 2019 · 2 comments · Fixed by #409
Closed

Custom binding error #408

asavaritayal opened this issue May 6, 2019 · 2 comments · Fixed by #409
Assignees

Comments

@asavaritayal
Copy link
Contributor

asavaritayal commented May 6, 2019

I created an HTTP triggered function with an output binding of type Azure Table Storage. Here is the function.json definition:

{
  "scriptFile": "__init__.py",
  "bindings": [
    {
      "authLevel": "anonymous",
      "type": "httpTrigger",
      "direction": "in",
      "name": "req",
      "methods": [
        "get",
        "post"
      ]
    },
    {
      "type": "http",
      "direction": "out",
      "name": "$return"
    },
    {
      "type": "table",
      "dataType": "string",
      "direction": "out",
      "name": "table",
      "tableName": "commitsTable",
      "connection": "AzureWebJobsStorage"
    }
  ]
}

I see the following error when trying to run locally:

Executing 'Functions.PushEvent' (Reason='This function was programmatically called via the host APIs.', Id=a079f757-06a1-4ca0-b2fd-6eb41f4e8953)
[5/6/19 5:38:18 AM] Executed 'Functions.PushEvent' (Failed, Id=a079f757-06a1-4ca0-b2fd-6eb41f4e8953)
[5/6/19 5:38:18 AM] System.Private.CoreLib: Exception while executing function: Functions.PushEvent. System.Private.CoreLib: Result: Failure
[5/6/19 5:38:18 AM] Exception: FunctionLoadError: cannot load the PushEvent function: unknown type for table binding: "table"
[5/6/19 5:38:18 AM] Stack:   File "/usr/local/Cellar/azure-functions-core-tools/2.7.1149/workers/python/deps/azure/functions_worker/dispatcher.py", line 232, in _handle__function_load_request
[5/6/19 5:38:18 AM]     function_id, func, func_request.metadata)
[5/6/19 5:38:18 AM]   File "/usr/local/Cellar/azure-functions-core-tools/2.7.1149/workers/python/deps/azure/functions_worker/functions.py", line 179, in add_function
[5/6/19 5:38:18 AM]     f'unknown type for {param.name} binding: "{desc.type}"')
[5/6/19 5:38:18 AM] .

I expected this to work since the issue here - #66 has been closed.

@elprans
Copy link
Collaborator

elprans commented May 6, 2019

@asavaritayal #66 laid the foundation for the unstructured bindings, but we didn't explicitly enable support for arbitrary binding types, only the bindings that are supported (registered) otherwise. If generic support for arbitrary bindings is desired, I can make a PR to enable this behavior.

@asavaritayal
Copy link
Contributor Author

@elprans the primary purpose of #66 was to enable bindings that are not supported out of the box in Functions. The current functionality does not provide any net new addition to the platform. I'll re-open the issue to track the work required.

elprans added a commit that referenced this issue May 6, 2019
Add a generic binding implementation to allow unknown bindings with
`dataType: string` and `dataType: binary`.

Fixes: #66
Fixes: #408
@asavaritayal asavaritayal reopened this May 10, 2019
@asavaritayal asavaritayal added this to the Functions Sprint 49 milestone May 10, 2019
elprans added a commit that referenced this issue May 15, 2019
Add a generic binding implementation to allow unknown bindings with
`dataType: string` and `dataType: binary`.

Fixes: #66
Fixes: #408
elprans added a commit that referenced this issue Jun 24, 2019
Add a generic binding implementation to allow unknown bindings with
`dataType: string` and `dataType: binary`.

Fixes: #66
Fixes: #408
maiqbal11 pushed a commit that referenced this issue Jul 1, 2019
* Allow arbitrary bindings with elementary dataType

Add a generic binding implementation to allow unknown bindings with
`dataType: string` and `dataType: binary`.

Fixes: #66
Fixes: #408

* Add support for untyped queue trigger binding

* Support unannotated elementary bindings

* Decouple rich binding support from the worker

Per discussion, the worker no longer includes support for rich bindings
by default.  The implementation have been moved to
azure-functions-python-library, and the runtime dependency on is has
been removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants