in azure/functions/decorators/function_app.py [0:0]
def service_bus_topic_output(self,
arg_name: str,
connection: str,
topic_name: str,
subscription_name: Optional[str] = None,
data_type: Optional[
Union[DataType, str]] = None,
access_rights: Optional[Union[
AccessRights, str]] = None,
**kwargs) -> \
Callable[..., Any]:
"""The service_bus_topic_output decorator adds
:class:`ServiceBusTopicOutput` to the :class:`FunctionBuilder` object
for building :class:`Function` object used in worker function
indexing model. This is equivalent to defining ServiceBusTopicOutput
in the function.json which enables function to write message(s) to
the service bus topic.
All optional fields will be given default value by function host when
they are parsed by function host.
Ref: https://aka.ms/azure-function-binding-service-bus
:param arg_name: The name of the variable that represents service
bus topic output object in function code.
:param connection: The name of an app setting or setting collection
that specifies how to connect to Service Bus.
:param topic_name: Name of the topic to monitor.
:param subscription_name: Name of the subscription to monitor.
:param data_type: Defines how Functions runtime should treat the
parameter value, defaults to DataType.UNDEFINED.
:param access_rights: Access rights for the connection string.
:return: Decorator function.
"""
@self._configure_function_builder
def wrap(fb):
def decorator():
fb.add_binding(
binding=ServiceBusTopicOutput(
name=arg_name,
connection=connection,
topic_name=topic_name,
subscription_name=subscription_name,
data_type=parse_singular_param_to_enum(data_type,
DataType),
access_rights=parse_singular_param_to_enum(
access_rights,
AccessRights),
**kwargs))
return fb
return decorator()
return wrap