Skip to main content

Notifications

Topic Creation & Management
Answered

How can i get environment url in copilot studio

Posted on by 32

Hi, 

 

When building copilots in Copilot studio, I want to get the Power platform environment URL https://[your environment].crm.dynamics.com/ as I do not want to hard code URLs in the copilot. 

 

Appreciate any pointers.

 

Thanks.

  • CU03061412-0 Profile Picture
    CU03061412-0 32 on at
    Re: How can i get environment url in copilot studio

    @Hey @HenryJammes - Yes, you got it. 

     

    If it's natively supported - we will not have to do manual environment variables and plumbing to create Application registration etc.. One day hopefully it will land in native dataverse connectors. 

     

    Thank you for all the help.

     

    Thanks.

  • Verified answer
    HenryJammes Profile Picture
    HenryJammes on at
    Re: How can i get environment url in copilot studio

    Thank you @rizworks -- do I understand correctly that you're making HTTP calls to the Dataverse Web API because the standard connector doesn't support impersonation/delegation so that requests are processed in the end-user's context?

    I don't have a workaround to suggest apart from the one we've discussed (using environment variables to build your Web API URL), but that's good feedback (both for native impersonation support in the Dataverse connector, and to run connectors in the context of the bot's end user).

  • CU03061412-0 Profile Picture
    CU03061412-0 32 on at
    Re: How can i get environment url in copilot studio

    The use case here is that we have to impersonate the user running the Copilot itself.

    Right now, the Dataverse connectors (list rows etc ...) use the context of the Owner of flow, so we have to use Web API to work around that. For web api (http) that we have to put in the URL etc ... Ideally we wouldn't need to do that and It should work with dataverse connectors. This is particular case is being worked on by Microsoft but we don't know when it will be done. So, have to take web api route.

     

    I hope this make sense. Please let me know if more details are needed. 

  • HenryJammes Profile Picture
    HenryJammes on at
    Re: How can i get environment url in copilot studio

    What's the use case here? 

    The Dataverse connector by default connect to the current environment, but the new preview actions allow to also point to a different environment, either by picking one from the drowndown or by forcing a value or variable.

  • CU03061412-0 Profile Picture
    CU03061412-0 32 on at
    Re: How can i get environment url in copilot studio

    Yes, sure I can do that.

     

    Isn’t there any setting table in the instance that holds the URL? That can be received from flow action through dataverse connector. Trying to know about the platform and keeping inputs as minimum. 

     

  • HenryJammes Profile Picture
    HenryJammes on at
    Re: How can i get environment url in copilot studio

    Hi @rizworks -- Can you use environment variables so that you can update their values as you move from DEV to TEST to PROD? 

Helpful resources

Quick Links

Exciting News for Copilot Studio Communi…

Get ready to experience a whole new level of engagement with the Copilot Studio…

Celebrating the May Super User of the…

LaurensM is an exceptional contributor to the Power Platform Community…

Check out the Copilot Studio Cookbook…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 137,998

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,059

Leaderboard

Featured topics