[英]Umbraco7: Set up multiple /media/ blob containers within the same Azure Storage account
We have multiple Umbraco sites that we need to migrate from an on-premise to Azure web apps. 我们有多个Umbraco网站,我们需要将其从内部部署迁移到Azure Web应用程序。
Each site has its own /media/ folder and as all the images require a big storage space (~2gb) and many read/write operations, we thought of using an Azure Storage Account via Blob containers solution for this. 每个站点都有其自己的/ media /文件夹,并且由于所有映像都需要较大的存储空间(〜2gb)和许多读/写操作,因此我们考虑为此使用通过Blob容器解决方案的Azure存储帐户。
Is it correct to say that using a single Azure Storage Account to serve all the sites' /media folders via Blob containers will cut costs rather than using separate storage accounts for every site? 说使用单个Azure存储帐户通过Blob容器为所有站点的/ media文件夹提供服务会降低成本,而不是为每个站点使用单独的存储帐户是否正确?
We've found the UmbracoFileSystemProviders.Azure package which is great, but can't find any details on how to achieve what's stated in the title of this post. 我们已经找到了很棒的UmbracoFileSystemProviders.Azure软件包,但是找不到有关如何实现本文标题中所述内容的任何详细信息。
Question : How can we set up multiple /media/ blob containers within the same Azure Storage account to serve the images of multiple Umbraco sites? 问题 :如何在同一个Azure存储帐户中设置多个/ media / blob容器来提供多个Umbraco站点的图像?
You can indeed use the one Azure Storage Account; 您确实可以使用一个Azure存储帐户。 just set up different blob containers for each website - they actually don't need to be called "media".
只需为每个网站设置不同的Blob容器-实际上,它们不需要称为“媒体”。 for example, I've set the containerName to
Site1Media
in the following example: 例如,在以下示例中,我将containerName设置为
Site1Media
:
<Provider alias="media" type="Our.Umbraco.FileSystemProviders.Azure.AzureBlobFileSystem, Our.Umbraco.FileSystemProviders.Azure">
<Parameters>
<add key="containerName" value="Site1Media"/>
<add key="rootUrl" value="https://youritteam.blob.core.windows.net/"/>
<add key="connectionString" value="DefaultEndpointsProtocol=https;AccountName=[Account];AccountKey=[Key]"/>
<!--
Optional configuration value determining the maximum number of days to cache items in the browser.
Defaults to 365 days.
-->
<add key="maxDays" value="365"/>
<!--
When true this allows the VirtualPathProvider to use the deafult "media" route prefix regardless
of the container name.
-->
<add key="useDefaultRoute" value="true"/>
<!--
When true blob containers will be private instead of public what means that you can't access the original blob file directly from its blob url.
-->
<add key="usePrivateContainer" value="false"/>
</Parameters>
The other thing about Azure Storage is that you only pay for the data you use; 关于Azure存储的另一件事是,您只需为使用的数据付费; so it's not going to cost you extra to set up multiple Storage Accounts - there's probably very little benefit in having one Storage Account for multiple websites;
因此,设置多个存储帐户不会花费您额外的费用-为多个网站拥有一个存储帐户可能几乎没有好处。 and you may find it much easier later on to have one Storage Account per website - particularly if you want to move the website to another subscription down the track.
而且以后您可能会发现每个网站拥有一个存储帐户会容易得多-特别是如果您想将网站转移到另一订阅中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.