小编Dor*_* Lv的帖子

如何将 blob 上传到 C# 函数中的现有容器

我正在学习如何将存储 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();
Run Code Online (Sandbox Code Playgroud)

教程中的这段代码仅展示了如何在新容器中上传 blob,但我想上传到现有容器。我能做什么?谢谢。

c# blob function

4
推荐指数
1
解决办法
572
查看次数

标签 统计

blob ×1

c# ×1

function ×1