serverless / serverless-azure-functions

Serverless Azure Functions Plugin – Add Azure Functions support to the Serverless Framework
MIT License
266 stars 162 forks source link

Testing default template for Azure functions gives error Microsoft.Azure.WebJobs.Script: Did not find functions with language [python] in console #451

Closed FirstInternetUser closed 4 years ago

FirstInternetUser commented 4 years ago

Bug Report

Description

  1. What did you do?

Testing the sample template for azure functions in python. Followed the instructions here: https://www.serverless.com/framework/docs/providers/azure/cli-reference/create/#available-templates

  1. What happened?

The code deploys with no issues. When running

sls invoke -f hello

An error occurs

Serverless: Invoking function hello with GET request

  Error --------------------------------------------------

  Error: Request failed with status code 503
  1. What should've happened?

I should have had a successful response

  1. What's the content of your serverless.yml file?
service: test

provider:
  name: azure
  region: West Europe
  runtime: python3.6 # python3.7 or python3.8 available
  prefix: deleteme-not-required

  environment: # these will be created as application settings
    VARIABLE_FOO: 'foo'

plugins:
  - serverless-azure-functions
package:
  exclude:
    - env/**
    - .env/**
    - local.settings.json
    - .vscode/**
    - __pycache__/**
    - node_modules/**
    - .python_packages/**
    - .funcignore
    - package.json
    - package-lock.json
    - .gitignore
    - .git/**

functions:
  hello:
    name: hello
    script: hello
    handler: src/handlers/hello.main
    events:
      - http: true
        x-azure-settings:
          methods:
            - GET
          authLevel: anonymous

 goodbye:
   handler: src/handlers/goodbye.main
    events:
      - http: true
        x-azure-settings:
          methods:
            - GET
          authLevel: anonymous
  1. What's the output you get when you use the SLS_DEBUG=* environment variable (e.g. SLS_DEBUG=* serverless deploy)
Serverless: Invoking function hello with GET request

  Error --------------------------------------------------

  Error: Request failed with status code 503
      at createError (/home/ubuntu/serverless/test/node_modules/axios/lib/core/createError.js:16:15)
      at settle (/home/ubuntu/serverless/test/node_modules/axios/lib/core/settle.js:18:12)
      at IncomingMessage.handleStreamEnd (/home/ubuntu/serverless/test/node_modules/axios/lib/adapters/http.js:202:11)
      at emitNone (events.js:111:20)
      at IncomingMessage.emit (events.js:208:7)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:138:11)
      at process._tickDomainCallback (internal/process/next_tick.js:218:9)
  From previous event:
      at PluginManager.invoke (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:490:22)
      at getHooks.reduce.then (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:525:24)
  From previous event:
      at PluginManager.run (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:525:8)
      at variables.populateService.then (/usr/local/lib/node_modules/serverless/lib/Serverless.js:133:33)
      at runCallback (timers.js:794:20)
      at tryOnImmediate (timers.js:752:5)
      at processImmediate [as _immediateCallback] (timers.js:729:5)
  From previous event:
      at Serverless.run (/usr/local/lib/node_modules/serverless/lib/Serverless.js:120:74)
      at serverless.init.then (/usr/local/lib/node_modules/serverless/bin/serverless.js:82:30)
      at /usr/local/lib/node_modules/serverless/node_modules/graceful-fs/graceful-fs.js:144:16
      at /usr/local/lib/node_modules/serverless/node_modules/graceful-fs/graceful-fs.js:61:14
      at FSReqWrap.oncomplete (fs.js:135:15)
  From previous event:
      at initializeErrorReporter.then (/usr/local/lib/node_modules/serverless/bin/serverless.js:82:8)
      at runCallback (timers.js:794:20)
      at tryOnImmediate (timers.js:752:5)
      at processImmediate [as _immediateCallback] (timers.js:729:5)
  From previous event:
      at Object.<anonymous> (/usr/local/lib/node_modules/serverless/bin/serverless.js:71:4)
      at Module._compile (module.js:652:30)
      at Object.Module._extensions..js (module.js:663:10)
      at Module.load (module.js:565:32)
      at tryModuleLoad (module.js:505:12)
      at Function.Module._load (module.js:497:3)
      at Function.Module.runMain (module.js:693:10)
      at startup (bootstrap_node.js:188:16)
      at bootstrap_node.js:609:3

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information ---------------------------
     Operating System:          linux
     Node Version:              8.10.0
     Framework Version:         1.69.0
     Plugin Version:            3.6.9
     SDK Version:               2.3.0
     Components Version:        2.30.5
FirstInternetUser commented 4 years ago

Solved the problem. I had missed the step npm install