แชร์ผ่าน


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

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.

  1. In the custom connector wizard, select the Definition page.

    Select the Definition page

  2. From the Definition page, select New Policy.

    Select new policy

    This will open the policy templates page on the right.

    Opening the policy templates page

  3. Select a policy template from the Template dropdown.

    Select a policy template

  4. Provide the parameter values required by the policy template. Repeat steps 2 through 4 for adding additional policy templates.

    Provide the parameter values

  5. 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.

    Save the policy templates

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.