If the owner of flow or Power Apps leaves the service of the organization, it is reasonable to transfer his (actually in use) solutions to someone else’s ownership. This can easily be done these days.
But what if a custom connector is made as part of these solutions? Should something be done about it? How?
Where can I see the custom connectors created in environments?
First of all, it would be good to understand where custom connectors can be seen.
User Big Boss has created his own connector (Big Boss custom connector).
I have the Power Platform Admin role in the tenant. However, I don’t see the custom connector created by Big Boss in any interface.
But if my organization uses the Center of Excellence Starter Kit, I can conveniently see all the custom connectors created for different environments from there.
If the information has been successfully collected in the CoE data warehouse, it can also be retrieved using the flow itself. Information about the custom connectors contained in the environment can be listed with the Get Custom Connectors as Admin function found under the Power Apps for Admin connector.
Alright. Now we have a way to find out what custom connectors are used or have been created in our environments. But can I take ownership of those custom connectors?
How can I edit a custom connector made by someone else?
Let’s try a shortcut first. We know that Big Boss has made a Canvas Power App, which uses custom connector. I have full rights to the environment, so I can share that application with myself.
The custom connector immediately appears in my custom connector list.
But I can’t edit it (the pen icon is inactive). Of course, I can download the connector to my own machine.
But that’s not quite enough now.
If Big Boss leaves the organization, no one can edit the connectors he created. What if they need to be repaired? Add new functions? Of course, we can download the current connector to our own workstation, create a new one based on it and change all flows and Power Apps that use the original connector to use it.
That doesn’t sound too practical.
Unfortunately, you cannot (yet) change the owner of your connector. However, it is enough for us that we can give editing rights to the connector to another user.
This can be done with a Flow or using PowerShell.
Granting editing rights – Flow
Let’s fetch all the connectors created by user Big Boss and give me edit rights to them.
Start by fetching all the environments and go through them one by one.
After that, we loop through each environment, for all the connectors created there. We also filter them (Filter Array) based on the creator of the connector (Created By).
Finally, I am given editing rights to these connectors (Edit connector Role Assignment as Admin).
The required identifier (properties/principal/id) of the new owner, in this case my ID, can be found, for example, in Azure AD.
After running the flow, I can edit all custom connectors created by Big Boss.
Because I have edit rights to them.
Granting editing rights – PowerShell
Naturally, the same can also be done with PowerShell.
Let’s open PowerShell as an administrator.
Install the necessary modules.
Install-Module -Name Microsoft.PowerApps.Administration.PowerShell
Install-Module -Name Microsoft.PowerApps.PowerShell -AllowClobber
Now we can log into the desired environment.
The account must have system administrator permission for the environments.
The Power Apps Administration cmdlet contains a vast number of commands. Some of those that cannot be done through the user interface. Adding a modifier to the connector is done with the Set-AdminPowerAppConnectorRoleAssignment command.
Set-AdminPowerAppConnectorRoleAssignment -ConnectorName shared_testapi.[Guid] -EnvironmentName [Guid] -RoleName CanEdit -PrincipalType User -PrincipalObjectId [Guid]
For the command we need the following:
- connector name (ConnectorName)
- environment identifier (EnvironmentName)
- new owner identifier (PrincipalObjectId)
This is the same information as with flow. Of course, because under the hood both call the same interface.
The biggest job is to hunt for this necessary information.
The name of the environment is easy. It can be found at the url.
Using this, we can search for all the connectors in that environment.
Get-AdminPowerAppConnector -EnvironmentName Default-f8c98920-c3d7-46b3-b802-ae70afd4b77a
We can also retrieve all the connectors created by a Big Boss user. Unlike with flow, this can be done with one command from all environments!
Get-AdminPowerAppConnector -CreatedBy email@example.com
We can also search for connectors by name. The following command returns all connectors in the default environment whose name contains the text “finnish”.
Get-AdminPowerAppConnector *finnish* -EnvironmentName Default-f8c98920-c3d7-46b3-b802-ae70afd4b77a
We are interested in the name of the connector. It is the first in the result set and starts with the text “shared_”.
So, the required command is:
Set-AdminPowerAppConnectorRoleAssignment -ConnectorName shared_big-20boss-20custom-20connector-5fc8d9b5a5b6671-b9632be14afa6d81 -EnvironmentName Default-f8c98920-c3d7-46b3-b802-ae70afd4b77a -RoleName CanEdit -PrincipalType User -PrincipalObjectId xxxxxxx
After running the command, I have edit rights to that connector!
Several maintenance tasks related to the Power Platform cannot be done directly from the user interface. However, it does not mean that the desired function cannot be performed. You can do a lot with the flow. If PowerShell is a more familiar tool to you, you can use it.
If you want to do something more exotic, you should always check both flow’s actions and PowerShell commands. It may be that what you are looking for can only be found elsewhere.
Interested in reading our latest Power Platform blog posts?
You’re welcome to subscribe to our email newsletter: Forward Forever Monthly. Max 1 email per month, with a curated list of latest insights and articles on Power Apps, Power Automate, Power BI.