Sending an Azure Communication Services email using Powershell
Type of issue
Missing information
Feedback
Unable to determine how to send an Azure Communication Services email using Powershell, or if it is possible. Please provide an example or statement of limitations.
Page URL
https://learn.microsoft.com/en-us/powershell/module/az.communication/?view=azps-11.0.0
Content source URL
https://github.com/Azure/azure-powershell/blob/main/src/Communication/help/Az.Communication.md
Author
@mikefrobbins
Document Id
0e82a064-c660-9c09-620d-59abb1b31158
Thanks for reaching out to us :) The data plane commands of Azure Communication currently isn't supported. I've routed your request to the correct team to follow up.
Is there any progress on this? It would be a really nice alternative to sendgrid, I would love to be able to send email from Azure Runbooks.
I see this has be updated recently https://github.com/Azure/azure-powershell/blob/main/src/Communication/EmailServicedata.Autorest/examples/Send-AzEmailServicedataEmail.md but I'm not sure if/when/how this ends up in a public az module?
Any updates on this? There's no details on authentication/permissions and the powershell code as written leads to authentication issues.
The page also mentions a connection string is required but doesn't indicate anywhere in the code how to pass the connection string in.
I would call it a workaround, but I was able to successfully send an email from an Azure Runbook using Send-AzEmailServicedataEmail.
Initially, I kept getting the error "Denied by the resource provider" in the runbook test pane. I then assigned the "Communication and Email Service Owner" role to the managed identity of the Automation Account on the Communication Service resource.
After that, sending emails from the runbook worked successfully.
@CCWT – Is assigning the mentioned role to the UAMI the only "official" solution for resolving the "Denied by the resource provider" error? Assigning this role assignment has resolved the issue, but I wanted to check if you have discovered any alternative methods to eliminate the error.