1
votes

I could successfully add the custom domain to the Azure API management and access the APIs.

I do understand that Azure API management supports multiple custom domains.

However all the APIs are accessible across the custom domains.

Is there any way to limit the APIs per custom domain? Eg: API1 will be available only for the domainX while API2 is accessible for domainY.

1

1 Answers

2
votes

You could use an API level or Product level policy to return an Unauthorized status code when the Uri of the incoming call is on the wrong domain:

<policies>
  <inbound>
    <base />
    <choose>
      <when condition="@(context.Request.OriginalUrl.Host != "domainX")">
        <return-response>
          <set-status code="401" reason="Unauthorized"/>
        </return-response>
      </when>
    </choose>
  </inbound>
</policies>