Targeting Azure Storage: Listing 1: Move from Development Storage to Azure Cloud Storage with a Configuration File Change

The ServiceConfiguration file's <ConfigurationSettings> group contains <Setting> elements to determine the location of Azure Storage Services: In a local SQL Server 2005/2008 Express instance (Development Storage) or Azure cloud storage. This example specifies cloud storage because Development Storage settings are commented. (SHA256 AccountSharedKey settings are truncated for brevity.)

<?xml version="1.0"?>
<ServiceConfiguration serviceName="AzureBlobTest" 
    xmlns="http://schemas.microsoft.com/
    ServiceHosting/2008/10/ServiceConfiguration">
  <Role name="Web">
    <Instances count="2" />
    <ConfigurationSettings>
      <!-- <Setting name="AccountName" 
        value="devstoreaccount1"/> 
        Developer Storage Account
      <Setting name="AccountSharedKey" 
        value="Eby8v…dGMGw=="/>
      <Setting name="BlobStorageEndpoint"  
        value="http://127.0.0.1:10000/"/> -->

      <Setting name="AccountName" 
        value="oakleaf2"/>
      <Setting name="AccountSharedKey"  
        value="tUNpa…guRcivpVw==" />
      <Setting name="BlobStorageEndpoint" 
        value="http://blob.core.windows.net" />

      <!-- Custom setting values for cloud WebRole -->
      <Setting name="ContainerName"  
        value="oakleaf2store"/>
      <Setting name="LogContainerName" 
        value="oakleaf2log"/>
    </ConfigurationSettings>
  </Role>
</ServiceConfiguration>
comments powered by Disqus

Featured

Subscribe on YouTube