How can we pass topic and subscription name from yaml in azure function - java

Sarupria Alpa 1 Reputation point

I want to fetch subscriptionName value from deployment.yaml , config map settings. How can I get the value from there.

public void Handler(
name = "ServiceBus",
topicName = "topicname",
connection = "ServiceBusConnectionString",
subscriptionName = "subscriptionName")
String message,
final ExecutionContext context) {}

I tried passing value of subscriptionName as subscriptionName = "%MY_SUBSCRIPTION_CONFIG%" . But that doesn't take value from yaml

@Gaurav Mantri could you please suggest

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
572 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,516 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Pramod Valavala 20,606 Reputation points Microsoft Employee

    To read from app settings (or environment variables) using %<key>% should do the trick. In K8s, you would have to configure all key-value pairs in a ConfigMap as container environment variables for them to be picked up.

    0 comments No comments