Get an alert before connections expire and flows fail

Have you had flow connection expire? For example when your flow owners use MFA and it is time to re-authenticate?

Broken connections

Would you like to get alerted before you get to the Fix Connection situation?

PowerApps and Flow PowerShell might be able to help you.

(Get-AdminPowerAppConnection).Internal.properties

The above command gives you all your connections.

apiId : /providers/Microsoft.PowerApps/apis/shared_onedriveforbusiness
displayName : Pieter.Veenstra@company.co.uk
iconUri : https://az818438.vo.msecnd.net/icons/onedriveforbusiness.png
statuses : {@{status=Error; target=token; error=}}
connectionParameters : @{sku=Enterprise}
keywordsRemaining : 38
createdBy : @{id=e41a2ef4-3c91-4d41-a2ee-5baa222baafe; displayName=Pieter Veenstra; email=Pieter.Veenstra@company.co.uk; type=User; tenantId=c9bb0321-d7ee-4269-93cc-935cbfef6278;
userPrincipalName=Pieter.Veenstra@company.co.uk}
createdTime : 2017-12-08T16:17:07.6285488Z
lastModifiedTime : 2018-09-24T14:29:58.7781845Z
expirationTime : 2018-03-12T17:37:13.1183723Z
testLinks : {@{requestUri=https://europe-001.azure-apim.net/apim/onedriveforbusiness/b7da6808a2923cda91e94760a6a670fa/testconnection; method=get}}
environment : @{id=/providers/Microsoft.PowerApps/environments/Default-c9bb0321-d7ee-4269-93cc-935cbfef6278; name=Default-c9bb0321-d7ee-4269-93cc-935cbfef6278}

All your connections will show as connected except for the failed one. But we want to catch the problems before they happen.

To make sure that you only get the failed connections you could even go for something like this:

(Get-AdminPowerAppConnection -EnvironmentName "Default-c9bc0321-d7ee-4269-93cc-935cbfef6278").Internal.properties | Where { $_.statuses -like "*Error*"}

Once you’ve got the list of connections that need to be fixed, sending out an alert should be easy.

Ok, So I didn’t get to the BEFORE a connection expires but at least I can get fairly close to the connection having expired.

Using Power Automate instead

Would you like to use Power Automate instead of Powershell? Have a look at the following post:

Broken Connections Using Power Automate

Share
Pieter Veenstra

Business Applications and Office Apps & Services Microsoft MVP working as a Microsoft Productivity Principal Consultant at HybrIT Services. You can contact me using contact@veenstra.me.uk.

Recent Posts

Sharing flows in Power Automate

Recently I tried to share a flow and I got trial warning. It took a…

1 hour ago

There’s a problem that needs to be fixed in Power Automate

Have you ever had your flows showing the following error: There's a problem that needs…

1 day ago

Get started with child flows in Power Automate

Child Flows is one of the subjects that has been on my list of things…

5 days ago

Implementing 2 levels of grouping in Power Apps

When you want to implement 2 levels of grouping in Power Apps you will discover…

1 week ago

Power Automate Approvals and Dataverse

Power Automate Approvals are often one of those unclear things that people try to avoid.…

2 weeks ago

Modern app designer vs Classic app Designer in Model Driven Apps

When you create a new Model Driven App today, you will find that you have…

2 weeks ago
%%footer%%