Microsoft - Utility Rate Service

Description: The Microsoft Utility Rate Service is a database of electric utilities and rates indexed by location within the United States, gathered from Partner Utilities and/or from publically available information. For more information, please goto
type Util = Microsoft.FSharp.Data.TypeProviders.ODataService < ServiceUri = "" >

let MSU() =
let rate = Util.GetDataContext()
//To sign up for a Windows Azure Marketplace account, please go to
rate.Credentials <- NetworkCredential (Utils.ADM_USER_ID, Utils.ADM_ACCOUNT_ID)

query {
for c in rate.UtilityByPostalCodes do
where (c.PostalCode = "98052")
select c
} |> Seq.iter (fun i -> printfn "%A - %A" i.Name i.RateSource)

// sample output
// "Average Price by State (Residential)" - "AreaAverages"
// "Contoso" - "ThirdParty"

Execution Result:
"Average Price by State (Residential)" - "AreaAverages"
"Contoso" - "ThirdParty"

Last edited Mar 1, 2012 at 7:07 PM by ttliu2000, version 3


No comments yet.