Create Azure Storage Account and understand the different use cases by examples
One of the most fundamental benefits of cloud computing is the ability to create an off-premise storage capacity that is accessible to an entire enterprise at any time from anywhere. Whether your business stores enterprise-critical data or general images for your website, having reliable access, supported by the proper backup and redundancy procedures, is vital.
This Azure article will discuss how to create Azure storage accounts using Azure Portal.
I - Storage Account components (General Purpose v2):
An Azure storage account contains all of your Azure Storage data objects: blobs, files, queues, and tables. The storage account provides a unique namespace for your Azure Storage data that's accessible from anywhere in the world over HTTP or HTTPS. Data in your storage account is durable and highly available, secure, and massively scalable.
We can use one of these components to store our data. I'll start with a brief explanation of each type of storage :
II - How to create a storage account in Azure Portal
Follow the below steps to create the storage account
1.?Log in to the?Azure portal?(https://portal.azure.com/)
2. shearch for storage account :
3. Click "Create"
Give your storage account a name, location, and other performance characteristics based on your needs. For this article, we are going to use all defaults, except the name (must be unique and lowercase) and location, and once all options are configured click on "Review + Create."
Navigate to your new Storage Account to see the available options for creating Blobs (Containers), File Shares, Tables, and Queues.
1 - Creating a Container (Blob) Storage :
To create a new container in an Azure storage account, follow these steps numbered in red from 1 to 4:
Once created, you will see some simple options and the ability to Upload objects plus management options.
2 - File Shares
Anyone working in Windows often deals with mounted file shares. Usually, these are located within on-premise file servers. Azure File Shares offers the ability to create a traditional SMB file share that can be connected to via a client supporting the SMB 3.0 protocol.
Similar to how we created a blob share, navigate to the "File Shares" section under the Overview section and click on the "+" plus sign next to the File Share button.
Give the file share a name and choose the appropriate tier (Transaction Optimazied / Hot / Cool) and select "Review + Create"
We can see here in this image the various Tiers of File Share, This will give the necessary performance characteristics that you might need depending on your specific application:
Once again, simple file upload and management abilities exist in the file share management section.
领英推荐
A - Externally Connect to a File Share
Because this is a Windows file share, one of the easiest methods for connecting to this share is to use the provided PowerShell script to create the mounted drive in your local desktop or server environment. This does require port 445 to be open and accessible.
So to do it, select "Connect", choose your OS (Windows in my case), choose drive letter then copy the PowerShell code. this Code can be executed on any windows machine.
3 - Tables :
Azure Storage Tables provide a high-performance key-value store. As prior examples have shown, click on the "Tables" button under the Overview page and click on the "+" plus sign next to the Table button.
Provide a name for the Table and click on "OK" to quickly provision the table for use.
A - Externally Connect to a Table
The easiest way to connect to a Table externally, if not via the applications internal coding, is to use PowerShell. This requires the Az module and the AzTable module, and there are native cmdlets available for connecting to a Table.
# Install Az Module
Install-Module -Name 'Az'
# Install Az Table Module
Install-Module -Name 'AzTable'
# Import Module Az and Az Table
Import-Module -Name 'Az'
Import-Module -Name 'AzTable'
# Connect to Azure AD
Connect-AzAccount
# Connect to a specific Storage Account
$storageAccount = Get-AzStorageAccount -Name 'myStorageaccount' -ResourceGroupName 'myRG'
# Connect to a specific Table
$table = Get-AzStorageTable --Name 'myTestTable' --Context $storageAccount.Context
# Add a row to the specified Table
$Params = @{
"Table" = $Table.CloudTable
"PartitionKey" = 'Partition1'
"RowKey" = 'Key1'
"Property" = @{
"FirstProperty" = 'Test Value 1'
"SecondProperty" = 'Test Value 2'
}
}
Add-AzTableRow @Params
4 - Queues :
Finally, Queues provide asynchronous message queues for easy buffered communications between applications. Just like the other services, navigate to the "Queues" button under the Overview section and click on the "+"? plus sign next to the Queue button.
Provide a name for the Queue and click on "OK" to quickly provision the queue for use.
A - Externally Connect to a Queue
The easiest way to connect to a Queue externally, if not via the applications internal coding, is to use PowerShell. This requires the Az module, and because there are no specific cmdlets for interacting with a Queue, the code depends on .NET classes.
# Install the Az Module
Install-Module -Name 'Az'
# Import the Az Module
Import-Module -Name 'Az'
# Connect to Azure AD
Connect-AzAccount
# Connect to a specific Storage Account
$storageAccount = Get-AzStorageAccount -Name 'myStorageAccount' -ResourceGroupName 'myRG'
# Connect to a specific Queue
$queue = Get-AzStorageQueue --Name 'myQueue' --Context $storageAccount.Context
# Create a new message using a constructor of the CloudQueueMessage class
$queueMessage = [Microsoft.Azure.Storage.Queue.CloudQueueMessage]::New("Test Message")
# Add a new message to the queue
$queue.CloudQueue.AddMessageAsync($QueueMessage)
III - Managing Content via Storage Explorer :
Although certain operations can be done in each individual section, by far the easiest and quickest method to manage each of the four options is via the Storage Explorer. Microsoft Azure Storage Explorer is a standalone app that makes it easy to work with Azure Storage data on Windows, macOS, and Linux.
As shown below, each of the available options is available, along with the ability to manage data.
To download and install Storage Explorer, see Azure Storage Explorer
Conclusion
As you can see there are a number of options for managing Storage Account data storage options for Blobs, File Shares, Queues, and Tables. The ease of management is expanded by the use of the Storage Explorer and easy external share and management options.
Thanks
Aymen EL JAZIRI
Linux | DevOps | IBM | AWS | Azure | GCP | Python
10 个月Very Insightful