cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
akandis
Resolver I
Resolver I

Custom Connector with Dynamic URL

Hello everyone,

 

Scenario

I have a Power Platform solution with Canvas app, Power Automates and Custom Connector. I'm using a Dev, UAT and Prod environemnt so in Dev I'm using a Unmanged solution and for the others Managed.

 

In Azure I have Azure Function resources consumed from the Custom Connector.

 

Problem

I can't change the Az Function resources automaticaly from Custom Connector.

 

Example of what I want

For example in the Sharepoint connectors I can use the Environment Variables to switch the SP Site URL. 

 

Question

Is there any way to be able to set the Az Function URL dynamically in the Custom Connector as in the Sharepoint Connectors?

1 ACCEPTED SOLUTION

Accepted Solutions
akandis
Resolver I
Resolver I

Hello @cchannon ,

 

Thanks for your response 🙂

 

Finally my solution was use Environment Variables and OpenApi in order to swithc the URL depending on the environment.

 

So I share the video that help me a lot on that part.

https://www.youtube.com/watch?v=PmfrG57-9Hc

View solution in original post

3 REPLIES 3
cchannon
Super User
Super User

It depends on what part of the url you are talking about. The hostname cannot be dynamic (as far as I know... if anyone has figured out otherwise please correct me!) but you can tokenize the url in the operations just by using curly braces to denote a token.

 

So, while your hostname might need to be "graph.microsoft.com", the full url can be 

https://graph.microsoft.com/v1.0/users/{userPrincipalName}

Where {userPrincipalName} is a token for any user Id. The Custom Connector will recognize the token and automatically create a Path parameter which can be provided when calling the custom connector.

akandis
Resolver I
Resolver I

Hello @cchannon ,

 

Thanks for your response 🙂

 

Finally my solution was use Environment Variables and OpenApi in order to swithc the URL depending on the environment.

 

So I share the video that help me a lot on that part.

https://www.youtube.com/watch?v=PmfrG57-9Hc

View solution in original post

Nice find! I didn't know policy templates could dynamically set the host. Very cool!

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,762)