简体   繁体   English

Azure CloudDrive HTTPS Uri

[英]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 . 这篇MSDN文章中可以看出,用于连接到存储帐户的连接字符串必须是HTTP而不是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? 这是否意味着页面Blob的Uri也必须是HTTP,而不是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. 页面blob的URI (被认为是连接字符串的服务器部分 )表示存储帐户的名称空间+容器+ blob The credentials represent the user/pass which together with the URI comprise the connection string to the Azure cloud storage service. credentials代表用户/通道,它与URI一起构成到Azure云存储服务的连接字符串。

The URI will always be HTTP assuming you are using the local emulator. 假设您正在使用本地仿真器,则URI始终为HTTP。

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 ). 部署到Azure时, URI方案将是您在服务配置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 ). 您只想将CloudDrive.DataConnectionString分配为具有DefaultEndpointsProtocol=http如果省略则为默认值,但可以是显式的 )。

ServiceDefinition.csdef ServiceDefinition.csdef中

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

ServiceConfiguration.Cloud.cscfg ServiceConfiguration.Cloud.cscfg

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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