Policy overview
Policies can be used to modify the behavior of connectors at runtime. For example, policies are used to enforce throttling limits on API calls to route calls to different endpoints, and so on. Policies are used extensively by many of the out-of-box connectors we have today, however, they haven't been available to custom connectors. We're now making it available for custom connectors through easy to use templates.
Prerequisites
- Basic experience building flows, and custom connectors.
- Basic understanding of the OpenAPI Specification (formerly known as Swagger).
- The sample OpenAPI definition for this tutorial.
How to use a policy template
Policy template are available only for custom connectors. To use a policy template, open Power Automate portal and either create a new custom connector or edit an existing one.
In the custom connector wizard, select the Definition page.
From the Definition page, select New Policy.
This will open the policy templates page on the right.
Select a policy template from the Template dropdown.
Provide the parameter values required by the policy template. Repeat steps 2 through 4 for adding additional policy templates.
At the top right corner of the wizard, select Create connector (for new connector) or Update connector (for existing connector) to save the policy templates to your connector.
Use environment variables in a policy template (preview)
Environment variables play a vital role in facilitating application lifecycle management (ALM) scenarios, particularly when migrating an application, flow, or custom connector between Power Platform environments. In this context, the application, flow, or custom connector remains identical except for a few critical external references differing between the source and destination environments. Previously, environment variable support in custom connectors was limited to certain fields like Host, Base URL, and security properties. Environment variables can now be used in custom connector policies as well.
Environment variables can use the following syntax in custom connector policies:
@environmentVariables("environmentVariableName")
Example
@environmentVariables("cr49f_SharePointSiteURL")
Provide feedback
We greatly appreciate feedback on issues with our connector platform, or new feature ideas. To provide feedback, go to Submit issues or get help with connectors and select your feedback type.