简体   繁体   中英

Azure CloudDrive HTTPS Uri

From this MSDN article it says that the connection string for connecting to the storage account must be HTTP and not HTTPS .

When I use this constructor:

public CloudDrive (
    Uri uri,
    StorageCredentials credentials
)

Does that mean the Uri to the page blob must also be HTTP and not HTTPS? I am a bit confused regarding which parameter ( or both together ) fits the 'connection string' description.

This scenario does not seem to be easily testable in dev emulator.

The URI ( think of as the server-portion of the connection string ) to the page blob represents the namespace + container + blob of your storage account. The credentials represent the user/pass which together with the URI comprise the connection string to the Azure cloud storage service.

The URI will always be HTTP assuming you are using the local emulator.

CloudStorageAccount storageAccount = CloudStorageAccount.DevelopmentStorageAccount;

When deploying to Azure, the URI scheme will be whatever you assign it in the service configuration ( ServiceDefinition.csdef / ServiceConfiguration.Cloud.cscfg ).

CloudStorageAccount storageAccount = CloudStorageAccount.FromConfigurationSetting("CloudDrive.DataConnectionString");

You would just want to assign CloudDrive.DataConnectionString to have DefaultEndpointsProtocol=http ( the default if omitted, but you could be explicit ).

ServiceDefinition.csdef

<ServiceDefinition>
  <WebRole>
    <!-- .... -->
    <ConfigurationSettings>
      <Setting name="CloudDrive.DataConnectionString" />
    </ConfigurationSettings>
  </WebRole>
</ServiceDefinition>

ServiceConfiguration.Cloud.cscfg

<ServiceConfiguration>
  <Role>
    <ConfigurationSettings>
     <Setting name="CloudDrive.DataConnectionString" value="DefaultEndpointsProtocol=http;AccountName=YOURNAMESPACE;AccountKey=YOURKEY" />
    </ConfigurationSettings>
  </Role>
</ServiceConfiguration>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM