az communication

Note

This reference is part of the communication extension for the Azure CLI (version 2.15.0 or higher). The extension will automatically install the first time you run an az communication command. Learn more about extensions.

Manage communication service with communication.

Commands

az communication create

Create a new CommunicationService or update an existing CommunicationService.

az communication delete

Operation to delete a CommunicationService.

az communication identity

Commands to manage User Identity for a CommunicationService resource.

az communication identity issue-access-token

Issues a new access token with the specified scopes for a given User Identity. If no User Identity is specified, creates a new User Identity as well.

az communication link-notification-hub

Links an Azure Notification Hub to this communication service.

az communication list

Handles requests to list all resources in a resource group. And Handles requests to list all resources in a subscription.

az communication list-key

Get the access keys of the CommunicationService resource.

az communication phonenumbers

Commands to manage phone numbers for a CommunicationService resource.

az communication phonenumbers list-phonenumbers

Lists all phone numbers associated with the CommunicationService resource.

az communication phonenumbers show-phonenumber

Shows the details for a phone number associated with the CommunicationService resource.

az communication regenerate-key

Regenerate CommunicationService access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time.

az communication show

Get the CommunicationService and its properties.

az communication sms

Commands to manage SMS for a CommunicationService resource.

az communication sms send-sms

Sends an SMS from the sender phone number to the recipient phone number.

az communication update

Operation to update an existing CommunicationService.

az communication wait

Place the CLI in a waiting state until a condition of the communication is met.

az communication create

Create a new CommunicationService or update an existing CommunicationService.

az communication create --name
                        --resource-group
                        [--data-location]
                        [--location]
                        [--no-wait]
                        [--tags]

Examples

Create or update resource

az communication create --name "MyCommunicationResource" --location "Global" --data-location "United States" --resource-group "MyResourceGroup"

Required Parameters

--name -n

The name of the CommunicationService resource.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--data-location

The location where the communication service stores its data at rest.

--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--no-wait

Do not wait for the long-running operation to finish.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

az communication delete

Operation to delete a CommunicationService.

az communication delete --name
                        --resource-group
                        [--no-wait]
                        [--yes]

Examples

Delete resource

az communication delete --name "MyCommunicationResource" --resource-group "MyResourceGroup"

Required Parameters

--name -n

The name of the CommunicationService resource.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--no-wait

Do not wait for the long-running operation to finish.

--yes -y

Do not prompt for confirmation.

Links an Azure Notification Hub to this communication service.

az communication link-notification-hub --name
                                       --resource-group
                                       [--connection-string]
                                       [--resource-id]

Link notification hub

az communication link-notification-hub --name "MyCommunicationResource" --connection-string "Endpoint=sb://MyNamespace.servicebus.windows.net/;SharedAccessKey=abcd1234" --resource-id "/subscriptions/12345/resourceGroups/MyOtherResourceGroup/providers/Microsoft.NotificationHubs/namespaces/MyNamespace/notificationHubs/MyHub" --resource-group "MyResourceGroup"
--name -n

The name of the CommunicationService resource.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--connection-string

Connection string for the notification hub.

--resource-id

The resource ID of the notification hub.

az communication list

Handles requests to list all resources in a resource group. And Handles requests to list all resources in a subscription.

az communication list [--resource-group]

Examples

List by resource group

az communication list --resource-group "MyResourceGroup"

List by subscription

az communication list

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az communication list-key

Get the access keys of the CommunicationService resource.

az communication list-key --name
                          --resource-group

Examples

List keys

az communication list-key --name "MyCommunicationResource" --resource-group "MyResourceGroup"

Required Parameters

--name -n

The name of the CommunicationService resource.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az communication regenerate-key

Regenerate CommunicationService access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time.

az communication regenerate-key --name
                                --resource-group
                                [--key-type {Primary, Secondary}]

Examples

Regenerate key

az communication regenerate-key --name "MyCommunicationResource" --key-type "Primary" --resource-group "MyResourceGroup"

Required Parameters

--name -n

The name of the CommunicationService resource.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--key-type

The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive).

accepted values: Primary, Secondary

az communication show

Get the CommunicationService and its properties.

az communication show --name
                      --resource-group

Examples

Get resource

az communication show --name "MyCommunicationResource" --resource-group "MyResourceGroup"

Required Parameters

--name -n

The name of the CommunicationService resource.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az communication update

Operation to update an existing CommunicationService.

az communication update --name
                        --resource-group
                        [--data-location]
                        [--location]
                        [--tags]

Examples

Update resource

az communication update --name "MyCommunicationResource" --tags newTag="newVal" --resource-group "MyResourceGroup"

Required Parameters

--name -n

The name of the CommunicationService resource.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--data-location

The location where the communication service stores its data at rest.

--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

az communication wait

Place the CLI in a waiting state until a condition of the communication is met.

az communication wait --name
                      --resource-group
                      [--created]
                      [--custom]
                      [--deleted]
                      [--exists]
                      [--interval]
                      [--timeout]
                      [--updated]

Examples

Pause executing next line of CLI script until the communication is successfully created.

az communication wait --name "MyCommunicationResource" --resource-group "MyResourceGroup" --created

Pause executing next line of CLI script until the communication is successfully deleted.

az communication wait --name "MyCommunicationResource" --resource-group "MyResourceGroup" --deleted

Required Parameters

--name -n

The name of the CommunicationService resource.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--created

Wait until created with 'provisioningState' at 'Succeeded'.

--custom

Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].

--deleted

Wait until deleted.

--exists

Wait until the resource exists.

--interval

Polling interval in seconds.

default value: 30
--timeout

Maximum wait in seconds.

default value: 3600
--updated

Wait until updated with provisioningState at 'Succeeded'.