Skip to content

Commit 0f0f1f6

Browse files
committed
Merge branch 'develop-umbraco-version-8' into master-umbraco-version-8
2 parents 30e430c + 0e95f02 commit 0f0f1f6

File tree

1 file changed

+17
-102
lines changed

1 file changed

+17
-102
lines changed

README.md

Lines changed: 17 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
[![Build status](https://ci.appveyor.com/api/projects/status/mn5hxj5ijurwih7q?svg=true)](https://ci.appveyor.com/project/JamesSouth/umbracofilesystemproviders-azure)
66

7-
An [Azure Blob Storage](http://azure.microsoft.com/en-gb/develop/net/) IFileSystem provider for [Umbraco](https://umbraco.com) 7.1.9+.
7+
An [Azure Blob Storage](http://azure.microsoft.com/en-gb/develop/net/) IFileSystem provider for [Umbraco](https://umbraco.com)
88
Used to offload static files in the media section to the cloud.
99

10-
Designed to supersede [UmbracoAzureBlobStorage](https://github.com/idseefeld/UmbracoAzureBlobStorage) by [Dirk Seefeld](https://twitter.com/dseefeld65) (With his blessing) this package allows the storage and retrieval of media items using Azure Blob Storage while retaining the relative paths to the files expected in the back office.
10+
This package allows the storage and retrieval of media items using Azure Blob Storage while retaining the relative paths to the files expected in the back office.
1111

1212
**v2 requires Umbraco v8.0.1+**
1313

@@ -30,7 +30,7 @@ Both NuGet and Umbraco packages are available. If you use NuGet but would like t
3030

3131
If you prefer, you can compile UmbracoFileSystemProviders.Azure yourself, you'll need:
3232

33-
* Visual Studio 2015 (or above)
33+
* Visual Studio 2017 (or above)
3434

3535
To clone it locally click the "Clone in Windows" button above or run the following git commands.
3636

@@ -42,52 +42,17 @@ cd UmbracoFileSystemProviders.Azure
4242

4343
In the interim code reviews and pull requests would be most welcome!
4444

45-
## Usage
46-
47-
**Note:** Upon release most of configuration this will be automated.
48-
49-
Update `~/Config/FileSystemProviders.config` replacing the default provider with the following:
50-
51-
```xml
52-
<?xml version="1.0"?>
53-
<FileSystemProviders>
54-
<Provider alias="media" type="Our.Umbraco.FileSystemProviders.Azure.AzureBlobFileSystem, Our.Umbraco.FileSystemProviders.Azure">
55-
<Parameters>
56-
<add key="containerName" value="media" />
57-
<add key="rootUrl" value="http://[myAccountName].blob.core.windows.net/" />
58-
<add key="connectionString" value="DefaultEndpointsProtocol=https;AccountName=[myAccountName];AccountKey=[myAccountKey]"/>
59-
<!--
60-
Optional configuration value determining the maximum number of days to cache items in the browser.
61-
Defaults to 365 days.
62-
-->
63-
<add key="maxDays" value="365" />
64-
<!--
65-
When true this allows the VirtualPathProvider to use the default "media" route prefix regardless
66-
of the container name.
67-
-->
68-
<add key="useDefaultRoute" value="true" />
69-
<!--
70-
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.
71-
-->
72-
<add key="usePrivateContainer" value="false" />
73-
</Parameters>
74-
</Provider>
75-
</FileSystemProviders>
76-
```
45+
### Configuration via Web.Config
7746

78-
Developmental mode configuration using the [Azure Storage Emulator](https://azure.microsoft.com/en-us/documentation/articles/storage-use-emulator/) for testing is as follows:
47+
In `Web.config` create the new application keys
7948

8049
```xml
81-
<?xml version="1.0"?>
82-
<FileSystemProviders>
83-
<Provider alias="media" type="Our.Umbraco.FileSystemProviders.Azure.AzureBlobFileSystem, Our.Umbraco.FileSystemProviders.Azure">
84-
<Parameters>
85-
<add key="containerName" value="media" />
86-
<add key="rootUrl" value="http://127.0.0.1:10000/devstoreaccount1/" />
87-
<add key="connectionString" value="UseDevelopmentStorage=true"/>
88-
</Parameters>
89-
</Provider>
90-
</FileSystemProviders>
50+
<add key="AzureBlobFileSystem.ConnectionString:media" value="DefaultEndpointsProtocol=https;AccountName=[myAccountName];AccountKey=[myAccountKey]" />
51+
<add key="AzureBlobFileSystem.ContainerName:media" value="media" />
52+
<add key="AzureBlobFileSystem.RootUrl:media" value="http://[myAccountName].blob.core.windows.net/" />
53+
<add key="AzureBlobFileSystem.MaxDays:media" value="365" />
54+
<add key="AzureBlobFileSystem.UseDefaultRoute:media" value="true" />
55+
<add key="AzureBlobFileSystem.UsePrivateContainer:media" value="false" />
9156
```
9257

9358
Additionally the provider can be further configured with the following application setting in the `web.config`.
@@ -106,39 +71,6 @@ Additionally the provider can be further configured with the following applicati
10671
</configuration>
10772
```
10873

109-
### Configuration via Web.Config
110-
111-
**Available in v0.5.4+**
112-
113-
Optionally instead of having the configuration in `FileSystemProviders.config` it can be moved to `Web.config`
114-
115-
In `FileSystemProviders.config` remove the default parameters and add a new one with the key `alias`, the value should match the provider alias
116-
117-
```xml
118-
<?xml version="1.0"?>
119-
<FileSystemProviders>
120-
121-
<!-- Media -->
122-
<Provider alias="media" type="Our.Umbraco.FileSystemProviders.Azure.AzureBlobFileSystem, Our.Umbraco.FileSystemProviders.Azure">
123-
<Parameters>
124-
<add key="alias" value="media"/>
125-
</Parameters>
126-
</Provider>
127-
128-
</FileSystemProviders>
129-
```
130-
131-
In `Web.config` create the new application keys and post fix each key with the `alias` defined in `FileSystemProviders.config` after a colon.
132-
133-
```xml
134-
<add key="AzureBlobFileSystem.ConnectionString:media" value="DefaultEndpointsProtocol=https;AccountName=[myAccountName];AccountKey=[myAccountKey]" />
135-
<add key="AzureBlobFileSystem.ContainerName:media" value="media" />
136-
<add key="AzureBlobFileSystem.RootUrl:media" value="http://[myAccountName].blob.core.windows.net/" />
137-
<add key="AzureBlobFileSystem.MaxDays:media" value="365" />
138-
<add key="AzureBlobFileSystem.UseDefaultRoute:media" value="true" />
139-
<add key="AzureBlobFileSystem.UsePrivateContainer:media" value="false" />
140-
```
141-
14274
## Virtual Path Provider
14375
By default the plugin will serve files transparently from your domain or serve media directly from Azure. This is made possible by using a custom [Virtual Path Provider](https://msdn.microsoft.com/en-us/library/system.web.hosting.virtualpathprovider%28v=vs.110%29.aspx) included and automatically initialised upon application startup. This can be disable by adding the configuration setting noted above.
14476

@@ -160,7 +92,7 @@ The following configuration is required in your `web.config` to enable static fi
16092
</configuration>
16193
```
16294

163-
For **Umbraco v7.5+ you must add the the StaticFileHandler** to the new Web.config inside the `Media` folder instead of the root one or the VPP will not work!
95+
Also add this configuration to the `web.config` inside the `Media` folder
16496

16597
```xml
16698
<?xml version="1.0" encoding="UTF-8"?>
@@ -177,27 +109,8 @@ For **Umbraco v7.5+ you must add the the StaticFileHandler** to the new Web.conf
177109

178110
## Combining with ImageProcessor
179111

180-
As of ImageProcessor.Web version [4.3.2](https://www.nuget.org/packages/ImageProcessor.Web/4.3.2) a new [`IImageService`](http://imageprocessor.org/imageprocessor-web/extending/#iimageservice) implementation has been available called `CloudImageService`. To enable that service and pull images directly from
181-
the cloud simply install the [configuration package](https://www.nuget.org/packages/ImageProcessor.Web.Config/) and replace the `CloudImageService`setting with the following:
182-
183-
```xml
184-
<?xml version="1.0"?>
185-
<security>
186-
<services>
187-
<service name="LocalFileImageService" type="ImageProcessor.Web.Services.LocalFileImageService, ImageProcessor.Web"/>
188-
<service prefix="media/" name="CloudImageService" type="ImageProcessor.Web.Services.CloudImageService, ImageProcessor.Web">
189-
<settings>
190-
<setting key="MaxBytes" value="8194304"/>
191-
<setting key="Timeout" value="30000"/>
192-
<setting key="Host" value="http://[myAccountName].blob.core.windows.net/media/"/>
193-
</settings>
194-
</service>
195-
</services>
196-
</security>
197-
```
198-
**Note** The `CloudImageService`is not compatible with the FileSystemProvider when using private storage. You will have to build your own `IImageService` implementation.
199-
200-
If using a version of ImageProcessor.Web version [4.5.0](https://www.nuget.org/packages/ImageProcessor.Web/4.5.0) the configuration details will need to be configured as follows:
112+
ImageProcessor.Web contains a [`IImageService`](http://imageprocessor.org/imageprocessor-web/extending/#iimageservice) called `CloudImageService`, to enable that service and pull images directly from
113+
the cloud replace the `CloudImageService`setting with the following:
201114

202115
```xml
203116
<?xml version="1.0"?>
@@ -215,8 +128,10 @@ If using a version of ImageProcessor.Web version [4.5.0](https://www.nuget.org/p
215128
</services>
216129
</security>
217130
```
131+
**Note** The `CloudImageService`is not compatible with the FileSystemProvider when using private storage. You will have to build your own `IImageService` implementation.
132+
218133

219-
Be sure to install the [AzureBlobCache](http://imageprocessor.org/imageprocessor-web/plugins/azure-blob-cache/) plugin to get the most out of the package.
134+
Optionally install the [AzureBlobCache](http://imageprocessor.org/imageprocessor-web/plugins/azure-blob-cache/) plugin to get the most out of the package.
220135

221136
## Authors
222137

0 commit comments

Comments
 (0)