|
| 1 | +--- |
| 2 | +title: Email Resource Management - Automating the creation and management of Communication and Email Services with custom domains |
| 3 | +titleSuffix: An Azure Communication Services Automation Sample |
| 4 | +description: Learn how to automate the creation of Communication Services, Email Communication Services, custom domain management, DNS record configuration, and domain verification. |
| 5 | +author: v-deepikal |
| 6 | +manager: Komivi Agbakpem |
| 7 | +services: azure-communication-services |
| 8 | + |
| 9 | +ms.author: Komivi Agbakpem |
| 10 | +ms.date: 01/16/2025 |
| 11 | +ms.topic: tutorial |
| 12 | +ms.service: azure-communication-services |
| 13 | +ms.subservice: email |
| 14 | +zone_pivot_groups: acs-ps |
| 15 | +--- |
| 16 | + |
| 17 | +# Email Resource Management: Automating end to end resource creation |
| 18 | + |
| 19 | +::: zone pivot="platform-powershell" |
| 20 | +[!INCLUDE [Email Resource Managemnt with Azure PowerShell ](./includes/email-resource-management-powershell.md)] |
| 21 | +::: zone-end |
| 22 | + |
| 23 | +## Clean up resources |
| 24 | + |
| 25 | +If you want to clean up and remove a Communication Services subscription, you can delete the resource or resource group. To delete your communication resource, run the following command. |
| 26 | + |
| 27 | +```azurecli-interactive |
| 28 | +az communication delete --name "ContosoAcsResource1" --resource-group "ContosoResourceProvider1" |
| 29 | +``` |
| 30 | + |
| 31 | +If you want to clean up and remove an Email Communication Services, You can delete your Email Communication resource by running the following command: |
| 32 | + |
| 33 | +```PowerShell |
| 34 | +PS C:\> Remove-AzEmailService -Name ContosoEcsResource1 -ResourceGroupName ContosoResourceProvider1 |
| 35 | +``` |
| 36 | + |
| 37 | +If you want to clean up and remove a Domain resource, You can delete your Domain resource by running the following command: |
| 38 | + |
| 39 | +```PowerShell |
| 40 | +PS C:\> Remove-AzEmailServiceDomain -Name contoso.com -EmailServiceName ContosoEcsResource1 -ResourceGroupName ContosoResourceProvider1 |
| 41 | +``` |
| 42 | + |
| 43 | +[Deleting the resource group](../../azure-resource-manager/management/manage-resource-groups-portal.md#delete-resource-groups) also deletes any other resources associated with it. |
| 44 | + |
| 45 | +If you have any phone numbers assigned to your resource upon resource deletion, the phone numbers are automatically released from your resource at the same time. |
| 46 | + |
| 47 | +> [!NOTE] |
| 48 | +> Resource deletion is **permanent** and no data, including event grid filters, phone numbers, or other data tied to your resource, can be recovered if you delete the resource. |
0 commit comments