forked from Azure/azure-sdk-for-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Azure#14 from beltr0n/bertong-extract-identity
Bertong extract identity
- Loading branch information
Showing
3 changed files
with
21 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
||
|
@@ -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 | ||
|
||
|
@@ -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 |
9 changes: 9 additions & 0 deletions
9
sdk/communication/azure-communication-identity/azure/communication/identity/_version.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
9 changes: 9 additions & 0 deletions
9
sdk/communication/azure-communication-identity/azure/communication/identity/aio/_version.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |