Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This article summarizes the steps to develop and test locally by using the Azure Service Bus emulator.
- Docker desktop
- Minimum hardware requirements:
- 2 GB of RAM
- 5 GB of disk space
- Windows Subsystem for Linux (WSL) configuration (only for Windows):
Note
Before you continue with the steps in this article, make sure Docker Desktop is operational in the background.
To run the Service Bus emulator, you can use an automated script or a Linux container:
Before you run an automated script, clone the emulator's GitHub installer repository locally.
Use the following steps to run the Service Bus emulator locally on Windows:
Open PowerShell and navigate to the directory where the common scripts folder is cloned using
cd
:cd <path to your common scripts folder> # Update this path
Issue wsl command to open WSL at this directory.
wsl
Run the setup script ./LaunchEmulator.sh.Running the script brings up two containers: the Service Bus emulator and Sql Edge (a dependency for the emulator).
./Launchemulator.sh
To run the Service Bus emulator locally on Linux or macOS:
- Run the setup script LaunchEmulator.sh. Running the script brings up two containers: the Service Bus emulator and Sql Edge (a dependency for the emulator).
After the steps are successful, you can find the containers running in Docker.
By default, emulator uses config.json configuration file. You can configure entities by making changes to configuration file. To know more, visit make configuration changes
You can use the following connection string to connect to the Service Bus emulator:
When the emulator container and interacting application are running natively on local machine, use following connection string:
"Endpoint=sb://localhost;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;"
Applications (Containerized/Non-containerized) on the different machine and same local network can interact with Emulator using the IPv4 address of the machine. Use following connection string:
"Endpoint=sb://192.168.y.z;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;"
Application containers on the same bridge network can interact with Emulator using its alias or IP. Following connection string assumes the name of Emulator container is "servicebus-emulator":
"Endpoint=sb://servicebus-emulator;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;"
Application containers on the different bridge network can interact with Emulator using the "host.docker.internal" as host. Use following connection string:
"Endpoint=sb://host.docker.internal;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;"
You can use the latest client SDKs to interact with the Service Bus emulator across various programming languages. To get started, refer to the Service Bus emulator samples on GitHub.