Last active
December 25, 2015 13:19
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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