- 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).
- It may be related to A wrong connection string,A wrong or expiry access key and Set roles for permissions or wrongly resources
- 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.