简体   繁体   中英

PowerApps Solution import - various errors with custom connector

I am fairly new to PowerApps, so please excuse my possibly amateur-like descriptions.

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.

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.

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”.

Select connections on import

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.

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”…).

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.

Connection References in Flow Details

But once I click on “Turn on”, I get the following error message:

Flow client error returned with status code "Forbidden" and details "{"error":{"code":"ConnectionAuthorizationFailed","message":"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…'."}}". The object ID belongs to the account used for importing – same as the owner of all solution components.

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:

Connection References in Flow Details after update

After saving, the Flow can be turned on. Same procedure works for the second flow that uses the custom connector.

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.

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).

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:

[flow name].Run failed: Connection not configured for this service.

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.

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.

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.

So, my questions are:

  • 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.

  • 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?

  • Is there a completely different and better/easier way to do the import that I am not aware of?

  • How can I make sure the flows stay connected with the buttons?

  • Is there a “best” way to handle updates on solutions that include custom connectors?

Any help is highly appreciated, If anything is unclear. please ask and I will try to give a better explanation.

Many thanks and all the best, Jenny

Azure DevOps. You can build pipelines that extract your solution, store in Git, and send off to your acc/prod environments. Takes some work but it's a more robust way.

Best practices however, create a custom connector in every environment, as manual steps. After that. The service connection should be able to pick up the custom connector in your environmen. The fact that it asks to create a new connection for your custom connector is normal. After the first import, it should create a connection to your custom connector so it will be at least able to see the connector and use it.

In remark to your comment, I created a solution with a reference to a custom connector. Next step, create the custom connector in your test/production environment.

Once you export your solution and import it to your next solution, it should show this screen:

导入画面

Click on connection and create a new connection (Only for the first time!) 添加连接器

After this initial step, it will recognize your 'shared connection', and pick it up next time during updates, this should get you covered.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM