Exercise - Add the storage client library to your app
Let's integrate the Azure Storage Blobs client library into your .NET Core console application. The Azure Storage Blobs client library for .NET is distributed with NuGet. You'll want to add the Azure.Storage.Blobs package to your .NET or .NET Core applications.
Add the Azure Storage NuGet package
In Unit 3, you created a .NET Core Console application called PhotoSharingApp. In Azure Cloud Shell,
cd
to the PhotoSharingApp directory if you aren't already there.Enter the following code to add the Azure.Storage.Blobs package to the application:
dotnet add package Azure.Storage.Blobs
You'll see some console activity while the client library and all the required dependencies are downloaded. When the download is complete, let's build and run the app again to make sure everything is ready to go. Enter the following command:
dotnet run
As before, the return output "Hello World!" appears.
Let's integrate the Azure Storage Blob Client Library for JavaScript into your application. The Node.js client library is available through the Node Package manager (npm). You'll want to add the @azure/storage-blob package to your packages.json file.
Add the Azure Storage package
In Azure Cloud Shell,
cd
to the PhotoSharingApp directory if you aren't already there.Enter the following code to add the @azure/storage-blob package to the application. Make sure to supply the
--save
option so it persists to packages.json.npm install @azure/storage-blob --save
You'll see some console activity while the client library and all the required dependencies are downloaded. When the download is complete, let's build and run the app again to make sure everything is ready to go. Enter the following command:
node index.js
As before, the return output "Hello, World!" appears.
Now that we have the necessary libraries in place, let's look at the common tasks you'll do in your code to work with Azure storage.