web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Configure connection f...
Power Apps
Unanswered

Configure connection for custom connector

(1) ShareShare
ReportReport
Posted on by 60

Hello,

 

I just created a custom connector and it works correctly. My question is : In the general tab, I specify a "Host"

GeneralHost.png

but this value should be specified in the connection to the connector because the users will not access the same API server.

Currently the connection asks only for the API Key, how can I configure the connector to make the "host" variable ?

ConnectionVTOM.png

Do you have any advice or link to a documentation ?

 

Best regards,

Charles-Antoine

Categories:
  • v-xida-msft Profile Picture
    Microsoft Employee on at

    HI @Charles-Antoine 

    Do you want to set the Host property in your custom connector dynamically?

     

    Regarding the needs that you mentioned, I think the "Set Host URL" Policy Template in custom connector could achieve your needs. Please check and see if the following article would help in your scenario:

    https://docs.microsoft.com/en-us/connectors/custom-connectors/policy-templates/dynamichosturl/dynamichosturl

     

    On your side, you could consider create a Policy in your custom connector, then configure it as below:

    4.JPG

     

    Then within your custom action, you could modify the operations defined in your custom connector, and then append a Query parameter to it. e.g. the 'https://graph.microsoft.com/v1.0/me/calendars/{id}/events' URL Request would be changed into following:

    https://graph.microsoft.com/v1.0/me/calendars/{id}/events?hostUrl='azure.microsoft.com'

     

    After that, when you access this request, you could provide a value for the hostUrl query parameter (optional argument), then the Host url of your request would be changed with the provided hostUrl value.

     

    Please try above solution, then check if the issue is solved.

     

    Regards,

  • Charles-Antoine Profile Picture
    60 on at

    Hi @v-xida-msft ,

     

    Thank you for your reply.

    I also think the "Set host url" could be the solution but I can't find the correct way to use it.

    I will try to give a better explanation of what I want to achieve.

     

    It's like the "FTP-SFTP" connector where not every Power Platform user will access the same FTP server thus in the connection you can specify which server you want to use.

     

    The URL I want to set should be set only once in the connection and then all the actions will use this host in the URL.

    I tried :

    general_connector.png

    Based on this policy (for all operations):

    policy_connector.png

    Which is correctly used in all actions:

    request_connector.png

    And for me the connection creation should look like this:

    connection_wanted.png

    But when I update the connector with these changes, I get this error message :

    Specified swagger has the following errors: 'Definition is not valid. Error: 'Error : host : The 'host' property, if present, must be a valid URI host without a scheme or path. '

     

     

    Best regards,

    Charles-Antoine

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Charles-Antoine ,

    Regarding the screenshot that you mentioned, I think this issue is related to the value you typed within the Host property.

    7.JPG

    The Host property in above screenshot should be set to a specific valid Host Url, you could not specify expression there. You could specify a common Host Url in above Host property, then change the Host Url dynamically through the "Set Host Url" Policy I mentioned above.

     

    Please try above solution, then check if the issue is solved.

     

    Regards,

  • Charles-Antoine Profile Picture
    60 on at

    Hi @v-xida-msft ,

     

    Ok I set the host with a valid URL, I created the policy "Set host URL" :

    policy_connector.png

     

    Then I test an action but I get this error message :

    {
    "error": {
    "code": 500,
    "message": "Invalid parameters template. No property names specified in @headers or @queryParameters or @connectionParameters expression",
    "source": "europe-001.azure-apim.net",
    "path": "",
    "clientRequestId": "69afa35f-028e-40ec-bd7a-67ec-749dbaba"
    }
    }

     

    and I don't see where can I set the @connectionParameters expression.

     

    Thanks for your help,

    Charles-Antoine

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Charles-Antoine ,

    Have you tried the @queryParameters expression within your Policy instead of the @connectionParameters  expression?

     

    If you specified the @connectionParameters  expression in your Policy, only when you create a new connection to this custom connector, it would ask you to provide value for the VisualTOMServer parameter.

     

    As an alternative solution, please consider try the @queryParameters expression I mentioned above in your Policy:

    @queryParameters('VisualTOMServer')

    then you need to modify your operation action path, and append a VisualTOMServer query parameter to it as below:

    https://xxx.xxxxx.com/v1.0/me/calendars/{id}/events?VisualTOMServer='xxxxx.xxxxxxx.com'

    then when you call this action, specific a proper value for the VisualTOMServer, then try it again, check if the issue is solved.

     

    Regards,

  • Charles-Antoine Profile Picture
    60 on at

    Hi @v-xida-msft ,

     

    If I specify @connectionParameters I never get to provide the value when I create the connection...

     

    I tried the other solution with @queryParameters('VisualTOMServer')

    I specify the value of VisualTOMServer but I get the error :

    {
    "error": {
    "code": 500,
    "message": "Invalid parameters template. No property names specified in @headers or @queryParameters or @connectionParameters expression",
    "source": "europe-001.azure-apim.net",
    "path": "",
    "clientRequestId": "e977280d-0c4b-4042-9152-c307-07d3c2c1"
    }

    ErrorQueryParameter.png

     

    Here's my policy :

    QueryPolicy.png

     

    Best regards,

    Charles-Antoine

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Charles-Antoine ,

    Have you tried to specify the @queryParameters('VisualTOMServer') within the Host property in your Custom Connector as below:

    v-xida-msft_0-1598411162563.png

    please specify above @queryParameters('VisualTOMServer') within the Host property of the custom connector, then save and re-publish it. Then when you call it in your canvas app, you could provide a value for this query parameter.

     

    Regards,

  • MaxB2604 Profile Picture
    2 on at

    Have you found a solution for this?

  • Charles-Antoine Profile Picture
    60 on at

    Hello @MaxB2604 ,

     

    No I haven't found a solution and I stopped looking 1 year ago. May be something has changed since.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    For anyone interested, I believe the Connecton Parameters definition needs to be changed using the paconn utility:

    https://philcole.org/post/environment-specific-custom-connector-endpoints/

    See here for a tutorial.

     

    I am right now also wondering, if I will use connectionParameters or queryParameters with Environment Variables. I don't think there is any guidance by Microsoft what is considered to be best practice.

     

    Cheers

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard