Using an Azure Function in a Microsoft Flow
In the previous blog I wrote how easy it is to use an Azure Function as a Custom API for PowerApps, and got a question on how would that look like for Microsoft Flow. The great news is that if you have followed the first three steps in the previous blog, you are done! PowerApps and Microsoft Flow share the same connector infrastructure which means your connector will work for PowerApps and Microsoft Flow automatically.
To use that just:
- Go to https://flow.microsoft.com/
- Click My Flows
- Click Create from blank
- In this case I will create a very simple flow that runs every hour and that emails me the output of the Azure Function that we created for PowerApps. Notice how as you start typing in the flow designer it will auto complete and find your new Azure Function Custom API:
- After selecting that, it will correctly understand the Swagger definition and the input and output parameters and correctly allow you to enter the values, and even cascade and reuse the output results from the function for any other step/action in the flow as below using it as part of the body of the email to be sent.
One of the great things you get with the new Microsoft Flow and PowerApps is the great story they have to integrate with each other, and the fact that both “speak Swagger” allows you to build a Custom API once and reuse in both. Note that authoring triggers is a bit more work where you need to annotate the Swagger appropriately as well as have a different signature for your APIs so I will leave that for a future post.