Skip to content

Instantly share code, notes, and snippets.

@isaacabraham
Last active December 25, 2015 13:19
Show Gist options
  • Save isaacabraham/6982420 to your computer and use it in GitHub Desktop.
Save isaacabraham/6982420 to your computer and use it in GitHub Desktop.
Azure Type Provider Sample #1 - illustrates how to use the basic features of it.
type account = Elastacloud.FSharp.AzureTypeProvider.AzureAccount< "accountName","accountKey" >
// Downloads LeagueTable.csv as an Async<string>
let textAsyncWorkflow = async {
let! text = account.Containers.container1.``LeagueTable.csv``.Download()
printfn "%s" (text.ToLower())
return text
}
// Downloads binary.zip as an Async<Byte[]>
let binaryAsyncWorkflow = async {
let! binaryArray = account.Containers.container1.``binary.zip``.Download()
printfn "%d bytes downloaded" binaryArray.Length
return binaryArray
}
// Asynchronously downloads LeagueTable.csv to a file locally
account.Containers.container1.``LeagueTable.csv``.DownloadToFile(@"D:\LeagueTable.csv")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment