azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Sending an Azure Communication Services email using Powershell

Open JBalhatchet opened this issue 2 years ago • 5 comments

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

JBalhatchet avatar Dec 07 '23 00:12 JBalhatchet

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.

isra-fel avatar Dec 13 '23 18:12 isra-fel

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?

mrhvid avatar Jul 30 '24 13:07 mrhvid

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.

jjm123960 avatar Jul 08 '25 23:07 jjm123960

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 avatar Jul 19 '25 18:07 CCWT

@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.

Iam-Manishkumar avatar Oct 28 '25 15:10 Iam-Manishkumar