这让我很困惑。我一定遗漏了一些明显的东西。只是试图ContainerClient
从 a 中获取 a BlobServiceClient
。
例子:
import os
import logging
from azure.storage.blob import BlobServiceClient, BlobClient
conn_string = "connection-string-here"
cont_name = "cont-test"
blob_svc_client = BlobServiceClient.from_connection_string(conn_string)
blob_cont_client = BlobServiceClient.get_container_client(cont_name)
回报:
C:\Users\user\Desktop>python myProgram.py
Traceback (most recent call last):
File "C:\Users\user\Desktop\myProgram.py", line 11, in <module>
blob_cont_client = BlobServiceClient.get_container_client(cont_name)
TypeError: get_container_client() missing 1 required positional argument: 'container'
- 但是
get_container_client()
并没有错过位置参数“容器”。
为什么会这样?