Deploying the Azure Agent in Docker

Deploy the Azure Agent as a stand alone application in Docker by downloading the Azure agent image.

Before you begin

Make sure that you have:
  • Started the Docker client.
  • federated API management Version 11.1.7 and later.
  • Verified if Azure API Management Service and federated API management for which you want to establish connectivity using the Agent are up and running.
  • Assigned the Cloud App admin, Website Contributor, and API Management Service Reader roles at the subscription level. For details about assigning roles, see Azure documentation. The documentation explains how to assign the role at the Resource group level. Follow the steps and assign the Website Contributor role at the subscription level.
  • Assigned the Service principle to your Azure API Management Service to generate the client ID and client secret. The generated credentials must be added to the Environment variables, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET.

    To assign the Service principle, use the Azure portal or Azure CLI. For details, see Using Azure Portal, Using Azure CLI.

Download and load the Azure agent Docker image

  1. Click Download resources.
  2. Download docker image corresponding to the Azure API Management gateway standalone container agent (amd64) or Azure API Management gateway standalone container agent (arm64) component based on your system architecture.
  3. Load the Docker image from a tar file using the following command:

    docker load -i <filename.tar>

Deploy the Azure agent Docker image

  1. Configure the below set of properties to establish connection between Azure API Management Service and federated API management.

    Unzip the docker image and run the following commands:

    cd devops

    cd docker-compose

    .env and docker-compose.yml file contains properties related to Azure API Management Service configurations, Agent configurations, Runtime configurations, and federated API management configurations. For more details on environment variables, see Environment variables applicable for Azure API Management Service.

    Note: To securely provide sensitive information like passwords in Docker or Kubernetes deployments, use Docker secrets or Kubernetes secrets. Deploy the Docker image accordingly to utilize these secrets for secure password management.
  2. Run the following command:
    docker-compose up -d

    The azure agent application starts.

  3. Verify if Azure API Management Service(runtime) is registered with the federated API management and if the APIs and metrics are published and synchronized with federated API management respectively.
    1. Open the federated API management application.
    2. On the Catalog page, click the Runtimes.
    3. Check if the runtime is registered with federated API management by verifying if the AZURE_API_MANAGEMENT_SERVICE_NAME (specified in the .env file) is listed. If the runtime is listed, it indicates that the runtime is successfully registered with the federated API management.
    4. Check if the runtime's health status is sent to federated API management by verifying the status of that corresponding runtime in the Status column. The status appears green only if the runtime is up and the heartbeats (status) are received successfully by federated API management.

    5. Check if the APIs are published from the runtime to federated API management by selecting Details from Action menu of the corresponding runtime for which, you want to verify if its APIs are published to federated API management.
    6. Click Relations tab.

      A list of all the APIs associated with the runtime appears. You can also view the runtimes and its associated APIs in the APIs tab of the Catalog page.

    7. Check if the API metrics are synchronized from the runtime to federated API management by clicking the monitor icon under the Action column corresponding to the runtime for which, you want to verify if the metrics are published to federated API management.
    8. Click Insights tab.

      The Runtime-specific monitor page renders the metrics of that runtime pertaining to a specified time interval. It lists the metrics such as Transactions, Error rate, Availability, Response time, and so on. For details, see Monitoring performance of runtimes in federated API management.