Updating the Code to Add Images to Storage Account
Explore how to update your existing C# API code to upload images to an Azure Storage account. Learn to use the Azure Storage SDK to create containers, upload image files as blobs, and verify uploads through the Azure portal. This lesson helps you understand the integration of Azure Functions and Storage to support image processing in your first Azure solution.
We'll cover the following...
We'll cover the following...
Preparing the code
Now that we have set up the storage account, our next step is to update our existing code so that the API can upload files to this storage account. Here’s how:
- In the
csprojfile, we will add the following NuGet package.
This will allow us to use the Azure storage account SDK.
- Within the
ImageDescriberApi.csfile, we will insert the function given below:
-
The function, named
UploadFileStreamToStorageAccount, performs the following operations:-
...
-