I'd like to directly read messages from Azure Service Bus with Nuclio using the Python runtime. Does anyone have experience with this?
I'm assuming I need to create the ServiceBusClient inside of an init_context function, but the examples from azure show that occurring within it's own context manager, like so:
conn_str = <CRED>
queue_name = <NAME>
with ServiceBusClient.from_connection_string(conn_str) as client:
with client.get_queue_receiver(queue_name, max_wait_time=30) as receiver:
for msg in receiver:
print(str(msg))
I'm assuming best practice would be to create the ServiceBusClient inside of init_context, then call setattr(context.user_data, 'my_servicebus', my_servicebus.from_connection_string())
Anyone have experience with this?