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

Add possibility to take connection string from configuration file #62

Closed wastaz closed 8 years ago

wastaz commented 8 years ago

I was using this package the other day with the storage emulator when I was developing on my local computer. When I deployed it to azure however the build failed because the build server was not running the storage emulator and thus no types could be provided.

So I thought that it would probably be nice to have the ability to take the connectionstring from app.config/web.config instead of having to have it as a hardcoded literal in the code.

I ported some code from FSharp.Data.SqlClient for doing this.

isaacabraham commented 8 years ago

Excellent! This will fix #31. Let me test tonight and merge in. Thus far we've had to resort to having a separate .fs file and reference that.

isaacabraham commented 8 years ago

Quick question - have you tested this out locally? I'm trying this out, and whilst my script doesn't show any errors, when I actually do an alt + enter on it I get the error: -

TypeProvider.fsx(12,14): error FS3033: The type provider 'ProviderImplementation.AzureTypeProvider' reported an error: Could not find config file 'C:\Users\Isaac\Source\Repos\azurestoragetpdemo\packages\FSharp.Azure.StorageTypeProvider\app.config'.

wastaz commented 8 years ago

Yea, though to be honest I only tested it with compiled applications - not with scripts. Feels a bit weird to use it with scripts though? I'm unsure how scripts and application config works in general.

isaacabraham commented 8 years ago

OK - config files are difficult to work with scripts, so maybe that's also something that other TPs suffer from as well.

isaacabraham commented 8 years ago

Tested, all working now - code is slightly refactored along the way whilst I was trying to debug but essentially all works - cheers.