Exercise - Accessing Storage Account
The Azure storage account can be used for several different things, mainly (but not only):
- Storing files (pictures, videos, documents, …)
- Storing data in a table structure
- Sending and receiving messages in a storage queue.
Try to find out how to access the storage account from a C# application.
A simple console application is sufficient.
The application should be able to do the following.
- Take a local textfile and upload it to the storage account into a container called “pupils”.
The text file should be named after you (Firstname_Lastname.txt) and contain a short message like “all your base are belong to us”. - Download the previously uploaded textfile and save it under as Firstname_Lastname_Timestamp.txt on your local hard drive.
- Make an entry into a table called “pupiltable”. You should have a column for each of these fields: Firstname, Lastname, DateOfBirth.
As PartitionKey use “pupils”, as RowKey use any unique ID that identifies you. - Read data from the table. List all entries (the entry made by you and by others in class) and output it in the console.
- Write a message in a storage queue called “greetings”.
- Write a message consumer that listens for messages being added and displays the content of the message in the console.
Use information online to find out how to access the service. (e.g. which NuGet package to use).
You will get a connection string from your teacher to be able to connect to the storage account.