开发者

Configuration files location in windows azure

开发者 https://www.devze.com 2023-04-11 01:19 出处:网络
I have an application which I am in the process of migrating to Windows AZURE. I have a question about configuration files storage.

I have an application which I am in the process of migrating to Windows AZURE. I have a question about configuration files storage.

My application has a complex configuration file (XML). The path to the file is in my web.config file. Accessing it in an IIS environment is no problem.

In AZURE, I have the c开发者_运维知识库hoice of transferring all my settings in the app.config file of my worker process (I don't like that), or transfer the configuration settings in my database (in a table with a key/value pairs structure).

Would the AZURE storage be a solution? Could I put my existing configuration file in this space and access it from my worker process?

Any tips and tricks about that?

Thanks Alex


Note that if you have code that processes your existng config file, you can continue using that. You could even put your config file into Azure Blob Storage.

But if you want something more Azurey, sure, Azure Table Storage is possible. I don't know what's in your XML file, so you need to decide the goodness of fit.

Azure Table Storage is a "NoSQL" database that implements a Key/Value datastore. If you are familiar with WCF Data Services, then you already know the programming model (LINQ, Entity Framework).

Azure Table Storage is fairly straightforward to code against - small boilerplate to set up, then pretty low ceremony after that (there is no database schema, such as with a relational database).

Azure Table Storage supports a limited set of data types - but it is typed - so dates, strings, integers, and a few others are first-class citizens (probably a good match for values that might be migrating out of an XML config, as long as the data is not hierarchical).

Julie Lerman's article is a nice starting point to wrap your head around it.

You ask whether you could put your existing configuration file in this space and access it from my worker process - the answer is "yes" - and you could even access it from Azure for applications that were running outside of Azure. (It is just REST interfaces - XML over http - under the hood.)


If it's a file that needs to be accessed by all of your roles and it isn't suitable to store it in the app.config, then storing it in blob storage would be the easiest. All that you would need to change in your code is where you loaded the file from (get a stream from blob storage not the local file system)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号