Dear community,
I have added C# code to a custom connector. The code transforms the request URI by replacing some query parameters before sending the request to the back-end API. The connector works fine, and the URI is transformed as expected.
However, after a while, the custom C# code does not get executed anymore. The request is sent directly to the back-end API, effectively bypassing the C# code, even though the code is activated on the custom connector and the relevant actions are selected. To overcome this problem, it is necessary to open the custom connector and save it again as it is. However, this work-around is only temporary, as the problem emerges again after a while.
I am not able to tell exactly how long the C# code gets executed before being bypassed. From several tests over the past days, I found that the C# code gets correctly executed for roughly 24 hours after the connector is saved.
To showcase the issue, I have created a simple custom connector that calls a weather API and uses C# code to transform a query parameter. Please find the details below.
Has anyone experienced this issue? Does anybody know what the cause of the problem might be?
I would be grateful for your feedback!
Custom Connector Definition:
Swagger definition of the custom connector
Custom Code:
Custom code
You can view the environment details from the Power Platform Admin Center (https://admin.powerplatform.microsoft.com). Just select the environment and you will find two tiles that inform you about the environment version: "Dataverse version" and "Updates".
Thank you so much for tagging me and letting me know @danielsummerer !! I've spent so much time on this it's ridiculous. But yes I see it's working again. I'm going to create other endpoints that don't rely on the c# code in the event it doesn't work again.
Right, I really didn't want to make an external dependency in the way of azure functions. Where can you view the platform version for power automate cloud?
Hi @Backoffice_Dev ,
I tested the sample connector over the past days, and apparently the issue seems to be resolved now. The custom code got executed without the need to save the connector again. I am unsure if this fix is related to a recent platform upgrade (my environment is running 2023 Release Wave 1), or if it was deployed separately, but it appears to work well now.
However, I agree with you that having the custom code feature still in preview after almost 3 years does not make it a suitable solution for production scenarios. In my specific case, I was able to implement a workaround that did not require custom code at all, but I am aware that implementing such a workaround is not always feasible, quick and easy. This would be a helpful feature, as it avoids resorting to external integrations like Azure Functions.
Best regards,
Daniel
This is the most frustrating issue developing with the power automate platform. This feature has been in preview for 3 years. I woudn't keep trying if it wasn't the most robust feature but it really makes development a highly unreliable process. The c# code will upload without error but not execute when testing. Even the swagger file will sometimes not accept an updated file but appear to save properly.
I see many open source connectors use a script so I'm not sure how this is not a bigger issue and resolved by now. Please help @Syndicate_Admin
Hi @filipkarolowicz ,
For our production scenario, I eventually changed the business logic so that the custom connector was not necessary anymore. However, I kept the custom connector used as test case for this thread.
I re-authorized the connection for the connector 3 days ago (the old credentials had expired), and I since then the code was correctly executed. Hence, the issue seems mitigated. However, I will keep monitoring the execution behaviror, to assert that the issue is indeed solved.
Best regards,
Daniel
Hello @danielsummerer ,
Did you manage to get this to work? I'm struggling with a similar issue.
Thanks,
Karol
Hi @Syndicate_Admin! Thank you for the suggestion. I have thought about using Azure Functions as a work-around; I used them for other scenarios and they are a really great tool.
However, I would like to achieve this goal through custom code in the connector, in order to avoid the overhead of provisioning a resource on Azure resource for this simple task. I am aware that C# code is a preview feature of custom connectors, so I believe this issue will be solved in the near future.
Best regards
Michael E. Gernaey
497
Super User 2025 Season 1
David_MA
436
Super User 2025 Season 1
Riyaz_riz11
244
Super User 2025 Season 1