Azure Function - Service Bus Trigger (SAS Tokens)

arb 1 Reputation point
2020-06-05T08:29:14.67+00:00

Hi,

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.
623 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,971 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 70,421 Reputation points
    2020-07-03T07:26:10.98+00:00

    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.