Forum Discussion

RajeshKapur's avatar
RajeshKapur
Icon for Helper I rankHelper I
1 year ago

Access Azure Service Bus Behind Private Endpoint| From Microsoft Fabric | Publish and Read Message

Hi,

 

We have azure service bus and private end point to access the same in the private VNet. How can I use the same service bus to push the message and read the message in the queue from Microsoft Fabric.

 

Thanks,

Rajesh Kapur

7 Replies

  • Apologies for the confusion; we need to access the Azure Service Bus from Microsoft Fabric only i.e. have to push the message to Azure Service Bus from Microsoft Fabric.

  • v-csrikanth's avatar
    v-csrikanth
    Icon for Community Support rankCommunity Support

    Hi RajeshKapur 
    To access Azure Service Bus behind a private endpoint from Microsoft Fabric, follow below steps:

    ​Configure Azure Service Bus with a Private Endpoint.

    Grant Network Access to Fabric

    • Make sure Fabric's managed identity or azure function (if used) has network access to Service Bus.
    • Use Azure private link or VNet integration.

    Use a Fabric Notebook:

    • Install dependencies:
       !pip install azure-servicebus
    • Connect and send a message:

    ****************************************************
    from azure.servicebus import ServiceBusClient, ServiceBusMessage

    CONNECTION_STR = "your_private_endpoint_connection_string"

    QUEUE_NAME = "your-queue"

    with ServiceBusClient.from_connection_string(CONNECTION_STR) as client:

        with client.get_queue_sender(QUEUE_NAME) as sender:

            sender.send_messages(ServiceBusMessage("Message from Fabric"))

            print("Message sent successfully!")
    ****************************************************

    If the above information helps you, please give us a Kudos and marked the Accept as a solution.
    Best Regards,
    Community Support Team _ C Srikanth.

    • RajeshKapur's avatar
      RajeshKapur
      Icon for Helper I rankHelper I

      How to enable Grant Network Access to Fabric to private end point of Azure Service Bus. Seems, The resource type is still not supported by Fabric

  • v-csrikanth's avatar
    v-csrikanth
    Icon for Community Support rankCommunity Support

    Hi RajeshKapur 
    Sorry for the misunderstanding the limitations. After a through research found the direct access to Azure Service Bus via private endpoints from Fabric Notebooks is not supported at this time.
    Managed private endpoints in Fabric currently support data sources such as Azure Storage and Azure SQL Database, but not Azure Service Bus.

    While direct notebook access is limited, Fabric's Event Streams feature allows integration with Azure Service Bus. This setup enables messages from the Service Bus to be fetched into Fabric's event stream and routed to various destinations within Fabric.
    Reference link : https://learn.microsoft.com/en-us/fabric/real-time-intelligence/event-streams/add-source-azure-service-bus

    If the above information helps you, please give us a Kudos and marked the Accept as a solution.
    Best Regards,
    Community Support Team _ C Srikanth.

  • Do we have any documentation around. The steps mentioned above doesn't seems to be working. Reason is Azure Service Bus is behind Private End Point.

  • v-csrikanth's avatar
    v-csrikanth
    Icon for Community Support rankCommunity Support

    Hi RajeshKapur 

    Thanks for reaching out to the Fabric Community.

    • Currently, Microsoft Fabric Eventstream cannot connect to Azure Service Bus secured with a private endpoint, as Fabric does not support VNet integration or managed private endpoints for Eventstream.

    • Service Bus private endpoints only allow access from within your Azure VNet; Fabric’s managed SaaS environment is outside your private network.

    • The official Microsoft documentation states that to access a Service Bus namespace over a private endpoint, the consuming resource (application or service) must also be in the same VNet or peered VNet, or be able to route through the private network.
    • As a workaround, temporarily enable public access to Service Bus if permitted, or use an intermediary (such as Azure Functions or Logic Apps in your VNet) to relay messages from Service Bus to Fabric.

    References:


    If the above information is helpful, please give us Kudos and mark the response as Accepted as solution.
    Best Regards,
    Community Support Team _ C Srikanth.