Thursday, July 31, 2014

A Tour of Azure Storage Explorer 6 Preview 1

I recently announced that work had resumed Azure Storage Explorer and that a new version (v6) was in the works. In this post, we'll take a tour of Preview 1, which is available now at AzureStorageExplorer.codeplex.com.

Let's start by reminding ourselves how important the Storage Service is. The Storage Service was one of the first services available in Microsoft Azure, and it remains a core, vital part of the platform. Even though a wealth of new services have been added to Azure over the years, a great many of them are built on top of the Storage Service. For example, it's where VHD images reside for the Compute Service.

Let's begin with broad strokes. Azure Storage Explorer 6 isn't finished yet, but we have much of the blob support in place. Since blob storage is arguably the most-used part of Microsoft Azure Storage, this seemed useful enough to make available in a preview release, and that's what you'll get if you download Preview 1. That means you'll have to wait on Table and Queue support, which still need to be implemented. Stay tuned to this blog for updates. It also should go without saying that incomplete software in preview should be treated as new and untested; early adopters should exercise caution and take care not to endanger critical or non-replaceable data.

The User Interface
When we created the predecessor version of Azure Storage Explorer, version 5, we worked to match the then-new styling of the Windows Azure portal. We've decided to stop doing that and return to a simpler look reminiscent of Windows File Explorer. You'll see a refinement of the styling as we iterate through the next few preview releases.

When you first launch Azure Storage Explorer 6, the main window won't show much other than a header that contains a combo box for selecting a storage account to view. To the right are buttons to add a  new storage account or remove the selected one. We'll see how to add and work with storage accounts in the next two sections. The remainder of the main window is a tab control, in which you can open tabs for one or more storage accounts.

Main window header for selecting, adding, or removing a storage account

Once you have your storage account(s) defined, selecting one will open a tab in the main window. The left pane is a tree of blob containers, queues, and tables. Selecting an item in the left pane opens its contents in the main window (only blobs at present).

Main window with a storage account tab open

At the top right is a gear icon. Click or right-click here for a tools menu with options to visit web sites (Microsoft Azure Management Portal, Azure Storage Explorer home on CodePlex) or see an About dialog with version information. As we add settings in subsequent updates, additional menu items will appear here.

Top-right Tools Menu

Adding a New Storage Account
To add a new storage account, click the Add Account button in the header and a New Storage Account dialog will appear.

Add Storage Account dialog

If you're wanting to access a local developer emulator account, select Local Developer Account. Otherwise, you'll need to know some things about your Microsoft Azure Storage account in order to complete the dialog, which you can get from the Microsoft Azure Management Portal:

• The storage account name
• The storage account key (this can be either the primary key or the secondary key)
• Whether the storage account uses a standard endpoint (US, Europe, Asia, Brazil, Japan), a China endpoint (Beijing, Shanghai), or a custom endpoint

Then, it's just a matter of entering the name and key and selecting the endpoint. If you want SSL communication, click Use HTTPS.

Next, click Test Access to verify the storage account is accessible (if you're working with local developer storage, launch the storage emulator first).

Verifying a New Storage Account

Once you've verified the account is accessible, click Save to add the new account, which will now appear in the main window's account list. The storage account information is written to a local file for your Windows user, and is encrypted.

Working with Storage Accounts
Once you've defined some storage accounts, simply select an account name from the list to open up a tab for it. You can open more than one tab.

Several Storage Account Tabs Open

If you want to open up a tab for every one of your storage account, select (all) from the account list. You'll likely experience a slight delay as storage accounts load; we're working to make this smoother and take place in the background so it doesn't tie up the user interface.

All Storage Account Tabs Open

To close an open tab, either click the close box next to its name, or select Storage Account > Close Tab from the menu.

Working with Blob Containers
When you have a storage account tab open, there are operations you can perform on both blob containers and the blobs within those containers.

Blob containers are listed in the left pane, under the outline item named "Blob Containers".

Blob Service Operations
When you select the "Blob Containers" item in the left pane, you have toolbar buttons for operations on the blob service: Refresh, New Container, and CORS Settings.

Blob Containers Outline Item and Toolbar

Refresh Container List button
The Refresh toolbar button refreshes the list of containers.

New Container button
The New toolbar button creates a new blob container. Specify a name for the container.

New Blob Container Dialog

CORS Rules button
The CORS toolbar button allows you to view or modify the Cross-Origin Resource Sharing (CORS) settings for the entire storage account. CORS is powerful in that it permits authorized web clients to directly access blob storage without having to go through a server, which is normally a security requirement. Add one or more rules, specifying allowed origin(s), allowed HTTP method(s), allowed headers, exposed headers, and max age in seconds. If you need to specify multiple values in a field, separate them with commas. You can add, edit, and delete rules in this dialog.

CORS Rules Dialog

Blob Container Operations
When you select a container, the right pane lists the blobs in the container and the left pane toolbar offers buttons for container actions: Refresh, New, Delete, and Security. We've already covered what Refresh and New do.


Delete a Container
The Delete toolbar button displays a confirmation dialog and deletes the selected container and all blobs within it.

Delete Blob Container Confirmation Dialog

Container Security
The Security toolbar button displays a dialog with two tabs, one for controlling the container's access security and the other for generating shared access signature URIs.

On the Access Level tab, you can view of modify the container's access level. There are 3 levels: Off means the container and its blobs can only be accessed by API with account credentials. Public Blob means the container's blobs can be read anonymously via URIs. Public Container means the blobs can be read anonymously and the container metadata can be accessed anonymously.

Container Security - Access Level Tab

On the Shared Access Signatures tab, you can generate ad-hoc Shared Access Signature URIs. This is a way of giving some parties a custom level of access to your blob container for a period of time. First specify the date range and allowable actions, then click Generate Signature. If you had a blob selected in the main pane, its name will be entered in the dialog automatically for you and included in the URI. The generated URI is copied to your clipboard, and you can test access in a browser by clicking the Test in Browser button. Note there isn't support yet for creating and using saved SAS policies; that will be coming in a future update.

Container Security - Shared Access Signatures Tab

Working with Blobs
When you select a container in the left pane, you can work with its blobs in the main pane. You can click on columns to sort by that column, in ascending or descending order. Unlike some prior versions, this view is not paged so you will see all blobs. We're currently thinking through how we will make this work well for containers that contain many thousands of blobs, and what kind of search and filtering controls we should add.

Blob List for a Selected Container

The main pane has a toolbar for blob operations, which provides these actions: Refresh Blob List, Select All, Clear All, Upload, Download, View, New Blob, Copy Blob, and Delete Blob.

Blob Toolbar

Refresh Blob List
The Refresh toolbar button reloads the list of blobs for the container and refreshes the list of blobs.

Selecting Blobs
You can select a blob by clicking its row, or deselect it by clicking it again. You can select a range of blobs by shift-click, or add/remove additional blobs by control-click. To select all blobs, click the Select All toolbar button. To clear all selections, click the Clear All toolbar button.

Uploading Files to Blob Storage
To upload one or more files to the selected container, click the Upload button. Select one or more files in the Open Files dialog and click Open to start the upload, or cancel to abort the action. Blobs are uploaded in the background without tying up the user interface; when the upload is complete, the blob list will refresh automatically.

Open Files Dialog for Uploading

In a future update the software will have an editable table of file types and MIME types that will be used to auto-assign the ContentType property of an uploaded  blob based on its name (for example, assigning a .jpeg file a content type of "image/jpeg"). In the meantime, you can manually set a blob's ContentType with the View toolbar button.

Downloading Blobs to Local File Storage
To download the selected blob(s) to your local file system, click the Download toolbar button. In the Folder Selection dialog, select the target folder and click Select Folder to begin the download, or Cancel to abort the action. Blobs are downloaded in the background without tying up the user interface.

Choose Blob Download Folder Dialog

As you perform uploads, downloads, or other long-running tasks, you'll see a status message on the bottom of the main window. If there are several tasks in progress, multiple status messages will stack vertically. There currently isn't any way to abort these tasks once you kick them off, but we'll be providing a way to cancel tasks in a future update.

Viewing Blobs
You can view or modify a selected blob's properties and content, either by clicking the View toolbar button or double-clicking the blob name. You'll see a Properties tab, a Content tab (block blobs only), and a Pages tab (page blobs only).


Viewing Blobs - Properties Tab
On the Properties tab, you'll see the blob's many properties listed, including Blob Type, Name, Length, Uri, Last Modified, and much more. Most of these values are read-only, but several of them are modifiable such as Content Type and Content Encoding (marked with an asterisk). Click the Update Properties button to apply updates to properties.

View Blob - Properties Tab

Viewing Blobs - Content Tab
For block blobs, the Content tab allows content to be viewed in a variety of formats including Image, Text, Video, and Web. 

Use Image View to view images, and Video View to view video content. If the blob is not in a valid format for these views, you'll receive an error message.

Image View

In the Text View, you can also edit the blob text and save changes.

Text View

Web View shows content via a web browser control, which can accommodate many kinds of content, from PDF documents to image files to HTML markup to XML data. Note that to use the Web viewer, as well as the Video viewer, your blob container access level must be Public.

Web View

Editing Page Blobs
For page blobs, there is a Pages tab which allows you to read and write pages of the blob. The list box at left shows pages currently allocated in storage for the blob; select a page to see its content at right as hex bytes. You can also read pages by entering a page number and clicking Read Page, or use the Prev / Next buttons to move through the blob's pages. 

To write data, enter up to 512 bytes of hex data in the text box and click Write Page. If you enter less than 512 bytes, the sequence you entered will repeat to fill a 512-byte page. So, just entering 00 and clicking Write will write a full page of 512 0's.

View Blob - Pages Tab

Creating a New Blob
Click the New toolbar button to create a new blob. In the dialog, specify a type and name for the blob. For a block blob, you can optionally enter text to store in the blob.

Create New Blob Dialog - Block Blob

For page blobs, specify a size for the blob in bytes, kilobytes, megabytes, or gigabytes. Creating a page blob does not initialize its pages; in Microsoft Azure, only the pages you specifically write to consume storage.

Create New Blob Dialog - Page Blob

Copying a Blob
The Copy toolbar button copies the selected blob. This is a very powerful facility, which can copy the blob into the same container (under a different name); to a different container; or even to a different storage account that may be in a different data center.

Copy Blob Dialog

Down the road, we'd like to add some bulk copy capabilities that would allow you to copy a collection of blobs or containers in one easy operation.

Deleting Blobs
The Delete toolbar button permanently displays a confirmation dialog and deletes the selected blob(s).

Delete Blob Confirmation Dialog

Summary
Well, that ends our tour of Azure Storage Explorer 6 Preview 1. We've taken a peek into every corner. The majority of core blob support is in place, with a few additional operations and refinements needed as we've noted. The new code base and user interface is underway, and we'll be refining that as well.

What's next for Azure Storage Explorer 6? As we start our next phase of work, we'll be focusing on adding table storage support. We'll be posting articles here as new updates become available, and you can also subscribe to automatic notifications about new updates on CodePlex.

Lastly, if you're interested in being a contributor please contact me. We've gone through a lot of work to put together an updated code base, and part of the reason for that is to enable community collaboration.

 I hope you find Azure Storage Explorer 6 useful.

No comments: