Azure Communication Service

Senthilkumar Paranthaman 0 Reputation points
2025-04-23T07:22:10.9366667+00:00

We are trying to use a PowerShell script to send emails using the Azure Communication Service. However, we are encountering a problem with connecting to Azure Communication Services using the connection string, resulting in a 401 unauthorized error. Additionally, we would like to know if there are any other options available to journal the emails sent through the Azure Communication Service.

Azure Communication Services
Azure Communication Services
An Azure communication platform for deploying applications across devices and platforms.
1,167 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Alekhya Vaddepally 1,260 Reputation points Microsoft External Staff Moderator
    2025-04-23T11:09:30.6633333+00:00

    Hi Senthilkumar Paranthaman,

    1. The 401 unauthorized error that you are usually viewing means that the Azure is a problem with the authentication credentials used in your PowerShell script to join the Azure Communication Services (ACS).
    2. It may be related to A wrong connection string,A wrong or expiry access key and Set roles for permissions or wrongly resources
    3. Make sure you are using the correct connection string from the Azure portal

    Go to your communication service resource in Azure Portal

    Under the "Keys and Connection Strings", copy full connection string and make sure it is accurately pasted in your script

    • If you have recently revived the keys, any script or app using the old key will fail with a 401 error.
    • Resources should be in an active position and should not be restricted by policies or network access regulations (eg IP restrictions).
    • You may want to verify that your PowerShell script has been properly structured correctly to call ACS email API. ACS now supports email capabilities via Rest and SDK.

    https://learn.microsoft.com/en-us/azure/communication-services/quickstarts/email/send-email?pivots=platform-azportal&tabs=windows%2Cconnection-string%2Csend-email-and-get-status-async%2Csync-client
    https://learn.microsoft.com/en-us/azure/communication-services/quickstarts/email/send-email-smtp/send-email-smtp?pivots=smtp-method-smtpclient#prerequisites

    if you have any further concerns or queries, please feel free to reach out to us.

    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.