【发布时间】:2020-12-09 10:53:56
【问题描述】:
我正在尝试使用 python 脚本删除我的 azure blob,为此我正在使用库 azure.storage 中的 BlobClient。
这是代码,我正在尝试运行:
import json, sys, os, time
from azure.storage.blob import BlobServiceClient, PublicAccess, BlobClient
endpoint = os.environ['COMPUTER_VISION_ENDPOINT']
subscription_key = os.environ['COMPUTER_VISION_SUBSCRIPTION_KEY']
text_recognition_url = endpoint + "/vision/v3.0/read/analyze"
file_name = input("Enter the file name: ")
image_url = "https://textimage.blob.core.windows.net/handwritten-text/" + file_name
blob_client = BlobClient.from_blob_url(blob_url=image_url)
blob_client.delete_blob()
print("Done")
虽然 blob 和容器存在于 azure 存储帐户中,但它会引发以下错误:
azure.core.exceptions.ResourceNotFoundError: The specified resource does not exist.
我哪里错了?
使用 python 脚本删除特定开放 blob 的更好方法是什么?
【问题讨论】:
-
请不要这样做...我会更新答案。
标签: azure azure-active-directory azure-functions azure-blob-storage