Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Storage Type Provider: FS0039 on build but intellisense shows type as available

I am trying to access a type from our Azure Storage account using the Azure Storage Type Provider:

type AzAcc = AzureTypeProvider<"{our ac name}","{our key}">
type clientEntity = AzAcc.Domain.FeedLabClientsEntity

I get intellisense for the FeedLabClientsEntity type and can proceed without the Visual Studio 'red squiggly' but on build the second line above throws the error

error FS0039: The type 'FeedLabClientsEntity' is not defined

How can I access this type?

like image 814
Stewart_R Avatar asked Oct 31 '22 03:10

Stewart_R


1 Answers

Basically this is a "feature" of the TP. Unlike most other TPs which eagerly evaluate schema and generate the type system up front, the Azure TP generates types on demand, so only once you navigate through blobs or tables do those types appear accessible. It most mostly due to save on potential IO - if you point to a real Azure account, theoretically you could have an infinite number of tables and blobs.

You can work around this by first trying to access the appropriate table using e.g. GetPartition.

like image 188
Isaac Abraham Avatar answered Nov 11 '22 16:11

Isaac Abraham