Showing posts with label Windows Azure. Show all posts
Showing posts with label Windows Azure. Show all posts

Monday, July 19, 2010

Browse online your Windows Azure Storage account

MyAzureStorage

The Windows Azure MyAzureStorage is a web based application that gives you the ability to browse your Windows Azure Storage. There are 3 available browsers: a TableBrowser, a QueueBrowser and a BlobBrowser. The only thing you need to logon to the application is your storage account name and your primary access key.

This is an official Microsoft application, so you can trust this, but be careful when giving your storage account name + primary access key away. With this information, people with bad intentions can access your Azure storage account and modify it.

TableBrowser

MyAzureStorageTable

In the TableBrowser you see a list that represents all the tables stored in your storage account. Besides viewing, you have the ability to create new and delete existing tables, and when you click on one of the table names, you navigate to the content of the the table.

MyAzureStorageTableContent

Just above the list with the content you have a textbox you are able to query the table content with a simple SQL like syntax. Some example queries:

  • Filter on Partition Key: PartitionKey = “PartitionKeyValue”
  • Filter on Row Key: RowKey = “RowKeyValue”
  • Filter on Columns: ColumnName = “CellValue”

=, !=, <, >, <=, >= are the operators you can use to query and there is also a possibility to combine multiple filters with AND, OR or NOT.

Into the left of the list, you see an summary of al the columns that are present in the table. By checking them you make them visible or invisible in the result set.

Besides viewing the data, there is the possibility to create, edit, copy and delete an entity. While creating, editing or copying an entity, you have the ability to add new properties.
When you make a copy of an entity, all properties get copied, except the RowKey which needs to be unique in the combination with a PartitionKey in the table.

QueueBrowser

MyAzureStorageQueue

In the QueueBrowser you receive a list of all the available queues in the account. You have the ability to create queues, edit the metadata or delete queues. When you click on one of the queue names, you navigate to the content of the the queue.

MyAzureStorageQueueContent 

In the content of the queue you are able to add new messages or clear the entire queue. The manually created messages will get an expiration time that is 7 days later than the insertion time.  When viewing the content the data gets peeked, so you don’t have to worry that you’re messages should get unavailable.

BlobBrowser

MyAzureStorageBlob

In the BlobBrowser you receive a list of all the blob containers available in the account. You are able to create or delete an blob container. Other actions are:

  • Editing: you can set the Public access (Off / Container level / Blob level) and the metadata of the container.
  • Manage policies: you can create, edit or delete your access policies for the container. A policy has a name, a start date, an end date and RWDL (Read, Write, Delete, List) rights.
  • Share: you can create an url with limited access for the users who access it. You can do this based on a policy or with a start date, end date and RWDL rights.
  • Add Blob: adds a blob to the container.

MyAzureStorageBlobContent

When we click on a container name, we get a list with all the blobs within the container and if we click on one of these blobs, we get to see the details as shown on the image above. On the blob we can take the following actions:

  • Edit: you can upload a new file to the blob or change the metadata of the blob
  • Copy: makes a copy of the blob in on of the available containers.
  • Download: you can download the blob.
  • Share: you can create an url with limited access for the users who access it. You can do this based on a policy or with a start date, end date and RWDL rights.
  • Delete
  • Create new snapshot: you can make a snapshot based on the current state of the blob.

Monday, July 12, 2010

Be careful with CreateTablesFromModel

I started with the Windows Azure by following an online course of UK Dev. This course was a compilation of reading white papers, following recorded sessions and the Windows Azure Labs. While working with these labs, I wanted to start from scratch instead of using the start solution.

So I started to set up the N-tier solution and added all the necessary references. I created the whole solution as described in the lab, but I used my own naming convention. When everything was set-up I pressed the F5 button and the application started. So far, so good. The web form started, I filled in my web form and pressed the save button to persist my data… and received a DataServiceRequestException.

In the Inner Exception I was able to discover a little more information:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code>TableNotFound</code>
<message xml:lang="nl-BE">The table specified does not exist.</message>
</error>

At this stage I was surprised. The CreateTablesFromModel method didn’t give me any notice that something went wrong while creating my model. So I went looking in the development storage database what was missing. In the TableRow table I discovered that a row was added, but the name in the column ‘TableName’ wasn’t the name that I was expecting. I named my domain class ‘Entry’ but in the row that was added, the table name was ‘Entries’.

So I went looking in my code for the name ‘Entries’ to find out that I had a property called ‘Entries’ in the implementation of my own DataContext.

/// <summary>
/// Exposes the Entry table
/// </summary>
public IQueryable<Entry> Entries
{
get
{
return this.CreateQuery<Entry>("Entry");
}
}

I presumed that my tables would be created by the name given to the class that persists the data. However, the names of the properties in the DataContext are used to create the table names. At this point I had 2 possibilities:
· I rename the property in the DataContext to ‘Entry’
· I change the string parameter in the CreateQuery method inside the property to ‘Entries’
The last option meant that I would have to look up where else this parameter is used, so I can change it to ‘Entries’. (The AddObject method was one of the methods I had to change)