我想使用azure-blob-storage容器在本地目录中存储数据。为此,我使用了另一个容器中的upload_blob。文件正在上载到云中,但没有存储在本地路径中。我已经给了绑定,设备到云的上传属性,还用"chmod 777“更改了目录的权限。完成所有这些操作后,文件不会保存到本地。
Python函数:
with blob_service_client.get_blob_client(container=container_name, blob=local_file_name) as upload_client:
with open(upload_file_path, "rb") as data:
print("Uploading the file")
upload_client.upload_blob(data, blob_type="BlockBlob", overwrite=True)
print("Finished uploading")绑定:
"HostConfig": {
"Binds": [
"/opt/localstorage/blob/:/blobroot"
]上载属性
"blobstorage": {
"properties.desired": {
"deviceToCloudUploadProperties": {
"uploadOn": true,
"uploadOrder": "NewestFirst",
"cloudStorageConnectionString": "xxxx"
"storageContainersForUpload": {
"bloboutput": {
"target": "bloboutput"
}
}
},
"deviceAutoDeleteProperties": {
"deleteOn": false,
"deleteAfterMinutes": 15
}日志:
[2021-04-20 04:23:57.857] [info ] [tid 1] Info: Successfully loaded {0}: {1}, p0="Nephos.MaskClientIPAddressesInLogs", p1="False"
[2021-04-20 04:23:57.857] [info ] [tid 1] Info: Loading config Param {0} ({1}) read: {2}, p0="NephosIncludeInternalDetailsInErrorResponses", p1="Include internal details in error responses", p2="true"
[2021-04-20 04:23:57.857] [info ] [tid 1] Info: Successfully loaded {0}: {1}, p0="NephosIncludeInternalDetailsInErrorResponses", p1="True"
[2021-04-20 04:23:57.857] [info ] [tid 1] Info: Loading config Param {0} ({1}) read: {2}, p0="StampName", p1="Stamp Name", p2="Default Stamp"
[2021-04-20 04:23:57.924] [info ] [tid 1] Microsoft.AzureStack.Services.Storage.EntryPoint.BlobService: BlobService - StartAsync completed
[2021-04-20 04:23:57.925] [info ] [tid 1] Microsoft.Azure.Devices.BlobStorage.Tiering.BlobTieringService: Starting service...
[2021-04-20 04:23:57.937] [info ] [tid 1] [BlobInterface.cc:1494] [ListBlobsInOrder] ListBlobsInOrder received. Container:bloboutput BlobNameStart:null MaxBlobNames:1 OrderType:1 Flags:1
[2021-04-20 04:23:57.937] [error ] [tid 1] [MetaStore.cc:1953] [ListBlobsInOrder] Container not found. Name:bloboutput发布于 2021-04-26 14:43:05
因为你提到了在“本地”存储文件。则应使用方法“download_blob”
这是tutorials。
https://stackoverflow.com/questions/67225334
复制相似问题