azure-webjobs-sdk-extensions icon indicating copy to clipboard operation
azure-webjobs-sdk-extensions copied to clipboard

Can't run a EventGridTrigger function inside docker because of an 401 during registration

Open JoschaMetze opened this issue 7 years ago • 15 comments

Running a dotnet core 2 function with eventGrid trigger inside a docker container (microsoft/azure-functions-dotnet-core2.0:latest) is not able to register to an event grid topic because of an Unauthorized (401) error. Running the same function in azure function cli on windows or linux does work.

Repro steps

  1. Create new azure function with EventGrid binding and docker support
  2. Run on azure cli
  3. Call http://localhost:7071/runtime/webhooks/EventGridExtensionConfig -> works: 404 with cannot find function: ''
  4. build and run docker (e.g. on port 8100)
  5. Call http://localhost:8100/runtime/webhooks/EventGridExtensionConfig ->does not work: 401

Expected behavior

Running the azure function host with eventGrid extension in docker should also disable the authentication as when running in azure cli

Actual behavior

The extension cannot be run in docker because the registration fails with an 401 error.

Known workarounds

none

Related information

Provide any related information

  • Microsoft.NET.Sdk.Functions 1.0.14
  • Microsoft.Azure.WebJobs.Extensions.EventGrid 2.0.0-beta2

JoschaMetze avatar Aug 17 '18 10:08 JoschaMetze

Any updates on this? I really need this feature.

pekebuda avatar Jan 24 '19 19:01 pekebuda

Having the same issue, but on Azure instead of locally. Attempting to run a function app in a Linux App Service Plan (using "Code" mode, thus managed container) and getting HTTP 401 despite providing a host key in the code query string parameter.

vangroan avatar Mar 02 '19 22:03 vangroan

I am having exactly the same issue in docker. How do we work around this?

darrenhull avatar Oct 31 '19 16:10 darrenhull

Can we get some feed back on this please? its been active for 4 months and not a single response, how is this helping the community?

darrenhull avatar Dec 04 '19 08:12 darrenhull

Have you updated the dockerfile to the latest function core runtime? They keep changing the names quite often, so I ended up using an old runtime for some time. I don't have this issue anymore, but can't really pin it down to either a runtime change or a config change on my part. One other workaround is of course to use a http trigger that can also be used for a eventgrid subscription.

JoschaMetze avatar Dec 04 '19 09:12 JoschaMetze

Thanks for feeding back. I'm using the following images to build and run the container: installer base: FROM microsoft/dotnet:2.2-sdk AS installer-env image base: FROM mcr.microsoft.com/azure-functions/dotnet:2.0

Yeah I know about the HTTP function but its a bit of a pain having to change them all to HTTP.

darrenhull avatar Dec 04 '19 09:12 darrenhull

Just double checked my code and you are right, the error is still exisiting in the current docker image. Also checked my event grid subscriptions and for docker targets they are all using the http trigger. So no update on that one from my side, sorry.

JoschaMetze avatar Dec 04 '19 09:12 JoschaMetze

Ah that makes sense. Thanks for your input though.

If only someone from the Azure team would engage then we would at least know if they plan to do anything about it, otherwise I will have to move to the HTTP triggers. :(

darrenhull avatar Dec 04 '19 10:12 darrenhull

its very disappointing that we haven't had any feed back on this issue. Whats the point in allowing us to raise issues if you are not going to feedback!!

darrenhull avatar Feb 20 '20 10:02 darrenhull

Has there been any movement on this yet?

darrenhull avatar Sep 01 '20 12:09 darrenhull

This is indeed an issue. Any news from the Azure team ?

agouriou avatar Oct 15 '20 15:10 agouriou

It's working when function is started in docker using Visual studio, but during creation of container using compose file it's not.

aliluyko89 avatar Nov 09 '20 20:11 aliluyko89

Same issue here.

diegobrunetti avatar Jan 29 '21 22:01 diegobrunetti

Any update on this?

MarkiEC13 avatar Jun 28 '22 10:06 MarkiEC13

any update on this?

jjan123 avatar Nov 23 '22 01:11 jjan123