Microsoft Azure Communication Management Client Library for Python
Project description
Microsoft Azure SDK for Python
This is the Microsoft Azure Communication Management Client Library. This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. For a more complete view of Azure libraries, see the azure sdk python release.
Usage
For additional code examples, see Communication Service Management on docs.microsoft.com.
Prerequisites
See the Python developer guide to configure your dev environment and set the needed environment variables.
Examples
Authentication
This example authenticates to Azure using a service principal. Documentation on creating and managing a service principal in AAD can be found here.
def __create_communication_management_client(credentials):
subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID");
if subscription_id is None:
return None
return CommunicationServiceManagementClient(credentials, subscription_id)
def __create_service_principal_credentials():
# service principal's app id; `<your-app-id>`
app_id = os.environ.get("AZURE_CLIENT_ID");
# one of the service principal's client secrets; `<your-password>`
client_secret = os.environ.get("AZURE_CLIENT_SECRET");
# id of the principal's Azure Active Directory tenant; `<your-tenant-id>`
tenant_id = os.environ.get("AZURE_TENANT_ID");
if app_id is None or client_secret is None or tenant_id is None:
return None
return ServicePrincipalCredentials(client_id=app_id, secret=client_secret, tenant=tenant_id)
Create a communication service resource
def __create_communication_service(mgmt_client, resourceGroupName, resourceName):
resource = CommunicationServiceResource(location="global", data_location = "UnitedStates")
mgmt_client.communication_service.create_or_update(resourceGroupName, resourceName, resource)
List all communication services
def __list_communication_service(mgmt_client):
resources = mgmt_client.communication_service.list_by_subscription();
for resource in resources:
print(resource)
Delete a communication service
def __delete_communication_service(mgmt_client, resourceGroupName, resourceName):
mgmt_client.communication_service.delete(resourceGroupName, resourceName)
Provide Feedback
If you encounter any bugs or have suggestions, please file an issue in the Issues section of the project.
Release History
1.0.0b1 (2020-09-22)
- Initial Release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file azure-mgmt-communication-1.0.0b1.zip
.
File metadata
- Download URL: azure-mgmt-communication-1.0.0b1.zip
- Upload date:
- Size: 31.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | db435636c46e5191ddcc865f4b99d61408a6db10f699c4b35b7e39daada067a1 |
|
MD5 | 3a53c74e03766a3c69a59750db67a66b |
|
BLAKE2b-256 | c62e8138fa1fa53c900aac309477176d7aed6512ab757951a327198a93659689 |
File details
Details for the file azure_mgmt_communication-1.0.0b1-py2.py3-none-any.whl
.
File metadata
- Download URL: azure_mgmt_communication-1.0.0b1-py2.py3-none-any.whl
- Upload date:
- Size: 23.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | adceb21c469cc71ef12a92dedde31971267229ab04bdfb6b878e5b684160e72d |
|
MD5 | 1a4403dbd2115b5cc1350b5f861cc09f |
|
BLAKE2b-256 | 6e101d2105642ceaec26376a654b795c1dff76e835c6980e56fd590bd0b601bf |