Microsoft Flow – 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?

 

 

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-PowerAppConnection).Internal.properties

The above command gives you all your connections.

apiId : /providers/Microsoft.PowerApps/apis/shared_onedriveforbusiness
displayName : Pieter.Veenstra@triad.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@triad.co.uk; type=User; tenantId=c9bb0321-d7ee-4269-93cc-935cbfef6278;
userPrincipalName=Pieter.Veenstra@triad.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-PowerAppConnection -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.

 

Advertisements


Categories:Flow, Microsoft Flow, PowerShell

Tags: ,

Please leave a comment or feedback

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: