Azure Communication Services (ACS) provides a managed platform and communication APIs to build real-time voice, video, SMS, and Chat functionality to your solution at scale. In the previous post – Azure Communication Services – Building an experimental messaging solution, we have learned how to leverage the Azure Portal to provide ACS and explore some of the features by building one simple messaging application. In this post, let us examine how we can leverage the existing Azure Communication Services (ACS) as a Microsoft Power Automate Connector to send SMS using a phone number.
Defining the Use Case
The scenarios we are going to cover is to “Get an SMS when you receive an email from your direct’s” – So, whenever there is an email from your direct reports, you will receive an SMS; also additional condition we will add as follows
- Receive an SMS when there is an email from your direct report
- The email has only sent to you
- The email has sent as high Importance
While this is just a use case to build out one real scenario, this post’s objective would understand how we can integrate Azure Communication Services with Microsoft Power Automate.
Azure Communication Service – Connection String
Follow the previous article, Azure Communication Services – Building an experimental messaging solution to create a new instance of Azure Communication Services and acquire the Phone number.
Once you have the number acquired, Get the Access Key Connection String to authorize the APIs while communicating with Azure Communication Services.
Creating the Power Automate Flow
Start creating the power automate flow with automated trigger as “When a new email arrives(v3)” as trigger point.
Once the flow is created, Add two O365 Users actions connector as a next steps for the Office 365 Outlook Connector.
- When a new email arrives(V3), it triggers as soon as there is a new email in the inbox.
- Get my profile (V2) returns the O365 user profile details; in this case, your profile details.
- Get Manager (V2) will return the profile details for the UPN of the email’s Form ( sender).
In the next step add a condition block to that will validate following points
- Receive an SMS when there is an email from your direct report – Check the User Principal of Get my profile (V2) and User Principal of Get Manager (V2) if the same.
- The email has only sent to you – CC is set to null, and To is only Get my profile (V2) user-principal
- The email has been sent as a high priority – Check the Importance of the email set to high.
We could also few more condition to check overall to optimized the check in earlier check, but that’s ok for now !
If the above condition is satisfied, we need to send an SMS using the Azure Communication Services SMS Connector. Add Azure Communication Service SMS connector action, provide the name of Connection String, and paste the connection string value copied from the ACS Subscription.
Once the ACS connection is validated, you would add the Form phone Number ( The registered numbers from ACS would appear her ), and then you can add multiple numbers to notify and provide the message you would like to receive.
That’s it. This is how the overall flow looks like:
Save the flow! Now when ever there is an email from your direct team member, with high priority, you will be notified using an SMS.
You can now validate either with your number or check it directly from the event subscription
Share the flow! Let other use it and experience it !
Azure Communication Services (ACS) provides a managed platform and communication APIs to build real-time voice, video, SMS, and Chat functionality to your solution at scale. In this post, we have learned how we can integrate Azure Communication Services with Microsoft Power Automate.
While the services are in preview state when writing these articles, I look forward to several more connectors for Chat, including Vision APIs across Power Automate, Logic Apps, and Azure Function!
Hope this helps !