How to use of scripted policies in Azure APIM?

Nikhil Arshath 0 Reputation points
2024-01-04T10:48:01.2566667+00:00

Hi Team,

I am currently trying to replicate the proxies which was developed in Apigee to azure APIM.

So in Apigee we have some logics to execute using JavaScript policy.

So in case of Azure APIM I couldnt find any such policies.so what will be the alternate to be used here.

Please guide me through this.

Thanks,

Nikhil

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,405 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Pinaki Ghatak 5,600 Reputation points Microsoft Employee Moderator
    2024-01-04T14:00:26.6+00:00

    Hello Nikhil.

    More information on what the Apigee policies are doing would be helpful. But nevertheless, in Azure API Management, you can use policy expressions to achieve similar functionality as JavaScript policies in Apigee. Policy expressions are C# expressions that can be used to configure and conditionally execute policies. They have read-only access to the request context and can use only whitelisted .NET typesYou can also use named values to keep secrets and “magic” strings out of policies, provide environment-specific values, and enable a single point of change Another option is to externalize the logic as an HTTP endpoint, make a call, and cache the result

    Do let us know if it helps.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.