---
schema_version: "1"
id: db9053d645dba115043e5827f0b433d78077051cfe4e9bdff4ac4064af730ce6
title: Using Anypoint Studio to Configure Azure Service Bus Connector 3.8
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/microsoft-azure-sb-connector/latest/azure-service-bus-connector-studio.md
canonical_url: https://docs.mulesoft.com/microsoft-azure-sb-connector/latest/azure-service-bus-connector-studio
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 7ac2a20380a49da353aeb66e0dc9b861876ec3336e1a4bb48c5fb29805472523
description: MuleSoft Documentation Site
release: "3.8"
latest: true
---
---
product: Azure Service Bus Connector
version: 3.8
is-latest-version: true
---

# Using Anypoint Studio to Configure Azure Service Bus Connector 3.8

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Anypoint Studio (Studio) editors help you design and update your Mule applications, properties, and
configuration files.

To add and configure a connector in Studio:

1.  [Create a Mule project](#create-mule-project).

2.  [Add the connector to your Mule project](#add-connector-to-project).

3.  [Configure an input source for the connector’s flow](#configure-input-source).

4.  [Add a connector operation to the flow](#add-connector-operation).

5.  [Configure a global element for the connector](#configure-global-element).

    - [Shared Access Signature (SAS)](#configure-global-element-sas-connection)

    - [Azure Active Directory (AAD)](#configure-global-element-aad-connection)

If you are new to configuring connectors in Studio, see
[Using Anypoint Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio).
If, after reading this topic, you need additional information about the connector fields, see the
[Azure Service Bus Connector Reference](https://docs.mulesoft.com/microsoft-azure-sb-connector/latest/azure-service-bus-connector-reference).

## Create a Mule Project

In Studio, create a new Mule project in which to add and configure the connector:

1.  In Studio, select **File > New > Mule Project**.

2.  Enter a name for your Mule project and click **Finish**.

## Add the Connector to Your Mule Project

Add Azure Service Bus Connector to your Mule project to automatically populate the XML code with the
connector’s namespace and schema location and add the required dependencies to the project’s
`pom.xml` file:

1.  In the **Mule Palette** view, click **(X) Search in Exchange**.

2.  In **Add Modules to Project**, type `azure service bus` in the search field.

3.  Click **Azure Service Bus** in **Available modules**.

4.  Click **Add**.

5.  Click **Finish**.

Adding a connector to a Mule project in Studio does not make that connector available to other
projects in your Studio workspace.

## Configure an Input Source

An input source initiates a flow when a specified condition is met. You can configure one of these
input sources to use with Azure Service Bus Connector:

- `Message Listener`  
  Receives messages from the specified queue or subscription

- `HTTP Listener`  
  Initiates a flow each time it receives a request on the configured host and port

- `Scheduler`  
  Initiates a flow when a time-based condition is met

For example, to configure **Message listener**, follow these steps:

1.  In the **Mule Palette** view, select the Azure Service Bus Connector, then select **Message
    listener**.

2.  Drag **Message listener** to the Studio canvas.

3.  On the **Message listener** configuration screen, optionally change the value of the **Display
    Name** field.

4.  From **Ack Mode**, select from these options:

    - **Auto**  
      Automatic acknowledgment of the received message only if the application flow executes
      successfully

    - **Immediate**  
      Automatic acknowledgment of the message once it is consumed and prior to any processing of the
      message

    - **Manual**  
      Delegates the responsibility for acknowledging the message to the application logic

5.  In the **Destination** section, enter:

    - **Destination name**  
      Name of the destination queue from which messages are received

    - **Subscription name**  
      Name of the subscription from which messages are received

6.  Click the plus sign (+) next to the **Connector configuration** field to
    [configure a global element](#configure-global-element) that can be used by all instances of
    **Message listener** in the app.

7.  (Optional) To receive messages from session IDs that are generated dynamically and not known in
    advance, select the **Advanced** tab and select **Enable Dynamic Sessions**. When this option is
    enabled, each consumer continuously accepts the next available Service Bus session, drains it,
    and rolls to the next one, instead of locking a fixed **Message Session Id**.

    - Use **Number Of Consumers** to control how many sessions are processed concurrently.

    - Use **Session Idle Timeout** (an ISO-8601 duration such as `PT30S`) to control how long a
      consumer waits for the next message in the currently locked session before releasing it and
      rolling to the next available session.

    **Enable Dynamic Sessions** cannot be combined with a fixed **Message Session Id** or with
    **Consume From Dead Letter Queue**. For details about these fields, see the **Message Listener**
    section of the
    [Azure Service Bus Connector Reference](https://docs.mulesoft.com/microsoft-azure-sb-connector/latest/azure-service-bus-connector-reference#message-listener).

## Add a Connector Operation to the Flow

When you add a connector operation to your flow, you immediately define a specific operation for
that connector to perform.

To add an operation for Azure Service Bus Connector, follow these steps:

1.  In the **Mule Palette** view, select **Azure Service Bus** and then select the desired
    operation.

2.  Drag the operation onto the Studio canvas to the right of the input source.

## Configure a Global Element for the Connector

When you configure a connector, it’s best to configure a global element that all instances of that
connector in the app can use. Configuring a global element requires you to provide the
authentication credentials the connector uses to access the target Azure Service Bus Messaging
system. One configuration you will have to configure is the connection provider. Azure Service Bus
Connector accepts two types of connections:

- [Shared Access Signature (SAS)](#configure-global-element-sas-connection)

- [Azure Active Directory (AAD)](#configure-global-element-aad-connection)

### Shared Access Signature (SAS) authentication

To configure Shared Access Signature authentication for Azure Service Bus Connector, follow these
steps:

1.  Select the name of the connector in the Studio canvas.

2.  In the configuration screen for the operation, click the plus sign (+) next to the **Connector
    configuration** field to access the global element configuration fields.

3.  On the **General** tab, select the `Shared Access Signature` in the connection dropdown, and
    configure the following required fields for SAS authentication:

    1.  Enter the Azure **Service namespace**.  
        This is the unique name assigned to the namespace when it was created and is the host-name
        portion of the URL, for example:

        `https://{serviceNamespace}.servicebus.windows.net/{path}`

    2.  Enter the Azure **Shared access key name**.  
        This is the name of the SAS token configure in the Azure Service Bus namespace.

    3.  Enter the Azure **Shared access key**.  
        This is the name of your SAS token.

    The following screenshot shows an example of configuring SAS authentication for Azure Service
    Bus Connector:

    ![Authentication configuration of fields on the General tab](/mulesoft/current/en-us/microsoft-azure-sb-connector/latest/_images/azure-service-bus-sas-connection.png)

    You can reference a configuration file that contains ANT-style property placeholders
    (recommended), or you can enter your authorization credentials in the global configuration
    properties. For information about the benefits of using property placeholders and how to
    configure them, see
    [Anypoint Connector Configuration](https://docs.mulesoft.com/connectors/introduction/intro-connector-configuration-overview).

4.  On the **Advanced** tab, optionally specify reconnection information, including a reconnection
    strategy.

5.  Click **Test Connection** to confirm that Mule can connect with the specified server.

6.  Click **OK**.

> [!NOTE] Azure Service Bus Connector cannot perform a connectivity test at startup using the
> `Test Connection` button in the global element of the connector configuration when you restrict
> access to your resources and you have a security policy with permissions at the resource level
> only. This is because the security policy targets the root level of the namespace, which might be
> forbidden due to the customized policy applied to the shared access key.

### Azure Active Directory (AAD) authentication

To configure Azure Active Directory authentication for Azure Service Bus Connector, follow these
steps:

1.  Select the name of the connector in the Studio canvas.

2.  In the configuration screen for the operation, click the plus sign (+) next to the **Connector
    configuration** field to access the global element configuration fields.

3.  On the **General** tab, select `Active Directory Connection` in the connection dropdown, and
    configure the following required fields for AAD authentication:

    1.  Enter the Azure **Service namespace**.  
        This is the unique name assigned to the namespace when it was created and is the host-name
        portion of the URL, for example:

        `https://{serviceNamespace}.servicebus.windows.net/{path}`

    2.  Enter the Azure **Tenant Id**.

    3.  Enter the Azure **Client Id**.

    4.  Enter the Azure **Client Secret**.

    The following screenshot shows an example of configuring AAD authentication for Azure Service
    Bus Connector:

    ![Authentication configuration of fields on the General tab](/mulesoft/current/en-us/microsoft-azure-sb-connector/latest/_images/azure-service-bus-aad-connection.png)

    You can reference a configuration file that contains ANT-style property placeholders
    (recommended), or you can enter your authorization credentials in the global configuration
    properties. For information about the benefits of using property placeholders and how to
    configure them, see
    [Anypoint Connector Configuration](https://docs.mulesoft.com/connectors/introduction/intro-connector-configuration-overview).

4.  On the **Advanced** tab, optionally specify reconnection information, including a reconnection
    strategy.

5.  Click **Test Connection** to confirm that Mule can connect with the specified server.

6.  Click **OK**.

> [!NOTE] Azure Service Bus Connector cannot perform a connectivity test at startup using the
> `Test Connection` button in the global element of the connector configuration when you restrict
> access to your resources and you have a security policy with permissions at the resource level
> only. This is because the security policy targets the root level of the namespace, which might be
> forbidden due to the customized policy applied to the app registration.

## View the App Log

You can view the app log as follows:

- If you’re running the app from the Anypoint Platform, the output is visible in the Anypoint Studio
  console window.

- If you’re running the app using Mule from the command line, the app log is visible in your OS
  console. Unless the log file path was customized in the app’s log file (`log4j2.xml`), you can
  also view the app log in this default location: `MULE_HOME/logs/<app-name>.log` For more
  information about the app log, see
  [Configuring Logging](https://docs.mulesoft.com/mule-runtime/latest/logging-in-mule).

### Reduce Excessive Logging

When using the **Message Listener** source, the Azure Service Bus library emits an INFO-level log
message approximately every 30 seconds, indicating that no new messages were received. To avoid this
excessive logging, add the following AsyncLogger element to the `log4j.xml` file:

`<AsyncLogger name="com.microsoft.azure.servicebus.primitives.CoreMessageReceiver" level="WARN"/>`

## Next Step

After you configure a global element and connection information, configure the other fields for the
connector.

## See Also

- [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors)

- [Using Anypoint Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio)

- [Azure Service Bus Connector Reference](https://docs.mulesoft.com/microsoft-azure-sb-connector/latest/azure-service-bus-connector-reference)

- [Salesforce Help](https://help.salesforce.com)
