Azure / Azure/Azure-Functions

Azure Event Grid Trigger function is not working locally and getting this error Error: connect ECONNREFUSED 127.0.0.1:7071

Open
#2,426 5 comments 1 reaction 1 assignee Claimed by @bhagyshricompany View on GitHub
Needs: Author feedback
Dominant language
PowerShell
Stars
1.1k
Forks
215
Avg merge
4h 2m
Merged PRs (30d)
1

Description

I have used below code and got error Error: connect ECONNREFUSED 127.0.0.1:7071:

```
using System;
using Azure.Messaging;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Extensions.Logging;

namespace FunctionApp92
{
public class TestRithwik
{
private readonly ILogger _logger;

public TestRithwik(ILogger logger)
{
_logger = logger;
}

[Function(nameof(TestRithwik))]
public void Run([EventGridTrigger] CloudEvent cloudEvent)
{
_logger.LogInformation("Event type: {type}, Event subject: {subject}", cloudEvent.Type, cloudEvent.Subject);
}
}
}

```

![enter image description here](https://i.imgur.com/1DopsYY.png)

Headers used:

![enter image description here](https://i.imgur.com/F8fFmmZ.png)

Tried ngrok also but it didnt work

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.