Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do you know how programmatically import solution with passing connection references ? #289

Open
malaker opened this issue Oct 8, 2020 · 11 comments
Labels

Comments

@malaker
Copy link

malaker commented Oct 8, 2020

Hi
I cannot find in current xrm-ci-framework way of configuring connection references within import request. Do you know guys how to do this ?

@WaelHamze
Copy link
Owner

@malaker
Copy link
Author

malaker commented Oct 12, 2020

maybe...

When you have in solution connection references then during import the solution in other environment in new UI during importing user is asked for providing new connections. I am wondering if those connections can be provided somehow programmatically

@don-matese
Copy link

don-matese commented Jan 13, 2021

I don't think this is supported yet, we've been asking MS for a while now on this and keep getting "its not ready yet" - hoping that the functionality will be available in the next couple of months. I had a conversation with someone on Twitter who pointed me at their import powershell script that was used to remap connection references. This might help you out.

https://gist.github.com/devkeydet/f31554566b2e53ddd8e7e1db4af555a6

this relies on you having the connections set up in the target environment but it should help reduce your effort.

maybe...

When you have in solution connection references then during import the solution in other environment in new UI during importing user is asked for providing new connections. I am wondering if those connections can be provided somehow programmatically

@malaker
Copy link
Author

malaker commented Jan 14, 2021

Thanks ! I will check that

@parvezghumra
Copy link

I found this blog post earlier which basically explains in plain English how to manually perform the steps performed by the PowerShell script referenced above by @don-matese.

Does anyone know where Power Automate Connections are stored? Are they held within an entity in Dataverse that is accessible either via the user interface or the API/SDK?

@mattp65
Copy link

mattp65 commented Jan 19, 2021

That PowerShell script actually shows updating the entity. It is in CDS and the schema name is connectionreference. It is a newer entity and I have yet to play with updating it myself yet. I had gone the path previously of modifying the underlying YAML which got ugly really quickly.

@parvezghumra
Copy link

parvezghumra commented Jan 19, 2021

@mattp65 I know the records to update are in the connectionreference entity. I was referring to the entity from which we can identify the connection id to use. The PowerShell script is expecting this value to be passed in. I was hoping I would be able to retrieve this dynamically from the environment at runtime?

@mattp65
Copy link

mattp65 commented Jan 19, 2021

Sorry, misunderstood. The setup they have is really goofy. I haven't been able to find a good way to track this through to find the GUID at run time. Best I have come up with is to setup a dummy flow that uses each connection type and make sure that is configured properly in the target env and then use that to figure out the GUIDs. Where it gets tough is that the connections, when stored, are user specific. So there can be multiple connections for the same system and no easy way to determine which one to choose.

@mVermaat
Copy link

You can use the PowerApps Powershell module to find the connections. It has a 'Get-PowerAppConnection' function to get the connections.

This returns all connections to all environments you have access to. You can filter it by adding the '-EnvironmentName' parameter. This environment is GUID, you can find these with the 'Get-PowerAppEnvironment' function. Problem is that there is no direct connection between the powerapp and CDS organization. The only connection is the display name. It works but I'm not really happy with using a display name. At least it is unique, as it will put the uniquename between brackets if it's different from the uniquename.

When you figure out the environment, next you need to do is get the correct connection from all of the different connections. This can be easy, but also impossible. The connector has a name (for CDS it's 'shared_commondataserviceforapps'). This can be matched with the connectorid attribute of the connection reference. This works, unless you have multiple connections of the same type. Then I don't know any way to select the correct connection.

All in all I think the most effective and cost efficient way is to simply create a simple json file where you specify the connection references and the connectionids per environment. The connectionid is in the URL when you open a connection. You will need to create the connections manually anyway, might aswell dump the connectionid in a JSON and be done with it.

@parvezghumra
Copy link

Thanks for the insight @mVermaat. I'll give it a try :)

@parvezghumra
Copy link

@WaelHamze I noticed this interesting commit with the some Connection Reference management code in it :) a6c12b8

Does this mean a pipeline task is in the making/available?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants