قالب وردپرس درنا توس
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. However, using storage accounts to consolidate the management of blobs (containers), file shares, tables, and queues allows for easy and efficient management of some of the most useful file storage methods. Of the four options available, when would you use any of these methods?

  • Blobs (container): Unstructured object storage medium best used for cloud-native workloads.
  • File shares: Traditional Windows SMB file shares that can be accessed through SMB 3.0.
  • Tables: A NoSQL key-value store typically used for rapid development.
  • Queues: Asynchronous message queue for communication between application components.

Each of these technologies has many options and their own configurations. However, this article shows how to easily manage data in 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 store the storage media. Navigate to Storage Accounts and click Add to start the Deployment Wizard.

click

Give your storage account a name, location, and other features that suit your needs. This article uses all of the default settings except for the name and location. Once all options are configured, click “Review + Create”.

Once all of the performance options are configured, click

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

Available options for your storage account.

Create a container (blob) store

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

Click on

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

Simple options and the ability to upload objects as well as management options.

Establish an external connection to the container (blob) warehouse

One of the easiest ways to upload files to container (blob) storage is to use azcopy.exe Usefulness. This allows you to use a Shared Access Signature (SAS) URI to upload the files. The following is an example of using PowerShell with azcopy.exe Upload files. First, let’s create the shared access signature.

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

Next, copy the SAS url of the blob service as it will be used in the azcopy Command.

Copy the SAS URL of the blob service.

Finally with that azcopy Utility, copy the files or folders (with the -recursive Parameters) using the previously created SAS URL.

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

File shares

Anyone working on Windows is often concerned with hosted file shares. Usually these are located on local file servers. Azure file shares provide the ability to create a traditional SMB file share that can be connected through a client that supports the SMB 3.0 protocol.

SMB 3.0 was originally introduced in Windows 8 and Windows Server 2012. Therefore, you shouldn’t have any problems connecting using the recommended newer versions of Windows.

Similar to creating a blob share, navigate to the File Shares section in the Summary section and click the plus sign “+” next to the File Share button.

Create a file share.

Give the file share a name and select the appropriate level. This will give you the necessary features that you may need depending on the application.

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

In the section on managing file shares, there are again simple functions for uploading and managing files.

Simple functions for uploading and managing files in the section for managing file shares.

External connection to a file share

Since this is a Windows file share, one of the easiest ways to connect to this share is to create the mounted drive in your local desktop or server environment using the provided PowerShell script. This requires a port 445 be open and approachable.

Use the provided PowerShell script to create the mounted drive in your local desktop or server environment.

Tables

Azure storage tables provide powerful key-value storage. As the previous examples showed, click the Tables button on the summary page, then click the plus sign “+” next to the Table button.

Click on that

Enter a name for the table and click OK to quickly deploy 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 through the application’s internal coding, is to use PowerShell. This requires the Az Module and the AzTable Module, and there are native cmdlets available to connect 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

Queues

Finally, queues provide asynchronous message queues for easy, buffered communication between applications. As with the other services, navigate to the Queues button in the Summary section and click the plus sign “+” next to the Queue button.

Navigate to the Queues button and click

Enter a name for the queue and click OK to quickly make the queue ready for use.

Enter a name for the queue and click

External connection to a queue

The easiest way to connect to a queue externally, if not through the application’s internal coding, is to use PowerShell. This requires the Az Module, and since there are no specific cmdlets to interact 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)

Managing Content Using Storage Explorer (Preview)

While specific operations can be performed on each individual section, managing the four options is by far the easiest and fastest method through the Memory Explorer (Preview). As shown below, any of the options available are available, along with the ability to manage data.

  • Blobs: Uploading, downloading, creating folders, folder statistics
  • File shares: Upload, download, folder creation, directory statistics, Connect VM
  • Queues: Display message, add message, remove message from the queue, delete the queue
  • Tables: Query, add, edit, table statistics

Options available for managing memory contents.

Conclusion

As you can see, there are a number of options for managing data storage options for storage accounts for blobs, file shares, queues, and tables. The ease of management is enhanced by the use of Storage Explorer and simple external sharing and management options.


Source link