Import Solution with support for deployment settings #211
-
Hi, |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
@DanielSaager I would suggest you shy away from the direct replication of that feature outside of the CLI at this time as it has not been finalized and the internal workings are subject to change still. What specific features are you trying to access? |
Beta Was this translation helpful? Give feedback.
-
We have some Tooling in C# around CI/CD of Power Platform solutions including Apps and Flows. Right now we have no option to deploy to stage / prod without manual interaction to set connection references. Is there any other way to use the deployment settings right now with C#? It would be no problem, if something will change in the future. |
Beta Was this translation helpful? Give feedback.
-
@DanielSaager That said, if the connection ids and the connector ids preexist, you can send the relationship of connection id to connection reference as part of the solution install now. To do that, you need to create an instance of a connectionreference like such: EntityCollection solutionComponetSettings= new EntityCollection();
Entity connRecord = new Entity("connectionreference");
connRecord.Attributes.Add("connectionreferencedisplayname", payloadItm.ConnectionRefDisplayName);
connRecord.Attributes.Add("connectionreferencelogicalname", payloadItm.ConnectionRefLogicalName);
connRecord.Attributes.Add("description", payloadItm.Description);
connRecord.Attributes.Add("connectorid", payloadItm.ConnectorId);
connRecord.Attributes.Add("connectionid", payloadItm.ConnectionId);
solutionComponetSettings.Add(connRecord); Once you have an array of entities, you then add that to an entity collection, and add the entity collection to the ImportSolutionRequest. //simplified
Dictionary<string, object> extraParameters = new Dictionary<string, object>();
extraParameters[ImportSolutionProperties.COMPONENTPARAMETERSPARAM] = solutionComponetSettings;
dvClient.ImportSolution(
sSolutionImportFilePath,
out guSolImportId,
extraParameters: extraParameters); That will send a solution install request along with the connection reference, allowing it to wire up the flow's and other connections as part of the solution import operation. This is also what deployment settings and package deployer are doing right now, along with prevalidation of a number of these values. This works for both Sync and Async Solution import operations. Moving this over to discussions as its not really an issue :) |
Beta Was this translation helpful? Give feedback.
@DanielSaager
Connection management in deployment automation today is a very fragile system at the moment. This is an area of active investment, and we should see better support in the future.
That said, if the connection ids and the connector ids preexist, you can send the relationship of connection id to connection reference as part of the solution install now.
To do that, you need to create an instance of a connectionreference like such: