title: PowerApps Solution import - various errors with custom connector
body: <p>I am fairly new to PowerApps, so please excuse my possibly amateur-like descriptions.</p>
  <p>We are trying to move our finished Solution to our Production environment. The Solution includes a Canvas PowerApp, Choices, five cloud flows, connection references and a custom connector. Owner of all those components is one single account. We are exporting it as an unmanaged solution.</p>
  <p>Two of the Flows include an action step that uses our custom connector. However, instead of using the connector directly, we created a connection reference in the solution in the Dev environment.</p>
  <p>The first problem arises during import: we are asked to select connections for the different connectors used in all the flows. We have Dataverse, Word Online, Office 365 Outlook, Sharepoint and it lists the name of the custom connector ending with “666ca”.</p>
  <p><a href="https://i.stack.imgur.com/ns1EM.png" rel="nofollow noreferrer">Select connections on import</a></p>
  <p>Under “Select a connection”, the only option is to create a new connection (at which point I am asked to provide the credentials for that connection again), which I can do but won’t help in the long run. I will come back to this.</p>
  <p>The import then works fine but 3 our of 5 Flows are deactivated (even though one of the “key benefits” of the solution import experience says “Flows get activated”…).</p>
  <p>When I go to the Details screen of one of the flows that use the custom connector, I see the connection reference from the Dev environment and it has the little checkmark, supposedly showing it’s all good and connected.</p>
  <p><a href="https://i.stack.imgur.com/jTGWC.png" rel="nofollow noreferrer">Connection References in Flow Details</a></p>
  <p>But once I click on “Turn on”, I get the following error message:</p>
  <p>Flow client error returned with status code &quot;Forbidden&quot; and details &quot;{&quot;error&quot;:{&quot;code&quot;:&quot;ConnectionAuthorizationFailed&quot;,&quot;message&quot;:&quot;The caller with object id 'removed' does not have permission for connection '/providers/Microsoft.PowerApps/apis/shared_mvv-5fnodejsserver-5fe6a8a622590…/connections/f751f15e47a940daafee92d32…..' under Api 'shared_mvv-5fnodejsserver-5fe6a8a6225902…'.&quot;}}&quot;.
  The object ID belongs to the account used for importing – same as the owner of all solution components.</p>
  <p>On Edit, the Flow opens but the flow action associated with the NodeJSServer Connection Reference shows no connection reference. When clicking on “new connection reference”, connection name and key are required again. So I am forced to enter the credentials again and cannot even choose the connection that was created during import. Upon entering, a new connection reference is created, this time called “DocAuto”. When going back to the Details screen, the imported connection reference previously seen is replaced by the new one:</p>
  <p><a href="https://i.stack.imgur.com/Y1cOs.png" rel="nofollow noreferrer">Connection References in Flow Details after update</a></p>
  <p>After saving, the Flow can be turned on. Same procedure works for the second flow that uses the custom connector.</p>
  <p>The third flow that’s turned off only uses Dataverse and Sharepoint, but when trying to turn it on, it gives the error message “Unable to start flow due to missing connections. Authenticate the flow connections and re-save before starting.”. For this, I need to edit it and confirm the connections, then it works.</p>
  <p>My understanding is that when importing a custom connector and flows using connection references, the flows should use the same connection references in the target environment. The connection that’s created during import seems useless because a) I cannot connect the flows to it and b) there’s no option to share it with other users. Sharing the connection with users has so far been absolutely necessary, otherwise the App has not worked for them (in Dev).</p>
  <p>After reauthenticating the flows, I played the App and tested the button that should trigger one of the flows and also received an error message:</p>
  <p>[flow name].Run failed: Connection not configured for this service.</p>
  <p>So I went into the app and had to reconnect the flow with the button. I would assume this shouldn’t be necessary if the flows were working right to begin with.</p>
  <p>After reconnecting the button, the app seemed to be working fine and I was able to share the -44911 connection as well as the app with other users and they were able to play it.</p>
  <p>Now is where it gets really exciting – I needed to import an update. After completing the import, the flows using the custom connectors stopped working, or rather that particular action in the flow threw an error: “Not authenticated”. It didn’t work for the importer account nor for anyone else. There was no additional information and readding the connection reference (or even a new one) didn’t fix it.</p>
  <p>So, my questions are:</p>
  <ul>
  <li><p>Is there a way to import the custom connector first, create a connection (reference) and have it show up in the import dropdown? I have tried importing the custom connector in a separate solution just by itself and removing it from the main solution but it showed the same behavior.</p>
  </li>
  <li><p>Is there a way to import the solution in a way that leaves the flows turned on and/or not to have to reauthenticate the connections?</p>
  </li>
  <li><p>Is there a completely different and better/easier way to do the import that I am not aware of?</p>
  </li>
  <li><p>How can I make sure the flows stay connected with the buttons?</p>
  </li>
  <li><p>Is there a “best” way to handle updates on solutions that include custom connectors?</p>
  </li>
  </ul>
  <p>Any help is highly appreciated! If anything is unclear, please ask and I will try to give a better explanation.</p>
  <p>Many thanks and all the best,
  Jenny</p>