Azure Function - Service Bus Trigger (SAS Tokens)

arb 1 Reputation point


We are using SAS token to adhere to group policy of key rotation. It seems that there is no way to bind an Azure Function trigger to ASB without using keys (not tokens).

Does anyone know if there is a way to use SAS tokens? The scenario is make a http request to a subscription end-point, SAS token is return and used to connect to the queue end-point. The key expires periodically so re validation is required. This is working for none AzFunc solution e.g. app services and solution deployed on aks.

Alternatively is it possible to write custom triggers for AzFunc?

any guidance or help would be greatly appropriated

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
392 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
3,021 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 54,456 Reputation points

    Hi @arb-6776

    Azure function service bus trigger only supports service bus connection string. You cannot use SAS token to make connection to the service bus.
    Ideally, any function app trigger would not be the recommended solution. But you can use the timer trigger that triggers the azure function from time to time. Inside the azure function, you can write your functionality to get the SAS token and use that SAS token to create the connection with servicebus and consume the messages.