I am using MassTransit with Azure Service Bus in a Function App where I have a producer API sending messages via RequestClient<T>, and a consumer running in the Function App processing those messages and responding back. Everything works fine when debugging locally, but when deployed to Azure, the producer times out waiting for a response.
Expected Behavior
The producer sends a request using RequestClient<T> and expects a response.
The consumer processes the message and responds back using context.RespondAsync(response).
The producer should receive the response without timing out.
What I Have Already Checked
The MassTransit bus is started and working – My Function App has other consumers that process messages correctly.
Queues are separate for each consumer – I am not mistakenly sharing queues between multiple consumers.
In general all the configurations are ok because everything works fine when running locally.
I suspect the issue could be with the temporary response queue that MassTransit creates automatically.
Permissions issue with Managed Identity? – The Function App uses Managed Identity to connect to Azure Service Bus. Perhaps the Managed Identity does not have permissions to read from the response queue? I gave "owner" permission to the user assigned managed identities assigned to the producer API and the function App on the entire service bus namespace but it didn't fix the issue.
Producer config:
cfg.AddRequestClient<ConfirmBankTransferPurchaseMessage>(
new Uri("queue:confirm-banktransfer-purchase"), TimeSpan.FromMinutes(2));
cfg.AddRequestClient<ConfirmBankTransferPaymentMessage>(
new Uri("queue:confirm-banktransfer-payment"), TimeSpan.FromMinutes(2));
Consumer config:
busConfigurator.ReceiveEndpoint("confirm-banktransfer-purchase", e => e.ConfigureConsumer<ConfirmBankTransferPurchaseConsumer>(busContext));
busConfigurator.ReceiveEndpoint("confirm-banktransfer-payment", e => e.ConfigureConsumer<ConfirmBankTransferMidtermPaymentConsumer>(busContext));
My Questions
Does MassTransit require specific permissions for its temporary response queues when using Managed Identity on Azure?
If so, how can I ensure my Managed Identity has access to these queues?
Is there a way to debug the temporary response queue in MassTransit to confirm if messages are getting stuck there?
Would configuring a static response queue instead of a temporary one help? If so, how?
Any help would be greatly appreciated! Thanks in advance!

Azure Service Bus Data Ownerrole to the managed identity.Microsoft.Authorization/roleAssignments/write action.