Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Connector Development
Unanswered

Set Host URL policy template not replacing the request URL

(1) ShareShare
ReportReport
Posted on by 254
I am passing host url dynamically to custom connector action using Set Host URL policy template but not working. I used headers('containername') in the policy template but I'm getting error that the containername was not sent in headers.
Categories:
  • TF-12081155-0 Profile Picture
    2 on at
    Set Host URL policy template not replacing the request URL
    I am having this same problem. The strange thing is that the policy is working on old connectors but if I try to create a new one I get the "[variable] is not present in headers error". I'm pretty sure this is a bug.
     
    After messing around with this for a while I found that changing the policy from using the headers('[variable]') to queryParameters('[variable]') works.
     
    (And also updating the header variable to a query variable in the Swagger editor.)
     
    Whilst this is an effective workaround it's a pain because I use these connectors on all new environments and don't want to have to manually update the policy and variable type in each one. I know I could do this at source, but I'm not sure how this effects existing flows that use the connector.
  • CU21030433-0 Profile Picture
    8 on at
    Set Host URL policy template not replacing the request URL
    Oops, accidentally posted trying to upload some screenshots to my previous post. Hope this helps. 
    Screenshot 2025-0...
    Screenshot 2025-0...

    Your file is currently under scan for potential threats. Please wait while we review it for any viruses or malicious content.

  • CU21030433-0 Profile Picture
    8 on at
    Set Host URL policy template not replacing the request URL
    Since OP hasn't responded yet and I am getting the same error while trying to use Set host URL policy, I'll share what I have:
     
    1. A header parameter called "new_url" in the Action Definition
    2. A Set host URL policy applied to all actions that sets the URL from that parameter
    3. Populating the parameter in my flow prior for the action
     
    The error I get when I Test (similar error when I try to use query parameter as well):
     
    {
      "error": {
        "code": 500,
        "message": "Property with name new_url is not present in headers.",
        "source": "unitedstates-002.azure-apim.net",
        "path": "",
        "policyId": "",
        "clientRequestId": "",
        "dreeSet": "true"
      }
    }
     
    When I try to use it in a flow, it simply hangs and times out.
     
     
  • Michael E. Gernaey Profile Picture
    39,785 Super User 2025 Season 1 on at
    Set Host URL policy template not replacing the request URL
     
    To quote my 2nd grade teacher lol, "show your work", at least I am pretty sure she said that.. that or, don't bring peanuts to class anymore, probably that too :-)
     
    But in all seriousness, please share your work, versus just sort of explaining it and mentioning an error, that is also not shared.
     
    Cheers and good luck!!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,518 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,756 Most Valuable Professional

Leaderboard

Featured topics