serverless / serverless-azure-functions

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

Error: 'functionApp' cannot be null or undefined -- if the first time of the deployment of the RG has specified an armTemplate #516

Open marcoslimagon opened 3 years ago

marcoslimagon commented 3 years ago

What's happening

When I use armTeplate sometimes the deployment of the functions fails with "functionApp cannot be null or undefines

The armTemplate is deployed succesfully.

Versions

Framework Core: 2.15.0 Plugin: 4.2.0 SDK: 2.3.2 Components: 3.4.3 "serverless-azure-functions": "2.1.0"

Details (Stacktrace)

Serverless: -> ARM deployment complete Serverless: sls-bras-dev-my-app-2-rg Serverless: sls-bras-dev-my-app-2 Serverless: {"error":{"code":"ResourceNotFound","message":"The Resource 'Microsoft.Web/sites/sls-bras-dev-my-app-2' under resource group 'sls-bras-dev-my-app-2-rg' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"}}

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

Error: 'functionApp' cannot be null or undefined at Function.Guard.null (...sandbox-az-functions/my-app-2/node_modules/serverless-azure-functions/lib/shared/guard.js:27:19) at FunctionAppService. (.../sandbox-az-functions/my-app-2/node_modules/serverless-azure-functions/lib/services/functionAppService.js:272:43)

marcoslimagon commented 3 years ago

If I comment the armTemplate attribute, run sls deploy, then uncomment and run the sls deploy again, it works. It seems that the Microsoft.Web/sites is not generated when the armTemplate is specified

HobbyProjects commented 3 years ago

I'm also seeing this issue.

kenanhancer commented 3 years ago

Hi is there any workaround about this problem?