serverless-azure-functions icon indicating copy to clipboard operation
serverless-azure-functions copied to clipboard

Error: Binding nameTrigger not supported

Open mebibou opened this issue 2 years ago • 2 comments

This is a Bug Report

Description

  • What went wrong? Created a new serverless azure function, trying to run/deploy it
  • What did you expect should have happened? Should work
  • What was the config you used?
service: test

frameworkVersion: '2'

provider:
  name: azure
  region: UK South
  runtime: python3.6
  stage: dev
  resourceGroup: 'resourceGroup'

plugins:
  - serverless-azure-functions

package:
  patterns:
    - '!env/**'
    - '!.env/**'
    - '!local.settings.json'
    - '!.vscode/**'
    - '!__pycache__/**'
    - '!node_modules/**'
    - '!.python_packages/**'
    - '!.funcignore'
    - '!package.json'
    - '!package-lock.json'
    - '!.gitignore'
    - '!.git/**'

functions:
  test:
    handler: src/handlers/test.main
    events:
      - blob:
        name: item
        path: data/{name}.json
        connection: BLOB_CONNECTION_STRING

  • What stacktrace or error message from your provider did you see?
% sls offline
Serverless: Configuration warning: Unrecognized provider 'azure'
Serverless:  
Serverless: You're relying on provider plugin which doesn't provide a validation schema for its config.
Serverless: Please report the issue at its bug tracker linking: https://www.serverless.com/framework/docs/providers/aws/guide/plugins#extending-validation-schema
Serverless: You may turn off this message with "configValidationMode: off" setting
Serverless:  
Serverless: Initializing provider configuration...
Serverless: Python functions can ONLY run on Linux Function Apps. Switching now
Serverless: Building offline service
Serverless: Parsing Azure Functions Bindings.json...
 
 Error ---------------------------------------------------
 
  Error: Binding  nameTrigger not supported
      at Function.<anonymous> ([path]/node_modules/serverless-azure-functions/lib/shared/utils.js:98:39)
      at step ([path]/node_modules/serverless-azure-functions/lib/shared/utils.js:43:23)
      at Object.next ([path]/node_modules/serverless-azure-functions/lib/shared/utils.js:24:53)
      at fulfilled ([path]/node_modules/serverless-azure-functions/lib/shared/utils.js:15:58)
      at processTicksAndRejections (internal/process/task_queues.js:97:5)
 
     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information ---------------------------
     Operating System:          darwin
     Node Version:              13.14.0
     Framework Version:         2.54.0
     Plugin Version:            5.4.3
     SDK Version:               4.2.6
     Components Version:        3.15.0
 
Serverless: Deprecation warnings:

Detected ".env" files. In the next major release variables from ".env" files will be automatically loaded into the serverless build process. Set "useDotenv: true" to adopt that behavior now.
More Info: https://www.serverless.com/framework/docs/deprecations/#LOAD_VARIABLES_FROM_ENV_FILES

CLI options definitions were upgraded with "type" property (which could be one of "string", "boolean", "multiple"). Below listed plugins do not predefine type for introduced options:
 - AzureInvokePlugin for "resourceGroup", "region", "subscriptionId", "method", "function", "path", "data", "port"
 - AzureRemovePlugin for "resourceGroup", "region", "subscriptionId"
 - AzureDeployPlugin for "resourceGroup", "region", "subscriptionId", "stage", "function"
 - AzureFuncPlugin for "name"
 - AzureOfflinePlugin for "nocleanup", "spawnargs"
 - AzureRollbackPlugin for "resourceGroup", "region", "subscriptionId"
Please report this issue in plugin issue tracker.
Starting with next major release, this will be communicated with a thrown error.
More Info: https://www.serverless.com/framework/docs/deprecations/#CLI_OPTIONS_SCHEMA

Additional Data

  • Serverless Framework Version you're using: 2.54.0
  • Serverless CLI Version you're using:
  • Serverless Azure Plugin Version you're using:1.0.2-22
  • Operating System: Mac
  • Stack Trace:
  • Provider Error messages:

mebibou avatar Aug 17 '21 08:08 mebibou

So if I change

functions:
  test:
    handler: src/handlers/test.main
    events:
      - blob:
        name: item
        path: data/{name}.json
        connection: BLOB_CONNECTION_STRING

to

functions:
  test:
    handler: src/handlers/test.main
    events:
      - blob:
          name: item
          path: data/{name}.json
          connection: BLOB_CONNECTION_STRING

i.e. double indent under -blob, it goes through but I have another error:

TypeError: Cannot set property 'name' of undefined
      at PackageService.getFunctionJson ([path]/node_modules/serverless-azure-functions/lib/services/packageService.js:215:47)
      at PackageService.createBinding ([path]/node_modules/serverless-azure-functions/lib/services/packageService.js:202:33)
      at PackageService.<anonymous> ([path]/node_modules/serverless-azure-functions/lib/services/packageService.js:102:68)
      at step ([path]/node_modules/serverless-azure-functions/lib/services/packageService.js:45:23)
      at Object.next ([path]/node_modules/serverless-azure-functions/lib/services/packageService.js:26:53)
      at fulfilled ([path]/node_modules/serverless-azure-functions/lib/services/packageService.js:17:58)
      at processTicksAndRejections (internal/process/task_queues.js:97:5)

FYI, this is taken straight from https://www.serverless.com/framework/docs/providers/azure/events/blobstorage/ and it doesnt work. Anyone tested this?

mebibou avatar Aug 17 '21 08:08 mebibou

functions:
  test:
    handler: src/handlers/test.main
    events:
      - blob:
          name: item
         path: data/{name}.json
         connection: BLOB_CONNECTION_STRING

Try above

amit12cool avatar Dec 01 '21 13:12 amit12cool