How to Send SMS in Azure ?

NABAKISHORE PANI 1 Reputation point
2022-02-20T07:38:42.027+00:00

Hello,
I m in India, I want to send SMS through Azure Communication Services.I am using the following program
(https://learn.microsoft.com/en-us/azure/communication-services/quickstarts/sms/send?pivots=programming-language-python):

import os
from azure.communication.sms import SmsClient

try:
# Create the SmsClient object which will be used to send SMS messages
sms_client = SmsClient.from_connection_string("<connection string>")
# calling send() with sms values
sms_responses = sms_client.send(
from_="<from-phone-number>",
to="<to-phone-number>",
message="Hello World via SMS",
enable_delivery_report=True, # optional property
tag="custom-tag") # optional property

except Exception as ex:
print('Exception:')
print(ex)

When running the program, I am getting message:
InternalError
Message:The server encountered an internal error.

How to resolve this issue.Kindly help.

Azure Communication Services
Azure Communication Services
An Azure communication platform for deploying applications across devices and platforms.
847 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ajkuma 25,786 Reputation points Microsoft Employee
    2022-02-21T19:24:56.06+00:00

    NABAKISHOREPANI-0980, Apologies for the delay in responding from over the weekend.

    As mentioned in the doc - "Currently, SMS messages can be sent to and received from United States phone numbers. Phone numbers located in other geographies are not yet supported by Communication Services SMS. For more information, see Phone number types.

    Also, ensure that the phone numbers should be provided in E.164 international standard format (e.g.: +14255550123). The From phone number may be a Short Code as well (e.g.: 23456).

    -You may also checkout a demo on how to send SMS via ACS: https://learn.microsoft.com/shows/Hello-World/Hello-World-Azure-Communication-Services

    If the issue still persists, please do share the screenshot of the error after concealing any PII info.
    Kindly let us know, I'll follow-up with you further.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.