fsprojects / AzureStorageTypeProvider

An F# Azure Type Provider which can be used to explore Blob, Table and Queue Azure Storage assets and easily apply CRUD operations on them.
http://fsprojects.github.io/AzureStorageTypeProvider/
The Unlicense
84 stars 34 forks source link

Page Blobs are not supported #56

Closed pshrosbree closed 9 years ago

pshrosbree commented 9 years ago

I have a blob container called fsstorage that contains the following blobs:

log log/app000001 log/app000001/2015-01-21 log/app000001/2015-01-21/activity_1421808013040 log/app000001/2015-01-21/crash_1421808013420 ...

The type provider seems to get confused with this structure. I can dot up to:

image

But the next level down I get:

image

I expect to see activity_1421808013040 | crash_1421808013420 | ... | Download in the IntelliSense. Is this a bug?

isaacabraham commented 9 years ago

Looks like it - I'll try to repro tomorrow.

pshrosbree commented 9 years ago

Great. While I am new to F#, I am not new to Azure, and I would be eager to understand what needs to changed to fix this, so that I can get to grips with F# and possibly contribute to this type provider.

isaacabraham commented 9 years ago

The problem is that there's a blob and (virtual) folder with the same name - evidently it's not handling that and looks like mashing them together somehow. Not great! Most of the code is in BlobMemberFactory.fs - this generates the properties recursively (and lazily - the AddMembersDelayed() call only gets executed once the user dots into a property).

Whilst I'd love someone to start contributing to this, you might find a type provider not the best place to start with some F# development - the development experience is a pain to get up and running, and testing is difficult to do. But I'm happy to help you get up and running if you want to have a crack at this!

isaacabraham commented 9 years ago

Maybe I spoke too soon - the problem isn't having a blob and folder with the same name - just tested that out and it works fine.

isaacabraham commented 9 years ago

Are these Page blobs? The Type Provider doesn't support them yet.

pshrosbree commented 9 years ago

Yes. They are page blobs. Sorry, I did not realize they were not supported. Is supporting page blobs a big change?

isaacabraham commented 9 years ago

It shouldn't a massive change. There's a //todo comment somewhere in their that says something like "add page blob support here!" - I don't think it'll be /that/ hard to do, just a bit of thinking about handling the common blob functions e.g. Download etc..

isaacabraham commented 9 years ago

@pshrosbree any chance you can give this a test? I've created the "page-blobs" branch which has the changes in there. I've written some integration tests and tried it out locally, it seems to work. If you download it and run the build.fsx - comment out the "==> "IntegrationTests ==> "GenerateDocs" " stages of the pipeline though (lines 156-157) and then Run the "Package" target, you should end up with a new NuGet package (1.3.0) in your bin folder. Would also be interested in the sort of operations you might run on these blobs.