简体   繁体   中英

How do I apply a policy from Azure API Management Service to Azure App Service route?

So, I was following this tutorial and successfully published the web API to both Azure App Service and Azure API Management. Then (going beyond tutorial) I added a rate-limit policy to the API in API Management service.

I tested it successfully on API management Test tab. However, if I access the App Service route URL (https://***.azurewebsites.net/) it will not throttle.
What am I missing here?
How do I make the policy active for the App Service URL?

在此处输入图像描述

Markus Meyer did a good job explaining how it's supposed to be used. I think that you might benefit from this diagram showing the differences between calling your service through APIM or directly. 在此处输入图像描述

"What am I missing here?" I think you're missing that API Management is a service, totally separate from you App Service. You do not "extend" the features of the App Service with APIM, you instead put APIM infront of your App Service and call your API through APIM to gain the benefits (of rate limiting in this example).

Requests to https://***.azurewebsites.net/ belong to Azure App Service .

If you want to do requests to API Management, the default hostname is azure-api.net :
https://***.azure-api.net/

If you want to use throttling from API Management, you have to the API Management URL like you did in the test tab:

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM