2017-02-06 17 views
1

我試圖創建一個使用Azure存儲賬號一個創建Azure的表,但我得到了下面的錯誤。無法使用Python

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) 

有人幫助我。

P.S.如果需要更多信息,請告訴我,我會盡我所能提供。

+0

請檢查您嘗試創建此表的「Kind」存儲帳戶。您嘗試在不支持表格的存儲帳戶(ZRS,Premium LRS或Blob存儲)中創建此表格的可能性很大。 –

+0

@Gaurav Mantri我試圖在Blob存儲帳戶中創建表格。 – rsp

回答

2

Blob Storage帳號只支持blob。他們不支持表,隊列&文件。因此,當你嘗試創建一個表時,你會得到這個錯誤。

你需要做的是創建一個Standard存儲帳戶,並在你的代碼中使用它。請注意,您不應該選擇ZRSPremium LRS那裏的冗餘級別,因爲這些也不支持表格。 LRSGRSRAGRS冗餘應該可以正常工作。

+0

謝謝你幫助我。 – rsp