in azure/functions/decorators/function_app.py [0:0]
def dapr_publish_output(self,
arg_name: str,
pub_sub_name: str,
topic: str,
dapr_address: Optional[str] = None,
data_type: Optional[
Union[DataType, str]] = None,
**kwargs) \
-> Callable[..., Any]:
"""The dapr_publish_output decorator adds
:class:`DaprPublishOutput` to the :class:`FunctionBuilder` object
for building :class:`Function` object used in worker function
indexing model.
This is equivalent to defining DaprPublishOutput
in the function.json which enables function to publish 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-dapr-publish-output-binding
:param arg_name: The name of the variable that represents DaprState
output object in function code.
:param pub_sub_name: The pub/sub name to publish to.
:param topic: The name of the topic to publish to.
:param dapr_address: Dapr address, it is optional field, by default
ßit will be set to http://localhost:{daprHttpPort}.
:param data_type: Defines how Functions runtime should treat the
parameter value
:param kwargs: Keyword arguments for specifying additional binding
fields to include in the binding json
:return: Decorator function.
"""
@self._configure_function_builder
def wrap(fb):
def decorator():
fb.add_binding(
binding=DaprPublishOutput(
name=arg_name,
pub_sub_name=pub_sub_name,
topic=topic,
dapr_address=dapr_address,
data_type=parse_singular_param_to_enum(data_type,
DataType),
**kwargs))
return fb
return decorator()
return wrap