Skip to content

Using Power Pages Web Application firewall to Rate limit Web API calls

[ad_1]

In some scenarios where you have a custom Power Pages website that leverages the web API for specific pieces of functionality, you might want to add some rate limiting to it so users cannot overuse the API (for example by creating a script to abuse it and running it using chrome developer tools).

Enable Web Application Firewall

To enable WAF for your site you need to have CDN enabled. See steps below for more details:

Content Delivery Network – Microsoft Learn

Configure Web Application Firewall for Power Pages – Microsoft Learn

Create the rule

Once the WAF is enabled, you can create a rule as below. In this instance, we are rate-limiting web API calls to the contacts table only:

In this example above, we create a rule of Rate limit type, where we impose a limitation on calls made per minute. For demonstration purposes, we allow only 50 calls per minute (this can be too little for real-world scenarios).

To match the API endpoint we use the Request URI type…

[ad_2]

Source link

Leave a Reply