Quickstart: Send SMS messages in Azure Logic Apps with Azure Communication Services

By using the Azure Communication Services SMS connector and Azure Logic Apps, you can create automated workflows that can send SMS messages. This quickstart shows how to automatically send text messages in response to a trigger event, which is the first step in a logic app workflow. A trigger event can be an incoming email message, a recurrence schedule, an Azure Event Grid resource event, or any other trigger that's supported by Azure Logic Apps.

Screenshot that shows the Azure portal, which is open to the Logic App Designer, and shows an example logic app that uses the Send SMS action for the Azure Communication Services connector.

Although this quickstart focuses on using the connector to respond to a trigger, you can also use the connector to respond to other actions, which are the steps that follow the trigger in a workflow. If you're new to Logic Apps, review What is Azure Logic Apps before you get started.

Note

Completing this quickstart incurs a small cost of a few USD cents or less in your Azure account.

Prerequisites

Important

Phone number availability is currently restricted to Azure subscriptions that have a billing address in the United States. For more information, visit the Phone number types documentation.

Add an SMS action

To add the Send SMS action as a new step in your workflow by using the Azure Communication Services SMS connector, follow these steps in the Azure portal with your logic app workflow open in the Logic App Designer:

  1. On the designer, under the step where you want to add the new action, select New step. Alternatively, to add the new action between steps, move your pointer over the arrow between those steps, select the plus sign (+), and select Add an action.

  2. In the Choose an operation search box, enter Azure Communication Services. From the actions list, select Send SMS.

    Screenshot that shows the Logic App Designer and the Azure Communication Services connector with the Send SMS action selected.

  3. Now create a connection to your Communication Services resource.

    1. Within the same subscription:

      1. Provide a name for the connection.

      2. Select your Azure Communication Services resource.

      3. Select Create.

      Screenshot that shows the Send SMS action configuration with sample information.

    2. Using the connection string from your Communication Services resource:

      1. Provide a name for the connection.

      2. Select ConnectionString Authentication from the drop down options.

      3. Enter the connection string of your Communication Services resource.

      4. Select Create.

      Screenshot that shows the Connection String Authentication configuration.

    3. Using Service Principal (Refer Services Principal Creation):

      1. Provide a name for the connection.

      2. Select Service principal (Azure AD application) Authentication from the drop down options.

      3. Enter the Tenant ID, Client ID & Client Secret of your Service Principal.

      4. Enter the Communication Services Endpoint URL value of your Communication Services resource.

      5. Select Create.

      Screenshot that shows the Service Principal Authentication configuration.

  4. In the Send SMS action, provide the following information:

    • The source and destination phone numbers. For testing purposes, you can use your own phone number as the destination phone number.

    • The message content that you want to send, for example, "Hello from Logic Apps!".

    Here's a Send SMS action with example information:

    Screenshot that shows the Send SMS action with sample information.

  5. When you're done, on the designer toolbar, select Save.

Next, run your logic app workflow for testing.

Test your logic app

To manually start your workflow, on the designer toolbar, select Run. Or, you can wait for the trigger to fire. In both cases, the workflow should send an SMS message to your specified destination phone number. For more information, review how to run your workflow.

Clean up resources

To remove a Communication Services subscription, delete the Communication Services resource or resource group. Deleting the resource group also deletes any other resources in that group. For more information, review how to clean up Communication Services resources.

To clean up your logic app workflow and related resources, review how to clean up Logic Apps resources.

Next steps

In this quickstart, you learned how to send SMS messages by using Azure Logic Apps and Azure Communication Services. To learn more, continue with subscribing to SMS events:

For more information about SMS in Azure Communication Services, see these articles: