On this page you will learn how to connect your Azure Gateway to Obsidian step-by-step.
Overview of this Guide
Prerequisites
The following is required to proceed:
A running Obsidian instance
{tenant-id}.frontend.obsidian.local
Access to the Azure API Management with at least one service instance created
Docker to use the image of our agent (that acts as an intermediary)
Create a new Environment in Obsidian
To get started, simply open your Obsidian instance and follow the instructions below.
Add an Environment for Azure
Navigate to “Environments” in the menu on the left side
Click on the “Create New Environment” button
Fill in the form (as exemplarily shown below)
Confirm by clicking on the "Create New Environment" button
Request an Environment Token
Click on the “Request Token” button
Copy & save the token that appears above (it will be needed later)
You’ve completed the first step!
Provide the Gateway Information
The following describes how to create the gateway configuration for an Azure Gateway Agent.
Gateway Configuration
Create a new YAML file:
type: AZURE subscriptionId: {azure-subscription-id} serviceName: {azure-service-name} resourceGroupName: {azure-resource-group-name} tenantId: {azure-tenant-id} clientId: {azure-client-id} clientSecret: {azure-client-secret}
subscriptionId
: Insert the ID of the subscription that is assigned to your Azure API Management serviceserviceName
: Insert the name of your Azure API Management service instanceresourceGroupName
: Insert the name of the resource group that is assigned to your Azure API Management service instancetenantId
/clientId
/clientSecret
: Insert the credentials of an authorized application
See our Q&A below if you want to learn more about how to get these values.
Currently, each Azure agent is specific to one API Management service.
If you want to manage multiple services, you will require an agent instance for each service.
Example
type: AZURE subscriptionId: abc123ab-c123-abc1-23ab-c123abc123ab serviceName: my-azure-api-management-service resourceGroupName: my-azure-api-management-resource-group tenantId: cba321cb-a321-cba3-21cb-a321cba321cb clientId: 321cba32-1cba-321c-ba32-1cba321cba32 clientSecret: ~ABC1~23ABC123ABC123ABC123ABC123ABC123AB
Q&A
You’ve completed the second step!
Create an Agent as Intermediary
The following describes how to create a Docker container for the agent. It is described using a Docker compose file so that additional agents can be easily added to your docker stack later.
Agent Configuration
Create a docker-compose.yml:
version: '3.3' services: # Azure Gateway Agent spring-azure-agent: image: ghcr.io/apiida/obsidian-agent:latest environment: - 'agentToken={the-token-requested-in-step-1}' - 'backendUrl=wss://{your-tenant-id}.backend.obsidian.local/jsonRpc' - 'gateway-config=/workspace/azureConfig.yaml' volumes: - {path-to-the-agent-config-created-in-step-2}:/workspace/azureConfig.yaml:rw
agentToken
: Insert the token that you’ve received in the first stepbackendUrl
: Insert your tenant id into the backend URLvolume
: Add the path to your gateway configuration (the file you’ve created in the second step)
Example
version: '3.3' services: # Azure Gateway Agent spring-azure-agent: image: ghcr.io/apiida/obsidian-agent:latest environment: - 'agentToken=3:9b811c57-bdbf-4539-923f-25b7b5c16b4a' - 'backendUrl=wss://example.backend.obsidian.local/jsonRpc' - 'gateway-config=/workspace/azureConfig.yaml' volumes: - ./azureConfig.yaml:/workspace/azureConfig.yaml:rw
You’ve completed the third step!
You're ready to establish the connection between Obsidian and your Azure Gateway.
Establish the connection
Establish the connection between Obsidian and your Azure Gateway by starting the Agent (respectively the docker container that contains the agent).
Start your Agent
For example, execute the following command in the directory where the docker compose file is located to start the docker container that contains the agent you have just configured:
docker-compose up -d
Check the Agent's Status
Head over to your Obsidian instance
Select “Environments” in the menu on the left side
Your Azure Gateway should now be connected to Obsidian
You’ve completed the last step!
You can now interact with your Azure Gateway through Obsidian. Try it right now and discover your APIs!
💡 Tip: It is easy to add more agents!
Repeat this guide or that of another gateway and simply add the agents to the existing Docker compose file.