Skip to content

Commit

Permalink
Merge pull request Azure#14 from beltr0n/bertong-extract-identity
Browse files Browse the repository at this point in the history
Bertong extract identity
  • Loading branch information
lsundaralingam authored Jan 22, 2021
2 parents 5e5bc28 + b876e20 commit 2882314
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 33 deletions.
36 changes: 3 additions & 33 deletions sdk/communication/azure-communication-administration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Azure Communication Administration Package client library for Python

Azure Communication Administration client package is intended to be used to setup the basics for opening a way to use Azure Communication Service offerings. This package helps to create identities user tokens to be used by other client packages such as chat, calling, sms.
Azure Communication Administration client package is used to administer Phone Numbers.

# Getting started
### Prerequisites
Expand All @@ -17,31 +17,6 @@ pip install azure-communication-administration
```

# Key concepts
## CommunicationIdentityClient
`CommunicationIdentityClient` provides operations for:

- Create/delete identities to be used in Azure Communication Services. Those identities can be used to make use of Azure Communication offerings and can be scoped to have limited abilities through token scopes.

- Create/revoke scoped user access tokens to access services such as chat, calling, sms. Tokens are issued for a valid Azure Communication identity and can be revoked at any time.

### Initializing Identity Client
```python
# You can find your endpoint and access token from your resource in the Azure Portal
import os
from azure.communication.administration import CommunicationIdentityClient
from azure.identity import DefaultAzureCredential

connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING')
endpoint = os.getenv('AZURE_COMMUNICATION_SERVICE_ENDPOINT')

# To use Azure Active Directory Authentication (DefaultAzureCredential) make sure to have
# AZURE_TENANT_ID, AZURE_CLIENT_ID and AZURE_CLIENT_SECRET as env variables.
identity_client_managed_identity = CommunicationIdentityClient.(endpoint, DefaultAzureCredential())

#You can also authenticate using your connection string
identity_client = CommunicationIdentityClient.from_connection_string(connection_str)

```

## CommunicationPhoneNumberClient
### Initializing Phone Number Client
Expand Down Expand Up @@ -70,10 +45,6 @@ Phone numbers can be assigned to a callback URL via the configure number API. As
# Examples
The following section provides several code snippets covering some of the most common Azure Communication Services tasks, including:

[Create/delete Azure Communication Service identities][identitysamples]

[Create/revoke scoped user access tokens][identitysamples]

## Communication Phone number
### Get Countries

Expand Down Expand Up @@ -179,12 +150,12 @@ poller = phone_number_administration_client.begin_purchase_reservation(
```

# Troubleshooting
The Azure Communication Service Identity client will raise exceptions defined in [Azure Core][azure_core].
The Phone Number Administration client will raise exceptions defined in [Azure Core][azure_core].

# Next steps
## More sample code

Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/communication/azure-communication-administration/samples) directory for detailed examples of how to use this library to manage identities and tokens.
Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/communication/azure-communication-administration/samples) directory for detailed examples of how to use this library.

## Provide Feedback

Expand All @@ -201,5 +172,4 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.

<!-- LINKS -->
[identitysamples]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/communication/azure-communication-administration/samples/identity_samples.py
[azure_core]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------

VERSION = "1.0.0b4"

SDK_MONIKER = "communication-administration/{}".format(VERSION) # type: str
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------

VERSION = "1.0.0b4"

SDK_MONIKER = "communication-administration/{}".format(VERSION) # type: str

0 comments on commit 2882314

Please sign in to comment.