1

For local development I want to connect my Azure Function to a locally running RabbitMQ instance and run everything locally. But the queue is not found, even though I made sure it exists (see screenshot at the end).

The error message:

Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.ProcessEvent'. RabbitMQ.Client: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=404, text='NOT_FOUND - no queue 'test' in vhost '/''

Remotely using our central RabbitMQ instance I was able to receive events by using an appropriate connection string, but locally something goes wrong...

Below the program files and project files (I used VS), and the complete output.

Function.cs

using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Extensions.Logging;

namespace FunctionApp1;

public class Function1
{
    private readonly ILogger<Function1> _logger;
    public Function1(ILogger<Function1> logger)
    {
        _logger = logger;
    }

    [Function("ProcessEvent")]
    public void Run(
            [RabbitMQTrigger("test", ConnectionStringSetting = "RabbitMQConnection")] string message)
    {
        _logger.LogInformation($"RabbitMQ message received: {message}");

        _logger.LogInformation("Message processing completed.");
    }
}

local.settings.json

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
    "RabbitMQConnection": "amqp://guest:guest@localhost:5672"
  }
}

host.json

{
  "version": "2.0",
  "logging": {
    "applicationInsights": {
      "samplingSettings": {
        "isEnabled": true,
        "excludedTypes": "Request"
      },
      "enableLiveMetricsFilters": true
    }
  }
}
 

Program.cs

using Microsoft.Azure.Functions.Worker;
using Microsoft.Azure.Functions.Worker.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

var builder = FunctionsApplication.CreateBuilder(args);

builder.ConfigureFunctionsWebApplication();

builder.Services
    .AddApplicationInsightsTelemetryWorkerService()
    .ConfigureFunctionsApplicationInsights();

builder.Build().Run();

Project File

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <AzureFunctionsVersion>v4</AzureFunctionsVersion>
    <OutputType>Exe</OutputType>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>

    <ItemGroup>
        <FrameworkReference Include="Microsoft.AspNetCore.App" />
        <PackageReference Include="Microsoft.ApplicationInsights.WorkerService" Version="2.23.0" />
        <PackageReference Include="Microsoft.Azure.Functions.Worker" Version="2.50.0" />
        <PackageReference Include="Microsoft.Azure.Functions.Worker.ApplicationInsights" Version="2.50.0" />
        <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="2.1.0" />
        <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.RabbitMQ" Version="2.0.4" />
        <PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="2.0.6" />
        <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.22.1" />
    </ItemGroup>

</Project>

The complete output:

'local.settings.json' found in root directory (C:\Users\user\source\repos\FunctionApp1\bin\Debug\net8.0).
Resolving worker runtime to 'dotnet-isolated'.


Azure Functions Core Tools
Core Tools Version:       4.5.0+e74aae22c9630777c9f58354f290a6e214218546 (64-bit)
Function Runtime Version: 4.1044.400.25520

[2025-11-26T09:56:59.113Z] Found C:\Users\user\source\repos\FunctionApp1\FunctionApp1.csproj. Using for user secrets file configuration.
[2025-11-26T09:57:01.068Z] Worker process started and initialized.
[2025-11-26T09:57:01.148Z] Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.ProcessEvent'. RabbitMQ.Client: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=404, text='NOT_FOUND - no queue 'test' in vhost '/'', classId=50, methodId=10.
[2025-11-26T09:57:01.166Z] Error indexing method 'Functions.ProcessEvent'
[2025-11-26T09:57:01.168Z] Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.ProcessEvent'. RabbitMQ.Client: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=404, text='NOT_FOUND - no queue 'test' in vhost '/'', classId=50, methodId=10.
[2025-11-26T09:57:01.172Z] Function 'Functions.ProcessEvent' failed indexing and will be disabled.
[2025-11-26T09:57:01.176Z] No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
[2025-11-26T09:57:01.190Z] The 'ProcessEvent' function is in error: Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.ProcessEvent'. RabbitMQ.Client: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=404, text='NOT_FOUND - no queue 'test' in vhost '/'', classId=50, methodId=10.

Functions:

        ProcessEvent: rabbitMQTrigger

For detailed output, run func with --verbose flag.
[2025-11-26T09:57:06.121Z] Host lock lease acquired by instance ID '000000000000000000000000A4E593EA'.

RabbitMQ Config

New contributor
Heinrich is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
1
  • How are you running RabbitMQ? As docker image or installed directly? Did you try using address for localhost without guest:guest? Commented Nov 27 at 12:55

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.