I am learning how to use Storage blob with Azure Functions, and I followed this document: https://learn.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();
This code in tutorial just show how to upload a blob in a new container, but I want to upload to an existing container. What can I do? Thanks.
blobServiceClient.GetContainerReference
. – Seabrooke