Azure / Azure/azure-functions-host
Issues running EventGridTrigger with func CLI or Azure
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 38
Description
#### Investigative information
Please provide the following:
- Timestamp:
- Function App version (1.0 or 2.0): 2.0
- Function App name: jsazf-tyleonha
- Function name(s) (as appropriate): EventGridTrigger
#### Repro steps
Provide the steps required to reproduce the problem:
create a Node.js Function App
then locally, run `func init --worker-runtime node`
`func new` and select EventGrid Trigger
`func start`
or publish it to Azure and run it in the Portal
#### Expected behavior
Function App starts correctly
#### Actual behavior
I get the following error:
```
func start
%%%%%%
%%%%%%
@ %%%%%% @
@@ %%%%%% @@
@@@ %%%%%%%%%%% @@@
@@ %%%%%%%%%% @@
@@ %%%% @@
@@ %%% @@
@@ %% @@
%%
%
Azure Functions Core Tools (2.1.725 Commit hash: 68f448fe6a60e1cade88c2004bf6491af7e5f1df)
Function Runtime Version: 2.0.12134.0
[10/24/18 5:37:14 AM] Building host: startup suppressed:False, configuration suppressed: False
[10/24/18 5:37:14 AM] Reading host configuration file '/Users/tyler/Code/JavaScript/jsazf-tyleonha/host.json'
[10/24/18 5:37:14 AM] Host configuration file read:
[10/24/18 5:37:14 AM] {
[10/24/18 5:37:14 AM] "version": "2.0"
[10/24/18 5:37:14 AM] }
[10/24/18 5:37:14 AM] A host error has occurred
[10/24/18 5:37:14 AM] Microsoft.WindowsAzure.Storage: Settings must be of the form "name=value".
Listening on http://0.0.0.0:7071/
Hit CTRL-C to exit...
Settings must be of the form "name=value".
Application is shutting down...
[10/24/18 5:37:14 AM] Initialization cancellation requested by runtime.
Hosting environment: Production
Content root path: /Users/tyler/Code/JavaScript/jsazf-tyleonha
Now listening on: http://0.0.0.0:7071
Application started. Press Ctrl+C to shut down.
[10/24/18 5:37:15 AM] Stopping host...
[10/24/18 5:37:15 AM] Host shutdown completed.
```
In the Portal I get:
```
2018-10-24T05:33:43.754 [Information] Executing 'Functions.EventGridTrigger' (Reason='This function was programmatically called via the host APIs.', Id=518b3891-8058-4af9-afe3-0ead942b5511)
2018-10-24T05:33:44.037 [Error] Executed 'Functions.EventGridTrigger' (Failed, Id=518b3891-8058-4af9-afe3-0ead942b5511)
Unable to parse to Newtonsoft.Json.Linq.JObject
```
#### Known workarounds
None at this time
#### Related information
Provide any related information
* Programming language used: Javascript
* Bindings used: EventGrid
Source
extensions.csproj
```xml
netstandard2.0
**
```
local.settings.json
```json
{
"IsEncrypted": false,
"Values": {
"FUNCTIONS_WORKER_RUNTIME": "powershell",
"AzureWebJobsStorage": "{AzureWebJobsStorage}"
}
}
```
function.json
```json
{
"bindings": [
{
"type": "eventGridTrigger",
"name": "eventGridEvent",
"direction": "in"
}
],
"disabled": false
}
```
index.js
```
module.exports = async function (context, eventGridEvent) {
context.log(typeof eventGridEvent);
context.log(eventGridEvent);
};
```
Contributor guide
Research direction
Start by reproducing the reported failure with func start and the Azure Portal using the supplied extensions.csproj, local.settings.json, function.json, and index.js. Compare the Node.js setup and EventGridTrigger behavior in both environments; done means the app starts locally and the EventGridTrigger invocation succeeds without the reported storage or JObject errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, javascript
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100