我尝试使用 Azure 存储帐户创建表,但出现以下错误。
Traceback (most recent call last):
File "./table.py", line 10, in <module>
table_service.create_table('tasktable')
File "/usr/local/lib/python2.7/dist-packages/azure/storage/table/tableservice.py", line 525, in create_table
_dont_fail_on_exist(ex)
File "/usr/local/lib/python2.7/dist-packages/azure/storage/_error.py", line 81, in _dont_fail_on_exist
raise error
azure.common.AzureHttpError: Not Implemented
{"odata.error":{"code":"NotImplemented","message":{"lang":"en-US","value":"The requested operation is not implemented on the specified resource.\nRequestId:xxxxxxxxxxxxxxx\nTime:2017-02-06T09:23:30.6719100Z"}}}
我的代码在这里:
#!/usr/bin/env python
from azure.storage.table import TableService, TablePermissions #Entity
from azure.storage.blob import BlockBlobService
table_service = TableService(account_name='myAccount', account_key='myKey')
table_service.create_table('tasktable')
task = Entity()
task.PartitionKey = 'tasksSeattle'
task.RowKey = '2'
task.description = 'Wash the car'
task.priority = 100
table_service.insert_entity('tasktable', task)
谁来帮助我。
最佳答案
Blob 存储
帐户仅支持 Blob。他们不支持表、队列和文件。因此,当您尝试创建表时,您会收到此错误。
您需要做的是创建一个标准
存储帐户并在代码中使用它。请注意,您不应选择 ZRS
或 Premium LRS
冗余级别,因为这些也不支持表。 LRS
、GRS
和 RAGRS
冗余应该可以正常工作。
关于python - 无法使用 Python 创建 Azure 表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42064344/