Introducing the Azure Storage Type Provider
The Azure Storage Type Provider is designed to let you rapidly access your storage assets in Azure from F# without the need to resort to third party tools or the server explorer in Visual Studio.
The provider is designed to be as easy as possible to consume, whilst allowing several benefits over using the standard .NET SDK, such as removing the need for magic strings when access tables / queues / blobs, as well as strengthening the typing of queries over tables.
Connecting to Azure
Connecting to your storage account is simple.
From within a script, first #load "AzureStorageProvider.fsx"
to reference all dependencies.
Then, you can generate a type for a storage account simply by providing your Azure
account credentials via a number of ways.
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: |
|
An example sample.config
file can be found at AzureStorageTypeProvider/docs/content/sample.config
.
Common Themes
The API is split into three areas: Tables, Queues and Containers.
All three share some common themes: -
- Where possible, entities such as queues, tables, containers, folders or blobs are typed based on live queries to the appropriate underlying storage SDK. Thus there's no requirement to enter magic strings for blobs, tables or queues.
1: 2: 3: 4: 5: 6: 7: 8: |
|
- Common methods and functionality are made available directly on the appropriate assets, but there's always access to the raw Azure SDK if you need it to do anything more.
1: 2: 3: 4: 5: 6: 7: 8: 9: |
|
- You can override the connection to the destination asset at runtime. This is useful if not using configuration files so that you can use your local (free) storage emulator for development, and then move to a live account when testing or moving to production etc.. In addition it's also useful for data migration scenarios.
1: 2: 3: 4: 5: |
|