I am trying to use C# code to override a header value in the action call on runtime.
But as the nature of the Api, it takes more than 5 seconds to return the response as the size of the file increases.
Now if I use the policy template(set header) to override the header, power automate handles the excess time taken without any issues. but even if I just enable a bit of the code on this action, it starts giving internal server error for request timeout.
Now I know its mentioned that the C# code should itself execute within 5 seconds. But why is it counting the time taken after the call has been made by power automate inside the script execution time.
Since I know the request times out right exactly after 5 seconds, this must be the reason for including that time in script execution.
very basic C# script being used as testing
public class Script : ScriptBase
{
public override async Task<HttpResponseMessage> ExecuteAsync()
{
var response = await this.Context.SendAsync(this.Context.Request, this.CancellationToken).ConfigureAwait(false);
return response;
}
}
Now how can I configure power automate to increase/alter the request timeout for a single request via custom code or others methods if any.
Since I have other things to do via custom code as well for this action, I can't just use policy header to set the header value.
The error code.
{
"error": {
"code": 500,
"message": "Request to the backend service timed out",
"source": "msmanaged-na.azure-apim.net",
"path": "choose[7]\\when[1]\\choose[1]\\when[1]\\send-request",
"policyId": "",
"clientRequestId": "67b79601-f595-41a9-a003-021bc7135437"
}
}
thanks, in advance.

Report
All responses (
Answers (