How to get a list of StorageAccount objects

Topics: Autoscaling Application Block ("Wasabi")
Apr 5, 2013 at 9:01 PM
Sorry, I mistakenly posted this over in the Issue Tracker forum, but it really belongs here...

I am trying to create a custom rule parameter that monitors a value in an Azure table. I have it all coded, but it seems that when you create the IDataPointsCollector object the only information you get about the context is an IServiceInformationStore object. It looks to me like there's no way, given an IServiceInformationStore, to access the list of all the StorageAccounts defined in said Service Information Store. Is there any direct way for me to get at this information? Right now my custom parameter has a "accountFromQueue" attribute that specifies a Queue alias. Then I use sis.GetQueue(queueAlias).StorageAccount to retrieve the storage account. It is extremely inelegant.

Another option would be to specify the connection string instead of trying to get at the Storage Account as defined in the ServiceInformationStore, but if I do that it makes change management trickier, I think.
Apr 7, 2013 at 7:11 AM
The two approaches that you mention are what sprang to mind for me. I also don't see a way to directly access the information.

Another approach that can be used (but might not be applicable here) is to add dependencies to the EnterpriseLibraryContainer (e.g. UnityContainer) at startup and then use the EnterpriseLibraryContainer to retrieve those dependencies and use them when instantiating the IDataPointsCollector.

Randy Levy
Enterprise Library support engineer
Support How-to