简体   繁体   English

Azure 存储 CDN 连接字符串

[英]Azure Storage CDN Connection String

I've created an Azure Storage account and can upload and download files using a connection string like below in C#:我已经创建了一个 Azure 存储帐户,并且可以在 C# 中使用如下所示的连接字符串上传和下载文件:

DefaultEndpointsProtocol=https;AccountName=XXX;AccountKey=YYY;EndpointSuffix=core.windows.net

I've added CDN to this account, and I have the endpoint hostname:我已将 CDN 添加到此帐户,并且具有端点主机名:

https://zzz.azureedge.net

How can I modify the connection string so that content is downloaded using the CDN instead of, I guess, directly from the storage account based where-ever I set it up (in my case, the UK)?我如何修改连接字符串,以便使用 CDN 下载内容,而不是直接从基于我设置它的任何地方(在我的情况下,英国)的存储帐户中下载?

I think you need to use a different string for that in a format:我认为您需要在格式中使用不同的字符串:

http://<EndpointName>.azureedge.net/<myPublicContainer>/<BlobName>

(see this for details). (有关详细信息,请参阅)。

Reason for that is that non-read operations must go to your central location and then they get propagated to CDNs according to refresh policy.原因是非读取操作必须转到您的中心位置,然后它们会根据刷新策略传播到 CDN。

You can add a custom url for the various types of storage endpoints.您可以为各种类型的存储端点添加自定义 url。 For example:例如:

DefaultEndpointsProtocol=https;AccountName=XXX;AccountKey=YYY;BlobEndpoint=https://zzz.azureedge.net

You can use this to use a custom domain as well.您也可以使用它来使用自定义域。

More information here .更多信息在这里

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

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