You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_Note: you still have to add the provider in the `Startup.cs` file when not configuring the options in code._
53
50
54
-
## Umbraco.StorageProviders.AzureBlob
51
+
### Configuration
52
+
Configure your CDN origin to point to your site and ensure every unique URL is cached (includes the query string), so images can be processed by the site (using ImageSharp) and the response cached by the CDN.
53
+
54
+
By default, the CDN provider removes the media path (`/media`) from the generated media URL, so you need to configure your CDN origin to include this path. This is to prevent caching/proxying other parts of your site, but you can opt-out of this behavior by setting `RemoveMediaFromPath` to `false`.
55
55
56
+
## Umbraco.StorageProviders.AzureBlob
56
57
The Azure Blob Storage provider has an implementation of the Umbraco `IFileSystem` that connects to an Azure Blob Storage container.
57
58
58
59
### Usage
59
-
60
60
This provider can be added in the `Startup.cs` file:
61
-
62
-
```csharp
61
+
```diff
63
62
public void ConfigureServices(IServiceCollection services)
64
63
{
65
64
services.AddUmbraco(_env, _config)
66
65
.AddBackOffice()
67
66
.AddWebsite()
68
67
.AddComposers()
69
-
// Add the Azure Blob Storage file system
70
-
.AddAzureBlobMediaFileSystem()
68
+
+ .AddAzureBlobMediaFileSystem()
71
69
.Build();
72
70
}
73
71
```
74
72
75
-
There are multiple ways to configure the provider. It can be done in code:
76
-
73
+
There are multiple ways to configure the provider. It can be done in code (replacing the code added above):
_Note: you still have to add the provider in the `Startup.cs` file when not configuring the options in code._
109
104
110
105
### Folder structure in the Azure Blob Storage container
111
106
The container name is expected to exist and uses the following folder structure:
112
107
-`/media` - contains the Umbraco media, stored in the structure defined by the `IMediaPathScheme` registered in Umbraco (the default `UniqueMediaPathScheme` stores files with their original filename in 8 character directories, based on the content and property GUID identifier)
113
-
-`/cache` - contains the ImageSharp image cache, stored as files with a filename defined by the `ICacheHash` registered in ImageSharp (the default `CacheHash` generates SHA256 hashes of the file contents and uses the first characters configured by the `Umbraco:CMS:Imaging:CachedNameLength` setting)
108
+
-`/cache` - contains the ImageSharp image cache, stored as files with a filename defined by the `ICacheHash` registered in ImageSharp (the default `CacheHash` generates SHA256 hashes of the file contents and uses the first characters configured by the `Umbraco:CMS:Imaging:CacheHashLength` setting)
114
109
115
110
Note that this is different than the behavior of other file system providers - i.e. https://github.com/umbraco-community/UmbracoFileSystemProviders.Azure that expect the media contents to be at the root level.
116
111
117
112
## Using the file system providers
118
-
119
113
Please refer to our documentation on [using custom file systems](https://our.umbraco.com/documentation/Extending/FileSystemProviders/).
120
114
121
115
## Bugs, issues and Pull Requests
122
-
123
116
If you encounter a bug when using this client library you are welcome to open an issue in the issue tracker of this repository. We always welcome Pull Request and please feel free to open an issue before submitting a Pull Request to discuss what you want to submit.
124
117
125
118
Questions about usage should be posted to the forum on [our.umbraco.com](https://our.umbraco.com).
126
119
127
120
## License
128
-
129
121
Umbraco Storage Providers is [MIT licensed](LICENSE).
0 commit comments