none
F# 3.0 TypeProviders with Azure Marketplace RRS feed

  • Question

  • I am trying to set up an (internal) demo of F# as a scientific computing language.

    I would like to demonstrate TypeProviders with Azure Marketplace (which I think uses OData) to highlight the ease with which external datasets may be accessed.

    The problem is that even getting metadata requires credentials so the odata type provider is not working.

    Azure marketplace samples show the use of NetworkCredentials but I could setting for that on the oData provider.

    Is there a workaround?

    I tried to see if I could extend the OData provider but the documentation is not done yet.

    Friday, September 16, 2011 4:41 PM

Answers

  • I found the problem. 

    I was not using the root URI but had a path after that.

    It seems that up to the root URI no authentication is required but anything after that requires authentication.

    Root URI is sufficient for getting the metadata and hence type creation works, as in the following sample:

     

    [<Generate>]

    type CrimesDB = ODataService<"https://api.datamarket.azure.com/Data.ashx/data.gov/Crimes">

    let db = CrimesDB.GetDataContext()

     

    • Marked as answer by fwaris Friday, September 16, 2011 8:19 PM
    Friday, September 16, 2011 8:19 PM

All replies

  • What datasets are you trying to access? There should be a Credentials property you can set on the constructed value that was based on the type provider instance. That is, something to the tune of: 

     

    [<Generate>]
    type T = Datasets.SomeDataSet
    let db = new T.ServiceTypes.SomeDataSetConstructor()
    db.Credentials <- new NetworkCredential(...)
    
    

     On a related note, when looking for datasets to use via OData consider this distinction: http://msdn.microsoft.com/en-us/library/gg312163.aspx

    Friday, September 16, 2011 7:19 PM
  • I found the problem. 

    I was not using the root URI but had a path after that.

    It seems that up to the root URI no authentication is required but anything after that requires authentication.

    Root URI is sufficient for getting the metadata and hence type creation works, as in the following sample:

     

    [<Generate>]

    type CrimesDB = ODataService<"https://api.datamarket.azure.com/Data.ashx/data.gov/Crimes">

    let db = CrimesDB.GetDataContext()

     

    • Marked as answer by fwaris Friday, September 16, 2011 8:19 PM
    Friday, September 16, 2011 8:19 PM