قالب وردپرس درنا توس
Home / Tips and Tricks / Blobs, files, tables and queues – CloudSavvy IT

Blobs, files, tables and queues – CloudSavvy IT



azure logo

There are many ways to store data in Azure, but using storage accounts to consolidate the management of Blobs, Shares, Tables, and Queues makes it easy and efficient to manage some of the most useful file storage methods. Of the four options available, when would you use each of these methods?

  • Blobs: Unstructured storage medium is best used for cloud-based workloads.
  • File sharing: Traditional Windows SMB file extensions available through SMB 3.0.
  • Tables: A NoSQL key value store commonly used for rapid development.
  • Cows: Asynchronous message queue for communication between application components.

Each of these technologies has many options and its own unique configurations, but in this article we will show you how to simply manage data within each of these options.

Create a storage account

Before we can provide any of the above options, we must first create a storage account to hold the storage media. Navigate to the storage accounts and click “Add”

; to start the provisioning wizard.

Click

Give your storage account a name, location and other performance characteristics based on your needs. For this article, we will use all the default settings, except the name and location, and when all options are configured, click “Review + Create.”

When all performance options are configured, click

Navigate to your new storage account to see available options for creating blobs (containers), file shares, tables, and queues.

Available options for your storage account.

Create a Container (Blob) Storage

Click the “Containers” button at the bottom of the overview screen, then click the plus symbol “+” next to Container. Choose a name for your blob storage and click “Create”.

click

Once you have created, you will see some simple options and the ability to upload items plus management options.

Simple options and the ability to upload items plus management options.

Connect externally to container (blob)

One of the easiest ways to upload files to Container (Blob) Storage is to use azcopy.exe tool. This allows you to use a shared access URI (SAS) to upload the files. The following is an example of using PowerShell azcopy.exe to upload files. Let’s first create a shared access signature.

Example of using PowerShell with azcopy.exe to upload files.

Then copy the Blob service SAS URL as it will be used in azcopy command.

Copy the Blob service SAS URL.

Finally, you use azcopy copy the files or folders (with -recursive parameter) with SAS URL that you previously created.

azcopy copy 'C:\Files' {Container SAS URL} –recursive

File sharing

Those who work in Windows often manage mounted file resources. These are usually located on local file servers. Azure File Shares offers the ability to create a traditional SMB file resource that can be connected to via a client that supports the SMB 3.0 protocol.

SMB 3.0 was originally introduced in Windows 8 and Windows Server 2012. Therefore, you should have no problem connecting when using the latest versions of Windows.

In the same way we created a blob share, navigate to the “File shares” section under the Overview section and click the plus sign “+” next to the File sharing button.

Create a file resource.

Give the file share a name and select the appropriate level. This provides the necessary performance features that you may need depending on your specific application.

Give the file share a name and select the appropriate level.

Again, there are simple file transfer and management capabilities in the section on file management.

Easy file transfer and handling capabilities in the file management section.

Connect externally to a file resource

Because this is a Windows file resource, one of the easiest ways to connect to this resource is to use the supplied PowerShell script to create the mounted device in your local desktop or server environment. This requires port 445 to be open and accessible.

Use the included PowerShell script to create the mounted device in your local desktop or server environment.

Tables

Azure Storage Tables provides a high-performance key-value store. As previous examples have shown, click on the “Tables” button below the overview page and click on the plus sign “+” next to the table button.

click

Enter a name for the table and click “OK” to quickly create the table for use.

Name the table and click

Connect externally to a table

The easiest way to connect to a table externally, if not via the application’s internal encoding, is to use PowerShell. This requires Az module and AzTable module, and there are built-in 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

Cows

Finally, queues provide asynchronous message queues for easy buffered communication between applications. Just like the other services, navigate to the “Queues” button under the Overview section and click the plus sign “+” next to the queue button.

Navigate to the Queue button and click

Enter a name for the queue and click “OK” to quickly provide the queue for use.

Enter a name for the gender and click

Connect externally to a queue

The easiest way to connect to a queue externally, if not via the application’s internal coding, is to use PowerShell. This requires Az module, and since 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)

Manage content via Storage Explorer (preview)

Although some operations can be performed in each individual section, it is by far the easiest and fastest method to manage each of the four options via Storage Explorer (preview). As shown below, all available options are available, along with the ability to manage data.

  • Blobs: Upload, download, create folders, folder statistics
  • File sharing: Upload, download, create folders, directory statistics, connect virtual machine
  • Cows: View message, Add message, Dequeue message, Clear queue
  • Tables: Query, Add, Edit, Table Statistics

Available options for managing storage content.

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. Easy management is expanded with the help of Storage Explorer and simple external sharing and management options.


Source link