scenarios/workload-genai/policies/multi-tenancy/multi-tenant-product2-policy.xml (15 lines of code) (raw):
<!--
- Policies are applied in the order they appear.
- Position <base/> inside a section to inherit policies from the outer scope.
- Comments within policies are not preserved.
-->
<!-- Add policies as children to the <inbound>, <outbound>, <backend>, and <on-error> elements -->
<policies>
<!-- Throttle, authorize, validate, cache, or transform the requests -->
<inbound>
<base />
<!-- Define the Quota/Rate limiting policies or any tenant specific policies here..
Here, we are using subscriptionId as counter-key but it can be any unique identifier -->
<quota-by-key calls="3" renewal-period="300" counter-key="@(String.Concat(context.Subscription.Id,"-mt-product2"))" />
</inbound>
<!-- Control if and how the requests are forwarded to services -->
<backend>
<base />
</backend>
<!-- Customize the responses -->
<outbound>
<base />
</outbound>
<!-- Handle exceptions and customize error responses -->
<on-error>
<base />
</on-error>
</policies>