Open sureshkachwa opened 1 year ago
@sureshkachwa Thank you for filing this issue. Given technically this TF AzureRM provider is built based on Azure APIs whose spec is defined here. Could you please elaborate what is the Azure API Spec or any Azure service documentation indicating what Email communication service
is? Thus the Terraform AzureRM product team could take a further look at this feature request.
@mybayern1974 Thank you, document link for Azure's "email communication service" is https://learn.microsoft.com/en-us/azure/communication-services/quickstarts/email/create-email-communication-resource
@mybayern1974 Also, the APIs used by the email communication service are listed below. https://learn.microsoft.com/en-us/rest/api/communication/email/send?tabs=HTTP
Any more information needed on this?
with acknowledging I'm not the expert of Azure communication/email service, by seeing the business doc provided above, is azurerm_communication_service or azurerm_email_communication_service what is expected?
In addition, a kindly heads up in advance that, if more detail info could be provided to present that this is an existing Azure feature and could be experienced by other Azure tools, say Azure portal, then it could be a Terraform AzureRM feature request candidate as logged in this repo, while the Terraform AzureRM team might not be able to commit a timeline to implement it which though would have entered the feature backlog.
It needs custom domains implemented first:
azurerm_email_communication_service_domain
Then mail from could be added, something like:
azurerm_email_communication_service_domain_mail_from
Also created an issue for https://github.com/hashicorp/terraform-provider-azurerm/issues/22995
@mybayern1974 can you please check my description, it is about creating "mail from addresses" in Azure "email communication services"
@sureshkachwa , I'm convinced this is a reasonable feature request. While as I suggested above, this feature request could be put to Hashicorp and Microsoft Terraform backlog while I cannot commit/predict a timeline to implement it.
there is workaround with azapi provider https://learn.microsoft.com/en-us/azure/templates/microsoft.communication/emailservices/domains/senderusernames?pivots=deployment-language-terraform
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Communication/emailServices/domains/senderUsernames@2023-04-01-preview"
name = "string"
parent_id = "string"
body = jsonencode({
properties = {
displayName = "string"
username = "string"
}
})
}
Why does azurerm_email_communication_service
exist without any way to configure the things that really matter? I can create the resource but that's where it ends. Guess will have to use @kantorv's suggestion.
In addition to senderUsernames
, the domains can be configured using: https://learn.microsoft.com/en-us/azure/templates/microsoft.communication/emailservices/domains?pivots=deployment-language-terraform
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Communication/emailServices/domains@2023-04-01-preview"
name = "string"
location = "string"
parent_id = "string"
tags = {
tagName1 = "tagValue1"
tagName2 = "tagValue2"
}
body = jsonencode({
properties = {
domainManagement = "string"
userEngagementTracking = "string"
}
})
}
Once I configure domain using azapi_resource, how do I verify the custom domain?
There's API support to initiate verification https://learn.microsoft.com/en-us/rest/api/communication/resourcemanager/domains/initiate-verification?view=rest-communication-resourcemanager-2023-03-31&tabs=HTTP and I can use azapi_update_resource to make a call.
But how do I verify that response is succeeded and move forward with connecting email with verified domain to communication service using terraform? Is scripting only option? I would like to fully automate creating email resource, communication resource, create and verify custom domain, and connect email resource to communication resource using Terraform.
Is there an existing issue for this?
Community Note
Description
Usually in OCI (oracle cloud), we do have a terraform resource to create an approved sender and was looking for the same solution in Azure as well but after all the research I see that neither terraform, azure-cli nor azure-biceps have a configuration/resource to create "mail from address" in "Email communication service"
New or Affected Resource(s)/Data Source(s)
NA
Potential Terraform Configuration
References
NA