Skip to content
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

[In Portal] EventGrid Trigger execution failed with NotImplementedException #6328

Open
shibayan opened this issue Jan 7, 2020 · 26 comments
Open
Assignees

Comments

@shibayan
Copy link

shibayan commented Jan 7, 2020

Repro steps

  1. Create new Function App with PowerShell Core stack
  2. Add new function in portal
  3. Select EventGrid Trigger function template
  4. Confirm Microsoft.Azure.WebJobs.Extensions.EventGrid installing dialog
  5. Select created function and click Run button

Error log

2020-01-07T16:59:11  Welcome, you are now connected to log-streaming service. The default timeout is 2 hours. Change the timeout with the App Setting SCM_LOGSTREAM_TIMEOUT (in seconds). 
2020-01-07T16:59:20.395 [Information] Executing 'Functions.EventGridTrigger1' (Reason='This function was programmatically called via the host APIs.', Id=5fb87d7b-9fa5-4ab2-a2ec-cb7f24c6621e)
2020-01-07T16:59:20.515 [Error] Executed 'Functions.EventGridTrigger1' (Failed, Id=5fb87d7b-9fa5-4ab2-a2ec-cb7f24c6621e)
The method or operation is not implemented.

Addtional information

  • Runtime version: 2.0.12888.0 (~2)
  • Platform: Windows
  • ASP Tier: Consumption
  • Region: West US 2

Workaround

Downgrade Microsoft.Azure.WebJobs.Extensions.EventGrid version 2.1.0 to 2.0.0

@eamonoreilly eamonoreilly self-assigned this Jan 30, 2020
@vrdmr
Copy link
Member

vrdmr commented Apr 24, 2020

It works correctly when tried locally (sending events using postman).

Bindings:

{ "bindings": [{
      "type": "eventGridTrigger",
      "name": "eventGridEvent",
      "direction": "in"
    }]
}

My run.ps1

param($eventGridEvent, $TriggerMetadata)

wait-debugger

# Make sure to pass hashtables to Out-String so they're logged correctly
$eventGridEvent | Out-String | Write-Host
4/24/2020 7:16:29 PM] Loading startup extension 'EventGrid'
[4/24/2020 7:16:29 PM] Loaded extension 'EventGrid' (2.1.0.0)
[4/24/2020 7:16:30 PM] Initializing Warmup Extension.
[4/24/2020 7:16:32 PM] registered EventGrid Endpoint = http://localhost:7071/runtime/webhooks/eventgrid
...
[4/24/2020 7:07:25 PM] Executing HTTP request: {
[4/24/2020 7:07:25 PM]   "requestId": "95512df6-7a22-4c1c-ba29-33ff35b6abca",
[4/24/2020 7:07:25 PM]   "method": "POST",
[4/24/2020 7:07:25 PM]   "uri": "/runtime/webhooks/eventgrid"
[4/24/2020 7:07:25 PM] }
[4/24/2020 7:07:26 PM] Executing 'Functions.EventGridTrigger1' (Reason='EventGrid trigger fired at 2020-04-24T12:07:26.1903020-07:00', Id=c244a22f-a6a1-4e2b-86e2-49e50a3bee7c)
[4/24/2020 7:07:31 PM] System Log: { Log-Level: Trace; Log-Message: Profile invocation completed in 5241 ms. }
[4/24/2020 7:07:31 PM] System Log: { Invocation-Id: c244a22f-a6a1-4e2b-86e2-49e50a3bee7c; Log-Level: Trace; Log-Message: Invoking function 'EventGridTrigger1' code 5380 ms after receiving request. Invocation performance details: DependenciesAvailable: 0 ms; RunspaceAvailable: 5264 ms; MetadataAndTraceContextReady: 5369 ms; FunctionCodeReady: 5374 ms; InputBindingValuesReady: 5378 ms; InvokingFunctionCode: 5378 ms;  }
[4/24/2020 7:07:39 PM] Executed 'Functions.EventGridTrigger1' (Succeeded, Id=c244a22f-a6a1-4e2b-86e2-49e50a3bee7c)
[4/24/2020 7:07:39 PM] Executed HTTP request: {
[4/24/2020 7:07:39 PM]   "requestId": "95512df6-7a22-4c1c-ba29-33ff35b6abca",
[4/24/2020 7:07:39 PM]   "method": "POST",
[4/24/2020 7:07:39 PM]   "uri": "/runtime/webhooks/eventgrid",
[4/24/2020 7:07:39 PM]   "identities": [
[4/24/2020 7:07:39 PM]     {
[4/24/2020 7:07:39 PM]       "type": "WebJobsAuthLevel",
[4/24/2020 7:07:39 PM]       "level": "Admin"
[4/24/2020 7:07:39 PM]     },
[4/24/2020 7:07:39 PM]     {
[4/24/2020 7:07:39 PM]       "type": "WebJobsAuthLevel",
[4/24/2020 7:07:39 PM]       "level": "Admin"
[4/24/2020 7:07:39 PM]     }
[4/24/2020 7:07:39 PM]   ],
[4/24/2020 7:07:39 PM]   "status": 202,
[4/24/2020 7:07:39 PM]   "duration": 13608
[4/24/2020 7:07:39 PM] }

@shibayan
Copy link
Author

It's still happening when running on Azure and In-Portal, not locally.

If you try my repro steps I get an error.

@AspenForester
Copy link

AspenForester commented May 7, 2020

I'm seeing the same behavior on newly created functions, in fact, I can delete all of the code leaving just the param statement, and still get the "The method or operation is not implemented"

But I have existing Azure PowerShell Functions, created before GA, that are running just fine.

@LeoYang1234
Copy link

For me, "the method or operation is not implemented" only happens when I forcefully trigger the EventGrid triggered function using test console on the portal. If the function is triggered by a real event, then everything is good.
Please make sure the monitored eventgrid subscription actually has some event for the function to process. The test portal is misleading for PowerShell eventgrid functions.

@oising
Copy link

oising commented Jun 16, 2020

Getting the same thing with C# -- I wired up azure signalr to deliver connected/disconnected events to a default implementation created directly in the portal and I'm getting the same error.

#r "Microsoft.Azure.EventGrid"
using Microsoft.Azure.EventGrid.Models;

public static void Run(EventGridEvent eventGridEvent, ILogger log)
{
    log.LogInformation(eventGridEvent.Data.ToString());
}

logs:

2020-06-16 22:30:55.712
Executing 'Functions.EventGridTrigger1' (Reason='This function was programmatically called via the host APIs.', Id=0691f2f7-239d-4e61-9c41-0037248889a0)
Information
2020-06-16 22:30:55.765
The method or operation is not implemented.
Error
2020-06-16 22:30:55.765
Executed 'Functions.EventGridTrigger1' (Failed, Id=0691f2f7-239d-4e61-9c41-0037248889a0)
Error
2020-06-16 22:30:55.788
The method or operation is not implemented.
Error

@truptijogi7
Copy link

Same issue for me. Using EventGrid.

@angelcervera
Copy link

angelcervera commented Jul 8, 2020

Following the documentation and getting this error. Nobody from Microsoft takes care of these types of things? 😠
The same problem using nodejs 10 and 12 and Runtime 3. So it is not only with PowerShell.

Sometimes, I feel like I'm working with a beta version.

@AnatoliB
Copy link
Contributor

AnatoliB commented Jul 8, 2020

@angelcervera Does this workaround help you?

Downgrade Microsoft.Azure.WebJobs.Extensions.EventGrid version 2.1.0 to 2.0.0

@AnatoliB AnatoliB transferred this issue from Azure/azure-functions-powershell-worker Jul 8, 2020
@angelcervera
Copy link

angelcervera commented Jul 10, 2020

I'm testing with different versions, always working from the Portal to be sure that I'm not doing something wrong. I'm using the nodejs code (to be able to edit from the Portal) from the Documentation.

I think that the problem is the combination between Runtime Version and Extension Bundle Version, but I need more time to find which combination is worng.

At this moment, I was not able to get free time to continue with the research and I moved to Service Bus as a temporal workaround.

@angelcervera
Copy link

angelcervera commented Jul 10, 2020

@AnatoliB This is my test at the moment:

Runtime Extension Bundle Working Notes
2.0.13900.0 2.0.0 WORKING
3.0.13901.0 2.0.0 NOT WORKING This is the default configuration using the Portal

The question is, does a runtime version require a specific Extension Bundle version? There is a little mess in the documentation about the relationship between both.

If Extension 3 is necessary for Runtime 3, the default app created using Portal is wrong, so maybe this is the issue in my case. This is the code generated with the defaul settings:

  • Application Settings: FUNCTIONS_EXTENSION_VERSION=~3 but the host.json file generated added extension version 2.0.0 as the next point shows.
  • host.json file content:
{
  "version": "2.0",
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[1.*, 2.0.0)"
  }
}
  • Runtime version: 3.0.13901.0 (~3)

So Microsoft.Azure.Functions.ExtensionBundle is 2.0.0 but FUNCTIONS_EXTENSION_VERSION is 3.
Maybe I'm confusing because naming as well. FUNCTIONS_EXTENSION_VERSION is used to specify the Runtime, and the Function Extension Bundle is in the one in host.json file???

@fabiocav
Copy link
Member

@AnatoliB thank you for transferring the issue over. We'll take a closer look at this to understand if this is something happening in the host if if there's an issue with the Event Grid extension itself. Based on what is described above, this is likely an issue with the extension not properly handling the invoke call made by the portal.

@ddobric
Copy link

ddobric commented Oct 25, 2020

Is there anythin gnew regarding this issue?

@fabiocav
Copy link
Member

@ThejaChoudary / @Kotasudhakarreddy I see this is currently assigned to you. Are you working on repro and additional details or should we have t his triaged/assigned?

@sspaniel
Copy link

@angelcervera Does this workaround help you?

Downgrade Microsoft.Azure.WebJobs.Extensions.EventGrid version 2.1.0 to 2.0.0

This fixed the issue for me

@simonjduff
Copy link

I've just been hit by the same thing.
I have a JavaScript function integrated to Event Grid. A manual test from the portal results in a 202 Accepted and a message in the console:

(Failed, Id=0feb9368-20cf-4905-ba7a-0cc392c5a035, Duration=1ms)The method or operation is not implemented.

Host.json contains

{
  "version": "2.0",
  "logging": {
    "applicationInsights": {
      "samplingSettings": {
        "isEnabled": true,
        "excludedTypes": "Request"
      }
    }
  },
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[1.*, 2.0.0)"
  }
}

@nitmatgeo
Copy link

In my case, I released the error was when there was an exception and when my final block was uncommented.

Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{ StatusCode = "xyz" Body = $body })
Is it your case too? Any way to handle this?

@v-anvari
Copy link

Hi @shibayan , Please let us know if you are still seeing this issue

@gresockj
Copy link

gresockj commented Nov 15, 2021

I am still seeing issues with this. This is happening with the following host.json, and Java Function runtime version ~4:

{
  "version": "2.0",
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[3.3.0, 4.0.0)"
  } 
}

@codeshinobi
Copy link

Hi. Any resolution to this? I am still getting this

@gresockj
Copy link

Also, I see in the workaround to "Downgrade Microsoft.Azure.WebJobs.Extensions.EventGrid version 2.1.0 to 2.0.0". How do I do that using the Java library? I'm using the azure-functions-maven-plugin.

@v-anvari
Copy link

Please open an issue here for further insights using java - https://github.com/Azure/azure-functions-Java-worker

@htuomas
Copy link

htuomas commented Feb 8, 2022

I have this same problem with a C# function, using Microsoft.Azure.WebJobs.Extensions.EventGrid version 2.1.0. It works fine when invoked with Postman.

@oleksandr-ivanov-ah
Copy link

I also have the same issue my host.json

  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[3.3.0, 4.0.0)"
  }

My os: MacOS and my runtime

Azure Functions Core Tools
Core Tools Version:       4.0.4544 Commit hash: N/A  (64-bit)
Function Runtime Version: 4.3.2.18186

@codeshinobi
Copy link

codeshinobi commented Jun 9, 2022 via email

@MichaelVlcek
Copy link

MichaelVlcek commented Jun 17, 2022

Hey,

In-portal, the Powershell and .NET function has the same issue. Moreover, the runtime version ~4 does not support ExtensionBundle <=2.0.0 anymore.
Runtime version ~3 does support the ExtensionBundle <=2.0.0 version, but doesn't work.
Selecting runtime version ~2 does not fix the issue either.

No combination of runtime version (~2.0, ~2, ~3, ~4) and ExtensionBundle version [1., 2.0.0), [2., 3.0.0), [3.*, 4.0.0) worked for me.

It is easy to reproduce with the default setup of Azure Function with Event Grid trigger, could someone please look into this?

@fabricioferreira
Copy link

I was able to solve the issue by following the steps from this article: https://www.c-sharpcorner.com/article/how-to-debug-azure-event-grid-trigger-function-using-postman/

TL;DR;
Add the aeg-event-type header with value Notification to the request.

I was able to test it using Postman.

@fabiocav fabiocav removed this from the Triaged milestone Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests