Configure Azure Service Bus as the Outpost Internal Message Queue
Azure Resource Concepts
Azure's resource hierarchy:
- Tenant: The top-level organizational boundary representing a company or project
- Subscription: A billing account that contains and manages resources within a tenant
- Service Principal: An identity used for programmatic access, similar to an IAM role in other clouds
- Resource Group: A logical container that groups related Azure resources for easier management
- Service Bus Namespace: A messaging container within Azure Service Bus where you create topics and subscriptions for event routing
This implementation leverages Azure Service Bus topics and subscriptions within a namespace to provide reliable message delivery with Outpost's multi-tenant architecture.
User Setup Requirements
Outpost requires specific Azure permissions to manage Service Bus resources on your behalf:
Required Role:
- Azure Service Bus Data Owner on the Service Bus namespace
Required Permissions:
- Create and delete topics and subscriptions
- Publish messages to topics
- Consume messages from subscriptions
Recommended Setup:
- Optionally create a dedicated resource group to contain Outpost-related resources
- Create a dedicated Service Bus namespace for Outpost
- Assign the Service Principal used by Outpost the Azure Service Bus Data Owner role scoped to the namespace
This scoped permission model ensures Outpost can fully manage message routing within its designated namespace while maintaining security boundaries with your other Azure resources.
Azure Service Bus Setup for Outpost
Prerequisites
Install Azure CLI.
The following steps also make use of jq
for JSON parsing, so ensure it is installed on your system.
Login to Azure:
bash
1. Create Resource Group
Set variables:
bash
Create resource group:
bash
2. Create Service Bus Namespace
Generate unique namespace name (must be globally unique)
bash
Create Service Bus namespace:
bash
3. Create Service Principal
bash
Create service principal and capture output:
bash
4. Assign Permissions
Get the namespace resource ID:
bash
Assign Azure Service Bus Data Owner role:
bash
5. Configuration Values for Outpost
Get subscription ID:
bash
Echo all required values:
bash
6. Configure Outpost
In the Outpost configuration, use the values obtained above.
Example YAML
yaml
Example Environment Variables
This configuration allows Outpost to connect to your Azure Service Bus namespace and manage topics and subscriptions for internal message queuing.
Troubleshooting
failed to declare topic: failed to create topic outpost-delivery
This error can happen due to a race condition of multiple Outpost instances trying to create the same topic concurrently. To resolve this you can either:
- Run the services one at a time to ensure only one instance is creating the topic.
- Run the services again often resolves the issue as the topic may have been created by another instance.
Also see Avoid concurrent infra provisioning requests.