作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在学习如何将存储 blob 与 Azure Functions 结合使用,并且我遵循了以下文档:https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-dotnet
// Create a BlobServiceClient object which will be used to create a container client
BlobServiceClient blobServiceClient = new BlobServiceClient(connectionString);
// Create the container and return a container client object
BlobContainerClient containerClient = await blobServiceClient.CreateBlobContainerAsync("<containername>");
// Get a reference to a blob
BlobClient blobClient = containerClient.GetBlobClient("<blobname>");
// Open the file and upload its data
using FileStream uploadFileStream = File.OpenRead("<localfilepath>");
await blobClient.UploadAsync(uploadFileStream, true);
uploadFileStream.Close();
教程中的这段代码仅展示了如何在新容器中上传 blob,但我想上传到现有容器。我能做什么?谢谢。
最佳答案
使用 GetBlobContainerClient
.你得到的其他 awnsers 都是为了 v11
.
var serviceClient = new BlobServiceClient(connectionString);
var containerClient = serviceClient.GetBlobContainerClient(containerName);
关于c# - 如何将 blob 上传到 C# 函数中的现有容器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63149205/
我是一名优秀的程序员,十分优秀!