Skip to content

Latest commit

 

History

History
148 lines (99 loc) · 7.4 KB

create-communication-resource.md

File metadata and controls

148 lines (99 loc) · 7.4 KB
title titleSuffix description author manager services ms.author ms.date ms.topic ms.service ms.subservice zone_pivot_groups ms.custom ms.devlang
Quickstart - Create and manage resources in Azure Communication Services
An Azure Communication Services quickstart
In this quickstart, you learn how to create and manage your first Azure Communication Services resource.
tophpalmer
chpalm
azure-communication-services
chpalm
06/30/2021
quickstart
azure-communication-services
arm
acs-plat-azp-azcli-net-ps
mode-other, devx-track-azurecli, devx-track-azurepowershell
azurecli

Quickstart: Create and manage Communication Services resources

Get started with Azure Communication Services by provisioning your first Communication Services resource. Communication Services resources can be provisioned through the Azure portal or using the .NET management SDK. The management SDK and the Azure portal enable you to create, configure, update, and delete your resources and interface using the new deployment and management service: Azure Resource Manager. All functions available in the SDKs are available in the Azure portal.

[!VIDEO https://www.youtube.com/embed/3In3o5DhOHU]

Warning

Note that you can't create a resource group at the same time as a resource for Azure Communication Services. Before creating a resource, you need to first create a resource group.

::: zone pivot="platform-azp" [!INCLUDE Azure portal] ::: zone-end

::: zone pivot="platform-azcli" [!INCLUDE Azure CLI] ::: zone-end

::: zone pivot="platform-net" [!INCLUDE .NET] ::: zone-end

::: zone pivot="platform-powershell" [!INCLUDE PowerShell] ::: zone-end

Access your connection strings and service endpoints

Connection strings enable the Communication Services SDKs to connect and authenticate to Azure. You can access your Communication Services connection strings and service endpoints from the Azure portal or programmatically with Azure Resource Manager APIs.

After navigating to your Communication Services resource, select Keys from the navigation menu and copy the Connection string or Endpoint values for usage by the Communication Services SDKs. You have access to primary and secondary keys. This can be useful when you would like to provide temporary access to your Communication Services resources to a third-party or staging environment.

:::image type="content" source="./media/key.png" alt-text="Screenshot of Communication Services Key page.":::

Access your connection strings and service endpoints using Azure CLI

You can also access key information using Azure CLI, like your resource group or the keys for a specific resource.

Install Azure CLI and use the following command to sign in. You need to provide your credentials to connect with your Azure account.

az login

Now you can access important information about your resources.

az communication list --resource-group "<resourceGroup>"

az communication list-key --name "<acsResourceName>" --resource-group "<resourceGroup>"

If you would like to select a specific subscription, you can also specify the --subscription flag and provide the subscription ID.

az communication list --resource-group  "<resourceGroup>"  --subscription "<subscriptionId>"

az communication list-key --name "<acsResourceName>" --resource-group "<resourceGroup>" --subscription "<subscriptionId>"

Store your connection string

Communication Services SDKs use connection strings to authorize requests made to Communication Services. You have several options for storing your connection string:

  • An application running on the desktop or on a device can store the connection string in an app.config or web.config file. Add the connection string to the AppSettings section in these files.
  • An application running in an Azure App Service can store the connection string in the App Service application settings. Add the connection string to the Connection Strings section of the Application Settings tab within the portal.
  • You can store your connection string in Azure Key Vault. You can further securely manage your connection string.
  • If you're running your application locally, you may want to store your connection string in an environment variable.

Store your connection string in an environment variable

To configure an environment variable, open a console window and select your operating system from the following tabs. Replace <yourconnectionstring> with your actual connection string.

Open a console window and enter the following command:

setx COMMUNICATION_SERVICES_CONNECTION_STRING "<yourConnectionString>"

After you add the environment variable, you may need to restart any running programs that read the environment variable, including the console window. For example, if you're using Visual Studio as your editor, restart Visual Studio before running the example.

Edit your .zshrc file, and add the environment variable:

export COMMUNICATION_SERVICES_CONNECTION_STRING="<yourConnectionString>"

After you add the environment variable, run source ~/.zshrc from your console window to make the changes effective. If you created the environment variable with your IDE open, you may need to close and reopen the editor, IDE, or shell to access the variable.

Edit your .bash_profile file, and add the environment variable:

export COMMUNICATION_SERVICES_CONNECTION_STRING="<yourConnectionString>"

After you add the environment variable, run source ~/.bash_profile from your console window to make the changes effective. If you created the environment variable with your IDE open, you may need to close and reopen the editor, IDE, or shell to access the variable.


Clean up resources

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.

az communication delete --name "acsResourceName" --resource-group "resourceGroup"

Deleting the resource group also deletes any other resources associated with it.

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.

Note

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.

Next steps

In this quickstart you learned how to:

[!div class="checklist"]

  • Create a Communication Services resource
  • Configure resource geography and tags
  • Access the keys for that resource
  • Delete the resource

[!div class="nextstepaction"] Create your first user access tokens