I have a console application which uploads jobs to the workers running in the cloud. The application connects to Azure Storage and uploads some files to blobs and put some messages to queues. Currently, I am using the development storage. I actually want to know at which state my client application connects to the storage. Can I create a queueClient even though I do not have any connection at all? At which step it actually tries to send some network packages? I actually need some kind of a mechanism in order to check the existence of the connection and the validity of the storage account.
Share
The client doesn’t send any messages until you call a command on the storage – e.g. until you try to get or put a property of a blob, container, or queue – e.g. in the sample code below (from http://msdn.microsoft.com/en-us/library/gg651129.aspx) then messages are sent in 3 specific places:
One way to check whether you have connectivity is to use some of the simple functions like
CreateIfNotExist()orGetPermissions()on a known container – these give you a simple quick method to check connectivity. You can also use the BlobRequestOptions to specify a timeout to make sure your app doesn’t hang (http://msdn.microsoft.com/en-us/library/ee772886.aspx)Be careful not to check connectivity too frequently – every 10000 successful checks will cost you $0.01