Hi
I would like to ask you how do you use set host policy in custom connector because in my case it does not work. I am wondering if am using it right.
Firstly I prepared simple dummy REST API, I used Swagger version 2 to document available endpoints. One of the endpoint is simple HTTP GET that takes as a paramter string host from query and returns hello world string to power automate. I also have installed on-premise data gateway in order to call this endpoint through the gateway. After that I created connector by uploading swagger json file to custom connector, I added policy "set host url" for all available operations. In the template URL I put @queryParameters('host') where host is the query parameter that is required.
In Power automate flow that uses custom connector I specified by hardcoded host url that should replace that initial one specified in custom connector however it does not work. I am receiving internal error but not from my application. It comes probably from some Microsoft internal API. When I remove policy and put as host url in the very beginning window of custom connector configuration, flow starts working so it shows that there is connectivity power automate - gateway - my custom api.
1) 
2)
3)
4)
5)
and once again after removing policy and setting the same IP address to custom connector host configuration flow starts working however I need working policy because this will allow me to specify dynamically host of this API depends on environment (DEV/TEST/PREPROD/PROD)
Did you have similiar isssue ? Do you have some advise ?
Some references
- suported expressions in policies docs.microsoft.com/.../expressions