| ms.custom | devx-track-azurepowershell |
|---|
- An Azure account with an active subscription. Create an account for free.
- Install the Azure Az PowerShell Module.
If you're planning on using phone numbers, you can't use the free trial account. Check that your subscription meets all the requirements if you plan to purchase phone numbers before creating your resource.
To create an Azure Communication Services resource, sign in to Azure CLI. You can create a resource through the terminal using the Connect-AzAccount command and providing your credentials.
First, install the Azure Communication Services module Az.Communication using the following command.
PS C:\> Install-Module Az.CommunicationTo create the resource, run the following command:
PS C:\> New-AzCommunicationService -ResourceGroupName ContosoResourceProvider1 -Name ContosoAcsResource1 -DataLocation UnitedStates -Location GlobalIf you would like to select a specific subscription you can also specify the --subscription flag and provide the subscription ID.
PS C:\> New-AzCommunicationService -ResourceGroupName ContosoResourceProvider1 -Name ContosoAcsResource1 -DataLocation UnitedStates -Location Global -SubscriptionId SubscriptionIDYou can configure your Communication Services resource with the following options:
- The resource group
- The name of the Communication Services resource
- The geography to associate with the resource
In the next step, you can assign tags to the resource. You can use tags to organize your Azure resources. For more information, see Use tags to organize your Azure resources and management hierarchy.
To add tags to your Communication Services resource, run the following commands. You can also target a specific subscription.
PS C:\> Update-AzCommunicationService -Name ContosoAcsResource1 -ResourceGroupName ContosoResourceProvider1 -Tag @{ExampleKey1="ExampleValue1"}
PS C:\> Update-AzCommunicationService -Name ContosoAcsResource1 -ResourceGroupName ContosoResourceProvider1 -Tag @{ExampleKey1="ExampleValue1"} -SubscriptionId SubscriptionIDTo list all your Azure Communication Services Resources for a given subscription, use the following command:
PS C:\> Get-AzCommunicationService -SubscriptionId SubscriptionIDTo list all the information on a given resource use the following command:
PS C:\> Get-AzCommunicationService -Name ContosoAcsResource1 -ResourceGroupName ContosoResourceProvider1