Try changing the name to someting else seems like some previous deployment
coms-hsks-nxs-dev-weu
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
The first run deploying communication services using the Bicep file below succeeds. However when deploying a second time the deployment fails due to an InvalidResourceOperation error. Could anyone tell me how to solve this issue?
When removing the resources and rerunning deployment resources are successfully created.
{
"code": "DeploymentFailed",
"target": "/subscriptions/711699cf-05b7-4ec1-948b-65637bfb0de0/resourceGroups/sso-dev/providers/Microsoft.Resources/deployments/nexusCommunications-20230613.3",
"message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.",
"details": [
{
"code": "InvalidResourceOperation",
"message": "The operation for resource '/subscriptions/711699cf-05b7-4ec1-948b-65637bfb0de0/resourceGroups/sso-dev/providers/Microsoft.Communication/communicationServices/coms-hsks-nxs-dev-we' is invalid as it is being provisioned with state: 'Accepted'."
}
]
}
// https://learn.microsoft.com/en-us/azure/templates/microsoft.communication/communicationservices?pivots=deployment-language-bicep
// https://learn.microsoft.com/en-us/azure/templates/microsoft.communication/emailservices?pivots=deployment-language-bicep
param communicationsName string
param communicationsEmailName string
param domainUsername string
param domainDisplayName string
resource communicationsEmail 'Microsoft.Communication/emailServices@2023-03-01-preview' = {
name: communicationsEmailName
location: 'global'
tags: {}
properties: {
dataLocation: 'Europe'
}
}
resource communicationsEmailDomain 'Microsoft.Communication/emailServices/domains@2023-03-01-preview' = {
name: 'AzureManagedDomain'
location: 'global'
parent: communicationsEmail
properties: {
domainManagement: 'AzureManaged'
userEngagementTracking: 'Disabled'
}
}
resource communicationsEmailDomainSendUsername 'Microsoft.Communication/emailServices/domains/senderUsernames@2023-03-01-preview' = {
name: domainUsername
parent: communicationsEmailDomain
properties: {
displayName: domainDisplayName
username: domainUsername
}
}
resource communications 'Microsoft.Communication/communicationServices@2023-03-01-preview' = {
name: communicationsName
location: 'global'
tags: {}
properties: {
dataLocation: 'Europe'
linkedDomains: [
communicationsEmailDomain.id
]
}
}
// Determine our connection string
var communicationsConnectionString = listKeys(communications.id, communications.apiVersion).primaryConnectionString
// Output our variables
output communicationsConnectionString string = communicationsConnectionString
output communicationsEmailDomainName string = communicationsEmailDomain.name
Try changing the name to someting else seems like some previous deployment
coms-hsks-nxs-dev-weu
I am getting this same error in our CD pipeline while deploying to one particular environment (UAT) while for the other env (Dev, QA) it worked fine. Any solution for this?