Step 2. Deploy Azure API Management Service (APIM)

You can deploy APIM to improve SimpleAPI quality of service and protect the CloudBlue Commerce instance from being overloaded by 3rd parties sending excessive API requests. It is an optional step; however, we highly recommend using it on production systems.

To deploy the gateway, you will need:

  • SimpleAPI service URL, which is the URL exposed by the Kubernetes ingress controller for the cmpapi pod.
  • SimpleAPI Open API Specification file.

To deploy APIM, configure the service following its official documentation with the recommendations provided below.

Note: The policies defining allowed requests per minute and per day are base recommendations. Depending on the number of API users you can adjust these values.

  1. The SimpleAPI product must be created with the following configuration:
    • Display Name: SimpleAPI

    • ID: simpleapi

    • Description: Subscribers will be able to run 60 calls/minute up to a maximum of 5000 calls/day.

    • State: published

    • Requires subscription: yes

    • Requires approval: yes

    • Subscription count limit: 1

    • Set policies:

      <!--
          IMPORTANT:
          - Policy elements can appear only within the <inbound>, <outbound>, <backend> section elements.
          - To apply a policy to the incoming request (before it is forwarded to the backend service), place a corresponding policy element within the <inbound> section element.
          - To apply a policy to the outgoing response (before it is sent back to the caller), place a corresponding policy element within the <outbound> section element.
          - To add a policy, place the cursor at the desired insertion point and select a policy from the sidebar.
          - To remove a policy, delete the corresponding policy statement from the policy document.
          - Position the <base> element within a section element to inherit all policies from the corresponding section element in the enclosing scope.
          - Remove the <base> element to prevent inheriting policies from the corresponding section element in the enclosing scope.
          - Policies are applied in the order of their appearance, from the top down.
          - Comments within policy elements are not supported and may disappear. Place your comments between policy elements or at a higher level scope.
      -->
      <policies>
          <inbound>
              <rate-limit calls="60" renewal-period="60" />
              <quota calls="5000" renewal-period="86400" />
              <base />
          </inbound>
          <backend>
              <base />
          </backend>
          <outbound>
              <base />
          </outbound>
          <on-error>
              <base />
          </on-error>
      </policies>
  2. Add the SimpleAPI using the schema file using the following configuration.
    • OpenAPI specification: api.yml
    • API URL suffix: marketplace//
    • Products: SimpleAPI
    • Configure additional settings:
      • Web service URL: {cmpApiServiceURL}/api/v1
      • Subscription Header name: X-Subscription-Key
      • Subscription query parameter name: subscription-key
CloudBlue, an Ingram Micro business, uses cookies to improve the usability of our site. By continuing to use this site and/or logging in you are accepting the use of these cookies. For more information, visit our Privacy Policy.