The Windows Azure Storage Team recently announced several new great features for the storage service, most notably they have added CORS and JSON support to the services. Beyond those the update had many great features in it so make sure you go take a look at all the new shiny things.
Today we would like to announce support for managing the more detailed level analytics, as well as the CORS settings!
Detailed Analytics
For a while now you could turn on Storage Analytics and track aggregated transaction statistics and capacity data. We’ve had support for viewing this data in AMS for some time as well. Prior to the new release the Storage Analytics were aggregated at the hour level, but now you have the option to aggregate to the minute level as well for more real-ish time analysis. The numbers are available generally within about five minutes.
To configure the Storage Analytics, open AMS and navigate the treeview to the storage account you want to manage the settings for. Right-click on the storage account and select ‘Configure Storage Analytics…’ from the context menu.
On the Configure Storage Analytics dialog that appears you now have the option to enable/disable the Minute Metrics, including the data retention policy for each storage service (BLOBs, Queues, and Tables) just like you could do for the hourly metrics previously. You also have the ability to click the ‘Quick Configuration…’ to set the same value for all three services at once.
In the example above we have enabled the minute metrics for BLOBs, including metrics from the API and turned on a retention policy of 20 days. Once you have your settings filled in click ‘Save’ . After a little usage we can then take a peek at what was captured.
Expanding out the Storage Analytics node on the treeview and you’ll see there are now new tables available under the Raw Data node.
If we query the minutes table for BLOBs we’ll see the following raw data:
Since this is just data in a Windows Azure Storage Table you can query it, export it with AMS or use it direct from your own solutions. You can see that the PartitionKey is comprised of the date down to the minute and the RowKey is the aggregate operations.
CORS Settings
CORS, or Cross-Origin Resource Sharing, is used to allow code from different domains to share resources. Browsers have security features which help reduce the amount of cross-site scripting attacks by blocking code from one domain from attempting to hit code from another site. In some cases though it is very helpful to be able to reach across to another domain to utilize a resource. For example, your JavaScript code which originated from MyCompany.com wants to make an API call to upload a file directly into BLOB storage without having to first push it to a server, then upload the file from there. This is where CORS comes in. You set up configuration to tell one resource that it can allow requests from another site, or Origin.
With the recent update Windows Azure Storage API now allows you to configure each service (BLOBs, Queues and Tables) independently per storage account. You can currently have up to five CORS rules per service per storage account. AMS now supports the management of CORS rules well. By right-clicking a storage account node in AMS you’ll find the ‘Configure CORS…’ option. If you already have CORS rules on the account you’ll see them in the list under the tab for the service they are specified for. You can click on the plus sign to add a new rule.
Each rule consists of the allowed origins, methods and headers. The allowed Origins are the URLs (case-sensitive) that are allowed to utilize the service. You can also restrict which HTTP methods (or verbs) that are allowed and which headers to be expected. If a header is sent to the service that does NOT appear in this list the entire operation will be rejected. Note that you can add multiple origins and headers by separating them with commas and that wildcards are supported.
Once you set up your rule click Apply.
Remember that setting up a CORS rule allows the Cross Origin request to occur, it does not replace Windows Azure Storage authentication, so you still need to provide the correct authorization headers in your requests which will likely mean using Shared Access Signature URL so that your client code isn’t provided storage account credentials.
We hope you enjoy the new features and, as always, we’d love to hear your feedback. Please don’t hesitate to contact us with your thoughts.
Since Azure Management Studio is a click-once application you should just magically see the bits arrive, but if you’ve declined the update or your app hasn’t checked for an update you can also force an update by using the “Check for Update” option from the Help menu. If you don’t see this option you likely are one of our previous Beta testers and can just re-download the app from our product page. The version number will be 1.3.0.1080 or greater.