question

PoojaKumari-5356 avatar image
0 Votes"
PoojaKumari-5356 asked PoojaKumari-5356 commented

issues while Configuring Event Grid on IoT hub

Hi,

While configuring Event Grid on the IoT hub in creating event subscription > endpoint details > select an endpoint > function I am unable to get function name.

Could anyone please let me know where I am missing or doing this incorrect.

I have attached the screenshot for the reference.134176-error.jpg

Also I am following this document "https://docs.microsoft.com/en-us/learn/modules/ingest-data-into-azure-digital-twins/5-set-up-iot-hub" and in step "Configure Event Grid on your IoT hub" I am getting error.

Regrads,
Pooja Kumari


azure-iot-hubazure-event-gridazure-digital-twins
error.jpg (164.1 KiB)
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello, @PoojaKumari-5356 Could you please confirm if the Azure Function App & Azure IoTHub are created in the same subscription's resource group?

Please include the full error message so that we help you in a better way!

134468-image.png


0 Votes 0 ·
image.png (27.4 KiB)

Hi @SatishBoddu-MSFT , yes both Azure function app and azure IoT hub using the same subscription's resource group.

Also, I don't see any error the only problem I am facing is that I am not getting function details in function while configuring Event Grid on the IoT hub.

0 Votes 0 ·

one more thing I would like to add on here, while deploying the function in visual studio it deployed successfully but throwed few errors below

Restored C:\Users\My Laptop\Documents\twin\azure_func\azure_func.csproj (in 565 ms).
C:\Users\My Laptop\Documents\twin\azure_func\TwinsFunction.cs(24,27): error AZF0001: Async void can lead to unexpected behavior. Return Task instead. [C:\Users\My Laptop\Documents\twin\azure_func\azure_func.csproj]
The terminal process "C:\Program Files\dotnet\dotnet.exe 'publish', '--configuration', 'Release', '/property:GenerateFullPaths=true', '/consoleloggerparameters:NoSummary'" terminated with exit code: 1.

I guess this can be the reason behind not getting function name.

1 Vote 1 ·

1 Answer

SatishBoddu-MSFT avatar image
0 Votes"
SatishBoddu-MSFT answered PoojaKumari-5356 commented

Hello, @PoojaKumari-5356 Sorry for the inconvenience caused!

I was able to repro the issue, as the error gives a more accurate reason.

Your Azure FunctionApp is Ready, but the Function code is not ready. That means there is an issue in the Function code.

Please make use of this piece of code: Remove the void word and use the Task

  -->   public async Task Run([EventGridTrigger] EventGridEvent eventGridEvent, ILogger log)

Please add the declaration as well:

 using System.Threading.Tasks;

134867-image.png

Note: I have submitted a report to update the MSLearn content on the page, so please make use of the above workaround to get unblocked until it is fixed!!!

Please comment in the below section for further help in this matter!.



image.png (56.9 KiB)
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Satish,

Thanks for the solution. It worked and my deployment was successful this time without any errors but as I mentioned I am still not getting function name While configuring Event Grid on the IoT hub in creating event subscription > endpoint details > select an endpoint > function.

Do you think we need to create function in function app on portal? I have pasted the image below for the reference what I am trying to say.

135375-image.png


0 Votes 0 ·
image.png (126.6 KiB)

Hello Pooja, When we try to deploy the Function code from the Visual Studio, we select the FunctionApp from our subscription's resource group, and then the deployment happens.

Below, I am trying to revisit the Azure Function code deployment steps, Just FYI.

Yes, in the Azure portal, i have created the Function App as a first step.

135568-image.png

Right-click the solution and select Publish -->select the Function App while starting the Deployment.

135621-image.png

We see the Publish\Deployment of Function code is a success!

135594-image.png

I see the Function is deployed to the selected FunctionApp.

135546-image.png


If you need further help in this matter, please comment in the below section and we will be happy to help you offline.



0 Votes 0 ·
image.png (143.5 KiB)
image.png (173.2 KiB)
image.png (132.4 KiB)
image.png (120.8 KiB)

Hi Satish,

I am still getting lot of issues. Is there any way to contact you online apart from here as I have to wait for your reply here and its getting delayed for me.

0 Votes 0 ·

Hello @PoojaKumari-5356 Sure thing! We are happy to help you offline on this issue.

0 Votes 0 ·