You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cosmos-db/table/how-to-use-python.md
+9-6Lines changed: 9 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,23 +64,26 @@ from azure.data.tables import TableServiceClient
64
64
from azure.data.tables import TableEntity
65
65
```
66
66
67
-
## Creating the client from a shared key
67
+
## Connect to Azure Table service
68
+
You can either connect to the Azure Storage account or the Azure Cosmos DB Table API account. Get the shared key or connection string based on the type of account you are using.
68
69
69
-
Create a `TableServiceClient` object, and pass in your Cosmos DB account name and account key. Replace `myaccount` and `mykey` with your account name and key.
70
+
### Creating the Table service client from a shared key
71
+
72
+
Create a `TableServiceClient` object, and pass in your Cosmos DB or Storage account name, account key and table endpoint. Replace `myaccount`, `mykey` and `mytableendpoint` with your Cosmos DB or Storage account name, key and table endpoint.
70
73
71
74
```python
72
75
from azure.core.credentials import AzureNamedKeyCredential
###Creating the Table service client from a connection string
79
82
80
-
Copy your Cosmos DB primary connection string from the Azure portal, and create a `TableServiceClient` object using your copied connection string:
83
+
Copy your Cosmos DB or Storage account connection string from the Azure portal, and create a `TableServiceClient` object using your copied connection string:
0 commit comments