Reputation: 7347
In .net I should be able to connect to the azure storage using SAS like this:
var someTable = new CloudTable("https://account-name.table.core.windows.net/table-name?sv={key}");
How can I do it in python? I could not find a CloudTable class in azure.storage.table (from azure sdk for python: https://github.com/Azure/azure-storage-python)
Is there any other way?
Upvotes: 1
Views: 2969
Reputation: 136346
Try something like the following:
import os
import json
from azure import *
from azure.storage import *
from azure.storage.table import TableService, Entity
table_service = TableService(account_name='[account-name]', sas_token='[sas-token]')
list = table_service.query_entities('[table-name]', top=100)
Replace [account-name]
, [sas-token]
and [table-name]
with actual values.
Also please do not include ?
from the SAS token for the [sas-token]
field.
Source: See the documentation here - https://github.com/Azure/azure-storage-python/blob/master/azure/storage/table/tableservice.py.
Upvotes: 2