| author | v-vprasannak |
|---|---|
| ms.service | azure-communication-services |
| ms.custom | devx-track-azurepowershell |
| ms.topic | include |
| ms.date | 04/29/2024 |
| ms.author | v-vprasannak |
- An Azure account with an active subscription. Create an account for free.
- Install Azure Az PowerShell.
To create an Email Communication Service resource, sign into your Azure account using the Connect-AzAccount using the following command and provide your credentials.
PS C:\> Connect-AzAccountFirst, install the Azure Communication Services module Az.Communication using the following command.
PS C:\> Install-Module Az.CommunicationTo create a resource, run the following command:
PS C:\> New-AzEmailService -ResourceGroupName ContosoResourceProvider1 -Name ContosoEmailServiceResource1 -DataLocation UnitedStatesIf you want to select a specific subscription, you can also specify the --subscription flag and provide the subscription ID.
PS C:\> New-AzEmailService -ResourceGroupName ContosoResourceProvider1 -Name ContosoEmailServiceResource1 -DataLocation UnitedStates -SubscriptionId SubscriptionIDYou can configure your Communication Services resource with the following options:
- The resource group.
- The name of the Email Communication Services resource.
- The geography to be associated with the resource.
In the next step, you can assign tags to the resource. Use tags to organize your Azure Email resources. For more information about tags, see the resource tagging.
To add tags to your Email Communication Services resource, run the following commands. You can also target a specific subscription.
PS C:\> Update-AzEmailService -Name ContosoEmailServiceResource1 -ResourceGroupName ContosoResourceProvider1 -Tag @{ExampleKey1="ExampleValue1"}
PS C:\> Update-AzEmailService -Name ContosoEmailServiceResource1 -ResourceGroupName ContosoResourceProvider1 -Tag @{ExampleKey1="ExampleValue1"} -SubscriptionId SubscriptionIDTo list all of your Email Communication Service resources in a given subscription, use the following command:
PS C:\> Get-AzEmailService -SubscriptionId SubscriptionIDTo list all the information on a given resource, use the following command:
PS C:\> Get-AzEmailService -Name ContosoEmailServiceResource1 -ResourceGroupName ContosoResourceProvider1If you want to clean up and remove an Email Communication Services resource, You can delete your Email communication resource by running the following command:
PS C:\> Remove-AzEmailService -Name ContosoEmailServiceResource1 -ResourceGroupName ContosoResourceProvider1Note
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.