PL 400 : use policy templates to modify connector behavior at runtime (Create custom connectors)

The policy template provides the structure design or framework for policy information and ensures consistency. It should be written clearly and concisely. Such a policy helps to enforce organizational standards and assess compliance at large.


In the Azure, Policy plays prominent roles and it helps to enforce organizational standards and to assess compliance at scale. Azure policy evaluates resources in Azure by comparing the properties of those resources to business rules. these business rules, described in JSON format, are known as policy definitions. Definitions include metadata and the policy rule. The defined rule can use functions, parameters, logical operators, conditions, and property alias.

In the Custom Connector, Policies are used to enforce throttling limits on API calls, to route calls to different endpoints, and so on. Policy templates are available only for custom connectors. To use a policy template, either create a new custom connector or edit an existing one.

Policies are used to change the behavior of actions and triggers through configuration.

In the some business scenarios, we need to change the design behavior during the run time and policies allow us to modify the behavior of a custom connector at runtime. we can use policies to perform data conversion, route requests, set parameter values and more. The perform this activities, we use the policy template. This template can be access from the definition tab and there are several Templates that are available to us including:

  • Set host URL
  • Set HTTP header
  • Set query string parameter

Set host URL:

By default, the host URL is hardcoded into the connector configuration. A policy, combined with a connection parameter, allows the host URL to be specified every time we create a connection by using the connector.

Set header:

Use to promote data from the connection parameters, query, or body of the request to the header. Commonly, this process is done to accommodate APIs that want specific information configured in the header.

Set query parameter:

Use for handling default values, if necessary, but the maker doesn't configure one.

Configuring the policy template changes the API properties of the connector. API properties are stored separately from the API definition for the connector. We can import an updated API definition through the portal without overwriting the policies that we have configured.

Conclusion:

The custom connector is the primary component of the Power Platform that provides cross platform communication and enhances the behavior of the platform. Policy template plays an important role to change the behavior during run time in the custom connector.

Comments

Popular posts from this blog

PCF vs. Web Resources: Choosing the Right Extensibility Tool for Dataverse

Is Debt Prosperity or Trap?

Exam PL-400: Microsoft Power Platform Developer