Add code to your custom connector

Custom connector developers can now add C# code directly within the Custom Connector wizard! This new experience is currently available in public preview.

Prior to this new experience, payload transformations were limited to policy templates. Now, you can support more transformation scenarios without having to worry about hosting your code. Some examples include:

  • sending external requests to fetch additional data
  • complex body, query, header, and status transformations
  • handling pagination
  • and many more!

Getting Started

Before writing your code, we recommend reviewing supported classes, namespaces, and explore samples in this tutorial. Currently, we are only supporting C# code and you can only add one code file per connector.

Below are the classes and interfaces that are referenced by the classes:

 

Once you’ve tested the code locally, add your code to Step 4: Code in the Custom Connector wizard.  You can either upload your .cs or .csx file or paste it directly within the editor. After you add your code, you can choose which operations it should be applied to. If no operation is selected, the code will apply to all operations.

 

If you are a connector partner or an Independent Publisher and you are exporting custom connector files via the paconn CLI tool, your code file will be downloaded as part of that experience.

Learn more about this feature by reading the documentation.

If you have any feedback or questions, please reach out to connectorpartnermgmtteam@microsoft.com.