Please have a look at the following articles to understand more about the basics of Storage Account.
- Azure Storage – Basics
- Azure Resource Manage Template: Create A Storage Account Using Blank Template
Let’s start by creating a new Storage Account and understand the properties of the Storage Account while creating the same.
Navigate to the Azure Management portal and go to Storage Accounts blade as shown below.
Click on Add button in the above blade to navigate to the Create Storage Account blade as shown below.
Please provide the following details.
|Name||Name of the Storage Account|
|URL||<Storage Account Name>.core.windows.net|
|Deployment Model||Select Resource Manager – Recommended by Microsoft|
|Account Kind||Select General Purpose – This is used for creating and storing Blobs / Tables / Queues. (We will learn about how to create these programmatically in the upcoming articles.)|
|Performance||Select Standard. (Premium is only for storing VHDs for Virtual Machines)|
|Storage Service Encryption||Disabled (If you select Enabled, all the data that you write to the Storage will be in encrypted format and will be decrypted automatically when you read it. There might be a slight performance hit if you choose Enabled.|
|Subscription||Choose the required Subscription|
|Resource Group||Choose the required Resource Group – Please make sure that the Applications, Virtual Machines that access this storage account are in the same Resource Group to reduce the latency issues.|
|Location||Choose the required Data Center Location – Please make sure that the Applications, Virtual Machines that access this storage account are in the same Location to reduce the latency issues.|
Once you are ready click on Create button to create the Storage Account. After a few seconds, the Storage Account gets created as shown below.
Clicking on the storage account, you will be taken to its details page as shown below.
Now that we have created the Storage Account successfully we need to understand how to access it programmatically.
Before we learn about the APIs related to Storage account we need to understand few basics about the details that are required for programmatic access of the service.
- Storage Service End Point – Each Storage Account name is unique within azure and it has a unique URL in the format <storageaccountname>.core.windowsazure.net
- Access Keys – As these URLs are publicly accessible, we need a mechanism to securely access the resources. These Access Keys are used for authentication purposes for the applications that access the Storage accounts and its services likes Blobs, Queues and File Shares.
- Nuget Package – We can use Storage package to Connect, Read and Write to the Storage Services.
In order to view the Access Keys, navigate to the Access Keys blade as shown below.
We need to provide a ConnectionString to the Storage Account as an input to the WindowAzure.Storage library functions.
Click on the ellipses that are available in the keys shown below.
Now, click on the View Connection String to open the actual connection string shown below.
The connection String has the following
- DefaultEndPointsProtocol – The protocol that is used while connecting to the Storage Account end point. In most of the cases, you don’t need to change this.
- Account name – It’s just the name of the Storage Account – You just need to replace it with the name of your Storage Account
- AccountKey – Use one of the keys available in the Access Keys tab.
Summary: we have learnt the following
- Create a new Storage Account using Azure Management Portal
- Attributes of Storage Account
- Components required for access the Storage Account services programmatically.
- Access Keys
- Connection String for the Storage Account
Hope you enjoyed reading the article. Your feedback is appreciated.