|
1 | 1 | ---
|
2 | 2 | title:
|
3 | 3 | keywords: Azure, python, SDK, API, azure-mgmt-webpubsub, webpubsub
|
4 |
| -author: ramya-rao-a |
5 |
| -ms.author: ramyar |
6 |
| -ms.date: 10/14/2021 |
| 4 | +author: msyyc |
| 5 | +ms.author: yuchaoyan |
| 6 | +ms.date: 03/21/2023 |
7 | 7 | ms.topic: reference
|
8 |
| -ms.technology: azure |
9 | 8 | ms.devlang: python
|
10 | 9 | ms.service: azure-web-pubsub
|
11 | 10 | ---
|
12 |
| - |
13 | 11 | # Microsoft Azure SDK for Python
|
14 | 12 |
|
15 |
| -This is the Microsoft Azure Webpubsub Management Client Library. |
16 |
| -This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. |
| 13 | +This is the Microsoft Azure WebPubSub Management Client Library. |
| 14 | +This package has been tested with Python 3.7+. |
17 | 15 | For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
|
18 | 16 |
|
| 17 | +## _Disclaimer_ |
| 18 | + |
| 19 | +_Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_ |
| 20 | + |
| 21 | +## Getting started |
| 22 | + |
| 23 | +### Prerequisites |
| 24 | + |
| 25 | +- Python 3.7+ is required to use this package. |
| 26 | +- [Azure subscription](https://azure.microsoft.com/free/) |
| 27 | + |
| 28 | +### Install the package |
| 29 | + |
| 30 | +```bash |
| 31 | +pip install azure-mgmt-webpubsub |
| 32 | +pip install azure-identity |
| 33 | +``` |
| 34 | + |
| 35 | +### Authentication |
| 36 | + |
| 37 | +By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables. |
| 38 | + |
| 39 | +- `AZURE_CLIENT_ID` for Azure client ID. |
| 40 | +- `AZURE_TENANT_ID` for Azure tenant ID. |
| 41 | +- `AZURE_CLIENT_SECRET` for Azure client secret. |
| 42 | + |
| 43 | +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. |
| 44 | + |
| 45 | +With above configuration, client can be authenticated by following code: |
| 46 | + |
| 47 | +```python |
| 48 | +from azure.identity import DefaultAzureCredential |
| 49 | +from azure.mgmt.webpubsub import WebPubSubManagementClient |
| 50 | +import os |
| 51 | + |
| 52 | +sub_id = os.getenv("AZURE_SUBSCRIPTION_ID") |
| 53 | +client = WebPubSubManagementClient(credential=DefaultAzureCredential(), subscription_id=sub_id) |
| 54 | +``` |
19 | 55 |
|
20 |
| -# Usage |
| 56 | +## Examples |
21 | 57 |
|
22 | 58 |
|
23 |
| -To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt) |
| 59 | +Code samples for this package can be found at [WebPubSub Management](/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com and [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) |
24 | 60 |
|
25 | 61 |
|
26 |
| - |
27 |
| -For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/) |
28 |
| -Code samples for this package can be found at [Webpubsub Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com. |
29 |
| -Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) |
| 62 | +## Troubleshooting |
30 | 63 |
|
| 64 | +## Next steps |
31 | 65 |
|
32 |
| -# Provide Feedback |
| 66 | +## Provide Feedback |
33 | 67 |
|
34 | 68 | If you encounter any bugs or have suggestions, please file an issue in the
|
35 | 69 | [Issues](https://github.com/Azure/azure-sdk-for-python/issues)
|
|
0 commit comments