From aed3b77b4afe6981b736061a74f9592d92b49201 Mon Sep 17 00:00:00 2001 From: Chad Currie Date: Sat, 9 Jan 2021 18:33:06 +1300 Subject: [PATCH 01/15] Updated to SDK V12. Tests pass. SAS token support not implemented --- .../InstallerController.cs | 16 +- ...FileSystemProviders.Azure.Installer.csproj | 42 ++- .../app.config | 24 ++ .../packages.config | 15 +- ...racoFileSystemProviders.Azure.Tests.csproj | 42 ++- .../app.config | 24 ++ .../packages.config | 15 +- .../AzureBlobDirectory.cs | 34 ++ .../AzureFileSystem.cs | 330 +++++++++--------- .../UmbracoFileSystemProviders.Azure.csproj | 43 ++- .../app.config | 24 ++ .../packages.config | 15 +- 12 files changed, 422 insertions(+), 202 deletions(-) create mode 100644 src/UmbracoFileSystemProviders.Azure/AzureBlobDirectory.cs diff --git a/src/UmbracoFileSystemProviders.Azure.Installer/InstallerController.cs b/src/UmbracoFileSystemProviders.Azure.Installer/InstallerController.cs index 616bb9f..13c14d5 100644 --- a/src/UmbracoFileSystemProviders.Azure.Installer/InstallerController.cs +++ b/src/UmbracoFileSystemProviders.Azure.Installer/InstallerController.cs @@ -15,9 +15,6 @@ namespace Our.Umbraco.FileSystemProviders.Azure.Installer using System.Web.Http; using System.Xml; - using Microsoft.Azure.Storage; - using Microsoft.Azure.Storage.Blob; - using global::Umbraco.Core; using global::Umbraco.Core.Composing; using global::Umbraco.Core.Logging; @@ -27,6 +24,8 @@ namespace Our.Umbraco.FileSystemProviders.Azure.Installer using Enums; using Models; + using global::Azure.Storage.Blobs; + using global::Azure.Storage.Blobs.Models; /// /// The installer controller for managing installer logic. @@ -84,7 +83,7 @@ public InstallerStatus PostParameters(IEnumerable parameters) bool usePrivateContainer = bool.Parse(newParameters.SingleOrDefault(k => k.Key == "UsePrivateContainer").Value); string rootUrl = newParameters.SingleOrDefault(k => k.Key == "RootUrl").Value; - BlobContainerPublicAccessType blobContainerPublicAccessType = usePrivateContainer ? BlobContainerPublicAccessType.Off : BlobContainerPublicAccessType.Blob; + var blobContainerPublicAccessType = usePrivateContainer ? PublicAccessType.None : PublicAccessType.Blob; if (!TestAzureCredentials(connection, containerName, blobContainerPublicAccessType)) { @@ -445,19 +444,18 @@ private static bool ExecuteImageProcessorSecurityConfigTransform() return true; } - private static bool TestAzureCredentials(string connectionString, string containerName, BlobContainerPublicAccessType accessType) + private static bool TestAzureCredentials(string connectionString, string containerName, PublicAccessType accessType) { bool useEmulator = ConfigurationManager.AppSettings[Azure.Constants.Configuration.UseStorageEmulatorKey] != null && ConfigurationManager.AppSettings[Azure.Constants.Configuration.UseStorageEmulatorKey] .Equals("true", StringComparison.InvariantCultureIgnoreCase); try { - CloudStorageAccount cloudStorageAccount = useEmulator ? CloudStorageAccount.DevelopmentStorageAccount : CloudStorageAccount.Parse(connectionString); - - CloudBlobClient cloudBlobClient = cloudStorageAccount.CreateCloudBlobClient(); + var cloudStorageAccount = connectionString; // This should fully check that the connection works. - var testContainer = AzureFileSystem.CreateContainer(cloudBlobClient, containerName, accessType); + var azf = AzureFileSystem.GetInstance(containerName, "", connectionString, "", "", ""); + var testContainer = azf.CreateContainer( containerName, accessType); if (testContainer.Exists()) { diff --git a/src/UmbracoFileSystemProviders.Azure.Installer/UmbracoFileSystemProviders.Azure.Installer.csproj b/src/UmbracoFileSystemProviders.Azure.Installer/UmbracoFileSystemProviders.Azure.Installer.csproj index 245a3bd..8bf33d5 100644 --- a/src/UmbracoFileSystemProviders.Azure.Installer/UmbracoFileSystemProviders.Azure.Installer.csproj +++ b/src/UmbracoFileSystemProviders.Azure.Installer/UmbracoFileSystemProviders.Azure.Installer.csproj @@ -57,6 +57,15 @@ ..\packages\AutoMapper.8.0.0\lib\net461\AutoMapper.dll + + ..\packages\Azure.Core.1.6.0\lib\net461\Azure.Core.dll + + + ..\packages\Azure.Storage.Blobs.12.7.0\lib\netstandard2.0\Azure.Storage.Blobs.dll + + + ..\packages\Azure.Storage.Common.12.6.0\lib\netstandard2.0\Azure.Storage.Common.dll + ..\packages\ClientDependency.1.9.7\lib\net45\ClientDependency.Core.dll @@ -123,11 +132,8 @@ ..\packages\Microsoft.Azure.KeyVault.Core.3.0.3\lib\net452\Microsoft.Azure.KeyVault.Core.dll - - ..\packages\Microsoft.Azure.Storage.Blob.11.1.2\lib\net452\Microsoft.Azure.Storage.Blob.dll - - - ..\packages\Microsoft.Azure.Storage.Common.11.1.2\lib\net452\Microsoft.Azure.Storage.Common.dll + + ..\packages\Microsoft.Bcl.AsyncInterfaces.1.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll ..\packages\Microsoft.Data.Edm.5.8.4\lib\net40\Microsoft.Data.Edm.dll @@ -219,6 +225,9 @@ ..\packages\Superpower.2.0.0\lib\net45\Superpower.dll + + ..\packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll + @@ -231,29 +240,48 @@ ..\packages\Umbraco.SqlServerCE.4.0.0.1\lib\net472\System.Data.SqlServerCe.Entity.dll - - ..\packages\System.Diagnostics.DiagnosticSource.4.4.1\lib\net46\System.Diagnostics.DiagnosticSource.dll + + ..\packages\System.Diagnostics.DiagnosticSource.4.6.0\lib\net46\System.Diagnostics.DiagnosticSource.dll + + ..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll + + + ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + ..\packages\System.Spatial.5.8.4\lib\net40\System.Spatial.dll + + ..\packages\System.Text.Encodings.Web.4.6.0\lib\netstandard2.0\System.Text.Encodings.Web.dll + + + ..\packages\System.Text.Json.4.6.0\lib\net461\System.Text.Json.dll + ..\packages\System.Threading.Tasks.Dataflow.4.9.0\lib\netstandard2.0\System.Threading.Tasks.Dataflow.dll + + ..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll + ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll diff --git a/src/UmbracoFileSystemProviders.Azure.Installer/app.config b/src/UmbracoFileSystemProviders.Azure.Installer/app.config index 4c68c1f..48e4869 100644 --- a/src/UmbracoFileSystemProviders.Azure.Installer/app.config +++ b/src/UmbracoFileSystemProviders.Azure.Installer/app.config @@ -70,6 +70,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/UmbracoFileSystemProviders.Azure.Installer/packages.config b/src/UmbracoFileSystemProviders.Azure.Installer/packages.config index 4d1159e..810846f 100644 --- a/src/UmbracoFileSystemProviders.Azure.Installer/packages.config +++ b/src/UmbracoFileSystemProviders.Azure.Installer/packages.config @@ -1,6 +1,9 @@  + + + @@ -30,8 +33,7 @@ - - + @@ -64,13 +66,20 @@ + - + + + + + + + diff --git a/src/UmbracoFileSystemProviders.Azure.Tests/UmbracoFileSystemProviders.Azure.Tests.csproj b/src/UmbracoFileSystemProviders.Azure.Tests/UmbracoFileSystemProviders.Azure.Tests.csproj index a249ff2..4c011dc 100644 --- a/src/UmbracoFileSystemProviders.Azure.Tests/UmbracoFileSystemProviders.Azure.Tests.csproj +++ b/src/UmbracoFileSystemProviders.Azure.Tests/UmbracoFileSystemProviders.Azure.Tests.csproj @@ -59,6 +59,15 @@ ..\packages\AutoMapper.8.0.0\lib\net461\AutoMapper.dll + + ..\packages\Azure.Core.1.6.0\lib\net461\Azure.Core.dll + + + ..\packages\Azure.Storage.Blobs.12.7.0\lib\netstandard2.0\Azure.Storage.Blobs.dll + + + ..\packages\Azure.Storage.Common.12.6.0\lib\netstandard2.0\Azure.Storage.Common.dll + ..\packages\ClientDependency.1.9.7\lib\net45\ClientDependency.Core.dll @@ -123,11 +132,8 @@ ..\packages\Microsoft.Azure.KeyVault.Core.3.0.3\lib\net452\Microsoft.Azure.KeyVault.Core.dll - - ..\packages\Microsoft.Azure.Storage.Blob.11.1.2\lib\net452\Microsoft.Azure.Storage.Blob.dll - - - ..\packages\Microsoft.Azure.Storage.Common.11.1.2\lib\net452\Microsoft.Azure.Storage.Common.dll + + ..\packages\Microsoft.Bcl.AsyncInterfaces.1.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll ..\packages\Microsoft.Data.Edm.5.8.4\lib\net40\Microsoft.Data.Edm.dll @@ -221,6 +227,9 @@ ..\packages\Superpower.2.0.0\lib\net45\Superpower.dll + + ..\packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll + @@ -233,30 +242,49 @@ ..\packages\Umbraco.SqlServerCE.4.0.0.1\lib\net472\System.Data.SqlServerCe.Entity.dll - - ..\packages\System.Diagnostics.DiagnosticSource.4.4.1\lib\net46\System.Diagnostics.DiagnosticSource.dll + + ..\packages\System.Diagnostics.DiagnosticSource.4.6.0\lib\net46\System.Diagnostics.DiagnosticSource.dll + + ..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll + + + ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + ..\packages\System.Spatial.5.8.4\lib\net40\System.Spatial.dll + + ..\packages\System.Text.Encodings.Web.4.6.0\lib\netstandard2.0\System.Text.Encodings.Web.dll + + + ..\packages\System.Text.Json.4.6.0\lib\net461\System.Text.Json.dll + ..\packages\System.Threading.Tasks.Dataflow.4.9.0\lib\netstandard2.0\System.Threading.Tasks.Dataflow.dll + + ..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll + ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll diff --git a/src/UmbracoFileSystemProviders.Azure.Tests/app.config b/src/UmbracoFileSystemProviders.Azure.Tests/app.config index a4eb9a8..7b73006 100644 --- a/src/UmbracoFileSystemProviders.Azure.Tests/app.config +++ b/src/UmbracoFileSystemProviders.Azure.Tests/app.config @@ -102,6 +102,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/UmbracoFileSystemProviders.Azure.Tests/packages.config b/src/UmbracoFileSystemProviders.Azure.Tests/packages.config index 40f1f98..56cb841 100644 --- a/src/UmbracoFileSystemProviders.Azure.Tests/packages.config +++ b/src/UmbracoFileSystemProviders.Azure.Tests/packages.config @@ -1,6 +1,9 @@  + + + @@ -29,8 +32,7 @@ - - + @@ -65,13 +67,20 @@ + - + + + + + + + diff --git a/src/UmbracoFileSystemProviders.Azure/AzureBlobDirectory.cs b/src/UmbracoFileSystemProviders.Azure/AzureBlobDirectory.cs new file mode 100644 index 0000000..4b86639 --- /dev/null +++ b/src/UmbracoFileSystemProviders.Azure/AzureBlobDirectory.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Azure; +using Azure.Storage.Blobs; +using Azure.Storage.Blobs.Models; + +namespace Our.Umbraco.FileSystemProviders.Azure +{ + internal class AzureBlobDirectory + { + public BlobContainerClient Container { get; } + + public AzureBlobDirectory(BlobContainerClient container, string path) + { + this.Container = container; + this.Prefix = path; + } + + public string Prefix { get; } + + public Pageable ListBlobs() + { + if (string.IsNullOrEmpty(Prefix)) + { + return Container.GetBlobsByHierarchy(); + } + return Container.GetBlobsByHierarchy(prefix: Prefix); + } + + } +} diff --git a/src/UmbracoFileSystemProviders.Azure/AzureFileSystem.cs b/src/UmbracoFileSystemProviders.Azure/AzureFileSystem.cs index b5e2248..c8c48f4 100644 --- a/src/UmbracoFileSystemProviders.Azure/AzureFileSystem.cs +++ b/src/UmbracoFileSystemProviders.Azure/AzureFileSystem.cs @@ -16,13 +16,13 @@ namespace Our.Umbraco.FileSystemProviders.Azure using System.Linq; using System.Text.RegularExpressions; using System.Web; + using global::Azure; + using global::Azure.Storage.Blobs; + using global::Azure.Storage.Blobs.Models; using global::Umbraco.Core.Composing; using global::Umbraco.Core.Configuration; using global::Umbraco.Core.IO; using global::Umbraco.Core.Logging; - using Microsoft.Azure.Storage; - using Microsoft.Azure.Storage.Blob; - using Microsoft.Azure.Storage.Blob.Protocol; /// /// A class for communicating with Azure Blob Storage. @@ -72,7 +72,7 @@ public class AzureFileSystem : IFileSystem /// /// The cloud media blob container. /// - private readonly CloudBlobContainer cloudBlobContainer; + private readonly BlobContainerClient cloudBlobContainer; /// /// Initializes a new instance of the class. @@ -89,7 +89,7 @@ public class AzureFileSystem : IFileSystem /// /// Thrown if is invalid. /// - internal AzureFileSystem(string containerName, string rootUrl, string connectionString, int maxDays, bool useDefaultRoute, BlobContainerPublicAccessType accessType) + internal AzureFileSystem(string containerName, string rootUrl, string connectionString, int maxDays, bool useDefaultRoute, PublicAccessType accessType) { if (string.IsNullOrWhiteSpace(containerName)) { @@ -104,64 +104,19 @@ internal AzureFileSystem(string containerName, string rootUrl, string connection && ConfigurationManager.AppSettings[UseStorageEmulatorKey] .Equals("true", StringComparison.InvariantCultureIgnoreCase); - CloudStorageAccount cloudStorageAccount; if (useEmulator) { - cloudStorageAccount = CloudStorageAccount.DevelopmentStorageAccount; - rootUrl = cloudStorageAccount.BlobStorageUri.PrimaryUri.AbsoluteUri; + _connectionString = "UseDevelopmentStorage=true"; + rootUrl = "http://127.0.0.1:10000/devstoreaccount1/"; } else { - cloudStorageAccount = CloudStorageAccount.Parse(connectionString); + _connectionString = connectionString; } - CloudBlobClient cloudBlobClient = cloudStorageAccount.CreateCloudBlobClient(); - this.cloudBlobContainer = CreateContainer(cloudBlobClient, containerName, accessType); - if (cloudStorageAccount.Credentials.IsSAS) - { - bool isValidSas = true; - var sasTokenParts = cloudStorageAccount.Credentials.SASToken.Split('&'); - var si = sasTokenParts.Where(t => t.StartsWith("si=")).FirstOrDefault(); - if (si != null) - { - var siValue = si.Split('=')[1]; + - // I could not find a way how to get the permissions of a referenced access policy - // var permissions = this.cloudBlobContainer.GetPermissions(AccessCondition.GenerateIfExistsCondition()); - } - else - { - var sr = sasTokenParts.Where(t => t.StartsWith("sr=")).FirstOrDefault(); - var ss = sasTokenParts.Where(t => t.StartsWith("ss=")).FirstOrDefault(); - var srt = sasTokenParts.Where(t => t.StartsWith("srt=")).FirstOrDefault(); - var sp = sasTokenParts.Where(t => t.StartsWith("sp=")).FirstOrDefault(); - if ((ss == null || !ss.Contains("b")) && (sr == null || !sr.Contains("c"))) - { - isValidSas = false; - } - else if (sp != null) - { - var value = sp.Split('=')[1].ToCharArray(); - if (!value.Contains('r') || !value.Contains('w') || !value.Contains('d') || !value.Contains('l')) - { - isValidSas = false; - } - else if (srt != null) - { - value = srt.Split('=')[1].ToCharArray(); - if (!value.Contains('s') || !value.Contains('c') || !value.Contains('o')) - { - isValidSas = false; - } - } - } - } - - if (!isValidSas) - { - throw new Exception("SAS token permissions do NOT grant full functionality for UmbracoFileSystemProviders.Azure."); - } - } + this.cloudBlobContainer = CreateContainer(containerName, accessType); // First assign a local copy before editing. We use that to track the type. // TODO: Do we need this? The container should be an identifer. @@ -180,6 +135,53 @@ internal AzureFileSystem(string containerName, string rootUrl, string connection this.MimeTypeResolver = new MimeTypeResolver(); } + private static void ValidateSasToken(string cloudStorageAccount) + { + throw new NotImplementedException(); + //bool isValidSas = true; + //var sasTokenParts = cloudStorageAccount.Credentials.SASToken.Split('&'); + //var si = sasTokenParts.Where(t => t.StartsWith("si=")).FirstOrDefault(); + //if (si != null) + //{ + // var siValue = si.Split('=')[1]; + + // // I could not find a way how to get the permissions of a referenced access policy + // // var permissions = this.cloudBlobContainer.GetPermissions(AccessCondition.GenerateIfExistsCondition()); + //} + //else + //{ + // var sr = sasTokenParts.Where(t => t.StartsWith("sr=")).FirstOrDefault(); + // var ss = sasTokenParts.Where(t => t.StartsWith("ss=")).FirstOrDefault(); + // var srt = sasTokenParts.Where(t => t.StartsWith("srt=")).FirstOrDefault(); + // var sp = sasTokenParts.Where(t => t.StartsWith("sp=")).FirstOrDefault(); + // if ((ss == null || !ss.Contains("b")) && (sr == null || !sr.Contains("c"))) + // { + // isValidSas = false; + // } + // else if (sp != null) + // { + // var value = sp.Split('=')[1].ToCharArray(); + // if (!value.Contains('r') || !value.Contains('w') || !value.Contains('d') || !value.Contains('l')) + // { + // isValidSas = false; + // } + // else if (srt != null) + // { + // value = srt.Split('=')[1].ToCharArray(); + // if (!value.Contains('s') || !value.Contains('c') || !value.Contains('o')) + // { + // isValidSas = false; + // } + // } + // } + //} + + //if (!isValidSas) + //{ + // throw new Exception("SAS token permissions do NOT grant full functionality for UmbracoFileSystemProviders.Azure."); + //} + } + /// /// Gets or sets the MIME type resolver. /// @@ -246,7 +248,7 @@ public static AzureFileSystem GetInstance(string containerName, string rootUrl, privateContainer = true; } - BlobContainerPublicAccessType blobContainerPublicAccessType = privateContainer ? BlobContainerPublicAccessType.Off : BlobContainerPublicAccessType.Blob; + PublicAccessType blobContainerPublicAccessType = privateContainer ? PublicAccessType.None : PublicAccessType.Blob; fileSystem = new AzureFileSystem(containerName, rootUrl, connectionString, max, defaultRoute, blobContainerPublicAccessType); FileSystems.Add(fileSystem); @@ -266,7 +268,7 @@ public void AddFile(string path, Stream stream, bool overrideIfExists) { Current.Logger.Debug($"AddFile(path, steam, overrideIfExists) method executed with path:{path}"); - CloudBlockBlob blockBlob = this.GetBlockBlobReference(path); + BlobClient blockBlob = this.GetBlockBlobReference(path); if (blockBlob != null) { @@ -282,45 +284,43 @@ public void AddFile(string path, Stream stream, bool overrideIfExists) try { + BlobProperties properties = null; if (exists) { // Ensure original created date is preserved. - blockBlob.FetchAttributes(); - if (blockBlob.Metadata.ContainsKey("CreatedDate")) + properties = blockBlob.GetProperties().Value; + if (properties.Metadata.ContainsKey("CreatedDate")) { // We store the creation date in meta data. - created = DateTime.Parse(blockBlob.Metadata["CreatedDate"], CultureInfo.InvariantCulture).ToUniversalTime(); + created = DateTime.Parse(properties.Metadata["CreatedDate"], CultureInfo.InvariantCulture).ToUniversalTime(); } } - blockBlob.UploadFromStream(stream); + blockBlob.Upload(stream,overrideIfExists); string contentType = this.MimeTypeResolver.Resolve(path); + properties = blockBlob.GetProperties().Value; + var updatedHeaders = new BlobHttpHeaders(); if (!string.IsNullOrWhiteSpace(contentType)) { - blockBlob.Properties.ContentType = contentType; + updatedHeaders.ContentType = contentType; } - blockBlob.Properties.CacheControl = $"public, max-age={this.MaxDays * 86400}"; - blockBlob.SetProperties(); + updatedHeaders.CacheControl = $"public, max-age={this.MaxDays * 86400}"; + + blockBlob.SetHttpHeaders(updatedHeaders); if (created == DateTimeOffset.MinValue) { created = DateTimeOffset.UtcNow; } + var updatedProps = new Dictionary(); // Store the creation date in meta data. - if (blockBlob.Metadata.ContainsKey("CreatedDate")) - { - blockBlob.Metadata["CreatedDate"] = created.ToString(CultureInfo.InvariantCulture); - } - else - { - blockBlob.Metadata.Add("CreatedDate", created.ToString(CultureInfo.InvariantCulture)); - } + updatedProps.Add("CreatedDate",created.ToString(CultureInfo.InvariantCulture)); - blockBlob.SetMetadata(); + blockBlob.SetMetadata(updatedProps); } catch (Exception ex) { @@ -369,21 +369,22 @@ public void DeleteDirectory(string path, bool recursive) return; } - CloudBlobDirectory directory = this.GetDirectoryReference(path); + var directory = this.GetDirectoryReference(path); // WB: This will only delete a folder if it only has files & not sub directories - // IEnumerable blobs = directory.ListBlobs().OfType(); - IEnumerable blobs = directory.ListBlobs(); + // IEnumerable blobs = directory.ListBlobs().OfType(); + var blobs = directory.ListBlobs(); if (recursive) { - foreach (IListBlobItem blobItem in blobs) + foreach (var blobItem in blobs) { try { - if (blobItem is CloudBlobDirectory) + + if (blobItem.IsPrefix) { - CloudBlobDirectory blobFolder = blobItem as CloudBlobDirectory; + var blobFolder = new AzureBlobDirectory(directory.Container, blobItem.Prefix); // Resursively call this method this.DeleteDirectory(blobFolder.Prefix); @@ -391,7 +392,7 @@ public void DeleteDirectory(string path, bool recursive) else { // Can assume its a file aka CloudBlob - CloudBlockBlob blobFile = blobItem as CloudBlockBlob; + var blobFile = GetBlockBlobReference(blobItem.Blob.Name); blobFile?.DeleteIfExists(DeleteSnapshotsOption.IncludeSnapshots); } } @@ -428,7 +429,7 @@ public void DeleteFile(string path) { Current.Logger.Debug($"DeleteFile(path) method executed with path:{path}"); - CloudBlockBlob blockBlob = this.GetBlockBlobReference(path); + var blockBlob = this.GetBlockBlobReference(path); if (blockBlob != null) { @@ -455,7 +456,7 @@ public bool DirectoryExists(string path) Current.Logger.Debug($"DirectoryExists(path) method executed with path:{path}"); string fixedPath = this.FixPath(path); - CloudBlobDirectory directory = this.cloudBlobContainer.GetDirectoryReference(fixedPath); + var directory = new AzureBlobDirectory(cloudBlobContainer,fixedPath); return directory.ListBlobs().Any(); } @@ -471,7 +472,7 @@ public bool FileExists(string path) { Current.Logger.Debug($"FileExists(path) method executed with path:{path}"); - CloudBlockBlob blockBlobReference = this.GetBlockBlobReference(path); + var blockBlobReference = this.GetBlockBlobReference(path); return blockBlobReference?.Exists() ?? false; } @@ -486,16 +487,16 @@ public DateTimeOffset GetCreated(string path) { Current.Logger.Debug($"GetCreated(path) method executed with path:{path}"); - CloudBlockBlob blockBlob = this.GetBlockBlobReference(path); + var blockBlob = this.GetBlockBlobReference(path); if (blockBlob != null) { // Populate the blob's attributes. - blockBlob.FetchAttributes(); - if (blockBlob.Metadata.ContainsKey("CreatedDate")) + var properties = blockBlob.GetProperties().Value; + if (properties.Metadata.ContainsKey("CreatedDate")) { // We store the creation date in meta data. - return DateTimeOffset.Parse(blockBlob.Metadata["CreatedDate"], CultureInfo.InvariantCulture).ToUniversalTime(); + return DateTimeOffset.Parse(properties.Metadata["CreatedDate"], CultureInfo.InvariantCulture).ToUniversalTime(); } } @@ -513,12 +514,16 @@ public IEnumerable GetDirectories(string path) { Current.Logger.Debug($"GetDirectories(path) method executed with path:{path}"); - CloudBlobDirectory directory = this.GetDirectoryReference(path); + var directory = this.GetDirectoryReference(path); + + var listedBlobs = directory.ListBlobs(); + var prefixes = listedBlobs.Where(blob => blob.IsPrefix).Select(x=>x.Prefix).ToList(); + var blobPrefixes = listedBlobs.Where(x => x.IsBlob && x.Blob.Name.LastIndexOf('/') >= 0).Select(x => x.Blob.Name.Substring(0, x.Blob.Name.LastIndexOf('/') + 1)); - IEnumerable blobs = directory.ListBlobs().Where(blob => blob is CloudBlobDirectory).ToList(); // Always get last segment for media sub folder simulation. E.g 1001, 1002 - return blobs.Cast().Select(cd => cd.Prefix.TrimEnd('/')); + var all = prefixes.Union(blobPrefixes); + return all.Select(cd => cd.TrimEnd('/')); } /// @@ -533,9 +538,9 @@ public IEnumerable GetFiles(string path, string filter) { Current.Logger.Debug($"GetFiles(path, filter) method executed with path:{path} & filter {filter}"); - IEnumerable blobs = this.cloudBlobContainer.ListBlobs(this.FixPath(path), true); + IEnumerable blobs = this.cloudBlobContainer.GetBlobsByHierarchy(prefix:this.FixPath(path)); - var blobList = blobs as IList ?? blobs.ToList(); + var blobList = blobs as IList ?? blobs.ToList(); if (!blobList.Any()) { @@ -544,9 +549,9 @@ public IEnumerable GetFiles(string path, string filter) return Enumerable.Empty(); } - return blobList.OfType().Select(cd => + return blobList.Where(x=>x.IsBlob).Select(cd => { - string url = cd.Uri.AbsoluteUri; + string url = cloudBlobContainer.Uri.AbsoluteUri + "/" + cd.Blob.Name; if (filter.Equals("*.*", StringComparison.InvariantCultureIgnoreCase)) { @@ -603,12 +608,12 @@ public DateTimeOffset GetLastModified(string path) { Current.Logger.Debug($"GetLastModified(path) method executed with path:{path}"); - CloudBlockBlob blockBlob = this.GetBlockBlobReference(path); + var blockBlob = this.GetBlockBlobReference(path); if (blockBlob != null) { - blockBlob.FetchAttributes(); - return blockBlob.Properties.LastModified.GetValueOrDefault(); + var properties = blockBlob.GetProperties().Value; + return properties.LastModified; } return DateTimeOffset.MinValue; @@ -653,11 +658,12 @@ public long GetSize(string path) { Current.Logger.Debug($"GetSize(path) method executed with path:{path}"); - CloudBlockBlob blockBlob = this.GetBlockBlobReference(path); + var blockBlob = this.GetBlockBlobReference(path); if (blockBlob != null) { - return blockBlob.Properties.Length; + var properties = blockBlob.GetProperties().Value; + return properties.ContentLength; } return long.MinValue; @@ -674,7 +680,7 @@ public Stream OpenFile(string path) { Current.Logger.Debug($"OpenFile(path) method executed with path:{path}"); - CloudBlockBlob blockBlob = this.GetBlockBlobReference(path); + var blockBlob = this.GetBlockBlobReference(path); if (blockBlob != null) { @@ -685,7 +691,7 @@ public Stream OpenFile(string path) } MemoryStream stream = new MemoryStream(); - blockBlob.DownloadToStream(stream); + blockBlob.DownloadTo(stream); if (stream.CanSeek) { @@ -698,6 +704,10 @@ public Stream OpenFile(string path) return null; } + + private string _connectionString; + + private bool _isSasCredential = false;// cloudBlobClient.Credentials.IsSAS; /// /// Returns the media container, creating a new one if none exists. /// @@ -705,7 +715,7 @@ public Stream OpenFile(string path) /// The name of the container. /// indicating the access permissions. /// The - public static CloudBlobContainer CreateContainer(CloudBlobClient cloudBlobClient, string containerName, BlobContainerPublicAccessType accessType) + public BlobContainerClient CreateContainer(string containerName, PublicAccessType accessType) { Current.Logger.Debug($"CreateContainer(cloudBlobClient, containerName, accessType) method executed with containerName:{containerName}"); @@ -718,45 +728,10 @@ public static CloudBlobContainer CreateContainer(CloudBlobClient cloudBlobClient throw new ArgumentException($"The container name {containerName} is not valid, see https://msdn.microsoft.com/en-us/library/azure/dd135715.aspx for the restrtictions for container names."); } - CloudBlobContainer container = cloudBlobClient.GetContainerReference(containerName.ToLowerInvariant()); - - if (cloudBlobClient.Credentials.IsSAS) + BlobContainerClient container = new BlobContainerClient(_connectionString,containerName.ToLowerInvariant()); + if (_isSasCredential) { - // Shared access signatures (SAS) have some limitations compared to shared access keys - // read more on: https://docs.microsoft.com/en-us/azure/storage/common/storage-dotnet-shared-access-signature-part-1 - string[] sasTokenProperties = cloudBlobClient.Credentials.SASToken.Split("&".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); - bool isAccountSas = sasTokenProperties.Where(k => k.ToLowerInvariant().StartsWith("ss=")).FirstOrDefault() != null; - string allowedServices = sasTokenProperties.Where(k => k.ToLowerInvariant().StartsWith("ss=")).FirstOrDefault(); - if (allowedServices != null) - { - allowedServices = allowedServices.Split('=')[1].ToLower(); - } - else - { - allowedServices = string.Empty; - } - - string resourceTypes = sasTokenProperties.Where(k => k.ToLowerInvariant().StartsWith("srt=")).FirstOrDefault(); - if (resourceTypes != null) - { - resourceTypes = resourceTypes.Split('=')[1].ToLower(); - } - else - { - resourceTypes = string.Empty; - } - - string permissions = sasTokenProperties.Where(k => k.ToLowerInvariant().StartsWith("sp=")).FirstOrDefault(); - if (permissions != null) - { - permissions = permissions.Split('=')[1].ToLower(); - } - else - { - permissions = string.Empty; - } - - bool canCreateContainer = allowedServices.Contains('b') && resourceTypes.Contains('c') && permissions.Contains('c'); + bool canCreateContainer = SasCredentialHasContainerCreatePermission(); if (canCreateContainer) { container.CreateIfNotExists(accessType); @@ -765,22 +740,61 @@ public static CloudBlobContainer CreateContainer(CloudBlobClient cloudBlobClient else if (!container.Exists()) { container.CreateIfNotExists(); - BlobContainerPermissions newPermissions = container.GetPermissions(); - newPermissions.PublicAccess = accessType; - container.SetPermissions(newPermissions); + container.SetAccessPolicy(accessType); } return container; } + private static bool SasCredentialHasContainerCreatePermission() + { + throw new NotImplementedException(); + //// Shared access signatures (SAS) have some limitations compared to shared access keys + //// read more on: https://docs.microsoft.com/en-us/azure/storage/common/storage-dotnet-shared-access-signature-part-1 + //string[] sasTokenProperties = cloudBlobClient.Credentials.SASToken.Split("&".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); + //bool isAccountSas = sasTokenProperties.Where(k => k.ToLowerInvariant().StartsWith("ss=")).FirstOrDefault() != null; + //string allowedServices = sasTokenProperties.Where(k => k.ToLowerInvariant().StartsWith("ss=")).FirstOrDefault(); + //if (allowedServices != null) + //{ + // allowedServices = allowedServices.Split('=')[1].ToLower(); + //} + //else + //{ + // allowedServices = string.Empty; + //} + + //string resourceTypes = sasTokenProperties.Where(k => k.ToLowerInvariant().StartsWith("srt=")).FirstOrDefault(); + //if (resourceTypes != null) + //{ + // resourceTypes = resourceTypes.Split('=')[1].ToLower(); + //} + //else + //{ + // resourceTypes = string.Empty; + //} + + //string permissions = sasTokenProperties.Where(k => k.ToLowerInvariant().StartsWith("sp=")).FirstOrDefault(); + //if (permissions != null) + //{ + // permissions = permissions.Split('=')[1].ToLower(); + //} + //else + //{ + // permissions = string.Empty; + //} + + //bool canCreateContainer = allowedServices.Contains('b') && resourceTypes.Contains('c') && permissions.Contains('c'); + //return canCreateContainer; + } + /// /// Gets a reference to the block blob matching the given path. /// /// The path to the blob. /// - /// The reference. + /// The reference. /// - private CloudBlockBlob GetBlockBlobReference(string path) + private BlobClient GetBlockBlobReference(string path) { Current.Logger.Debug($"GetBlockBlobReference(path) method executed with path:{path}"); @@ -795,26 +809,16 @@ private CloudBlockBlob GetBlockBlobReference(string path) try { - var blobReference = this.cloudBlobContainer.GetBlobReferenceFromServer(blobPath); - if (blobReference.BlobType == BlobType.BlockBlob) - { - return blobReference as CloudBlockBlob; - } - else - { - Current.Logger.Error( - $"A media item '{path}' was requested but it's blob type was {blobReference.BlobType} when it should be BlockBlob"); - return null; - } + return this.cloudBlobContainer.GetBlobClient(blobPath); } - catch (StorageException ex) when (ex.RequestInformation.ErrorCode == BlobErrorCodeStrings.BlobNotFound) + catch (RequestFailedException ex) when (ex.ErrorCode == BlobErrorCode.BlobNotFound) { // blob doesn't exist yet - var blobReference = this.cloudBlobContainer.GetBlockBlobReference(blobPath); + var blobReference = this.cloudBlobContainer.GetBlobClient(blobPath); return blobReference; } - catch (StorageException ex) + catch (RequestFailedException ex) { Current.Logger.Error( $"GetBlockBlobReference exception {ex}"); @@ -827,14 +831,14 @@ private CloudBlockBlob GetBlockBlobReference(string path) /// /// The path to the directory. /// - /// The reference. + /// The reference. /// - private CloudBlobDirectory GetDirectoryReference(string path) + private AzureBlobDirectory GetDirectoryReference(string path) { Current.Logger.Debug($"GetDirectoryReference(path) method executed with path:{path}"); string blobPath = this.FixPath(path); - return this.cloudBlobContainer.GetDirectoryReference(blobPath); + return new AzureBlobDirectory(cloudBlobContainer,blobPath); } /// @@ -885,7 +889,7 @@ private string FixPath(string path) path = path.Replace("\\", Delimiter); string appVirtualPath = this.ApplicationVirtualPath; - if (appVirtualPath != null && path.StartsWith(appVirtualPath)) + if (!string.IsNullOrWhiteSpace(appVirtualPath) && path.StartsWith(appVirtualPath)) { path = path.Substring(appVirtualPath.Length); } diff --git a/src/UmbracoFileSystemProviders.Azure/UmbracoFileSystemProviders.Azure.csproj b/src/UmbracoFileSystemProviders.Azure/UmbracoFileSystemProviders.Azure.csproj index f831b2f..9548407 100644 --- a/src/UmbracoFileSystemProviders.Azure/UmbracoFileSystemProviders.Azure.csproj +++ b/src/UmbracoFileSystemProviders.Azure/UmbracoFileSystemProviders.Azure.csproj @@ -59,6 +59,15 @@ ..\packages\AutoMapper.8.0.0\lib\net461\AutoMapper.dll + + ..\packages\Azure.Core.1.6.0\lib\net461\Azure.Core.dll + + + ..\packages\Azure.Storage.Blobs.12.7.0\lib\netstandard2.0\Azure.Storage.Blobs.dll + + + ..\packages\Azure.Storage.Common.12.6.0\lib\netstandard2.0\Azure.Storage.Common.dll + ..\packages\ClientDependency.1.9.7\lib\net45\ClientDependency.Core.dll @@ -124,11 +133,8 @@ ..\packages\Microsoft.Azure.KeyVault.Core.3.0.3\lib\net452\Microsoft.Azure.KeyVault.Core.dll - - ..\packages\Microsoft.Azure.Storage.Blob.11.1.2\lib\net452\Microsoft.Azure.Storage.Blob.dll - - - ..\packages\Microsoft.Azure.Storage.Common.11.1.2\lib\net452\Microsoft.Azure.Storage.Common.dll + + ..\packages\Microsoft.Bcl.AsyncInterfaces.1.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll ..\packages\Microsoft.Data.Edm.5.8.4\lib\net40\Microsoft.Data.Edm.dll @@ -216,6 +222,9 @@ ..\packages\Superpower.2.0.0\lib\net45\Superpower.dll + + ..\packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll + @@ -228,30 +237,49 @@ ..\packages\Umbraco.SqlServerCE.4.0.0.1\lib\net472\System.Data.SqlServerCe.Entity.dll - - ..\packages\System.Diagnostics.DiagnosticSource.4.4.1\lib\net46\System.Diagnostics.DiagnosticSource.dll + + ..\packages\System.Diagnostics.DiagnosticSource.4.6.0\lib\net46\System.Diagnostics.DiagnosticSource.dll + + ..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll + + + ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + ..\packages\System.Spatial.5.8.4\lib\net40\System.Spatial.dll + + ..\packages\System.Text.Encodings.Web.4.6.0\lib\netstandard2.0\System.Text.Encodings.Web.dll + + + ..\packages\System.Text.Json.4.6.0\lib\net461\System.Text.Json.dll + ..\packages\System.Threading.Tasks.Dataflow.4.9.0\lib\netstandard2.0\System.Threading.Tasks.Dataflow.dll + + ..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll + ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll @@ -301,6 +329,7 @@ + diff --git a/src/UmbracoFileSystemProviders.Azure/app.config b/src/UmbracoFileSystemProviders.Azure/app.config index 7d231fc..ebcc5cd 100644 --- a/src/UmbracoFileSystemProviders.Azure/app.config +++ b/src/UmbracoFileSystemProviders.Azure/app.config @@ -62,6 +62,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/UmbracoFileSystemProviders.Azure/packages.config b/src/UmbracoFileSystemProviders.Azure/packages.config index 07c052d..0f840e5 100644 --- a/src/UmbracoFileSystemProviders.Azure/packages.config +++ b/src/UmbracoFileSystemProviders.Azure/packages.config @@ -1,6 +1,9 @@  + + + @@ -29,8 +32,7 @@ - - + @@ -62,13 +64,20 @@ + - + + + + + + + From 9d95ba2bffa7c8a443d2e900be03ec58a094758c Mon Sep 17 00:00:00 2001 From: nzdev Date: Mon, 26 Apr 2021 20:54:40 +1200 Subject: [PATCH 02/15] etag support --- .../FileSystemVirtualFile.cs | 6 ++++++ .../AzureFileSystem.cs | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/UmbracoFileSystemProviders.Azure.Media/FileSystemVirtualFile.cs b/src/UmbracoFileSystemProviders.Azure.Media/FileSystemVirtualFile.cs index 351a70e..7dad65a 100644 --- a/src/UmbracoFileSystemProviders.Azure.Media/FileSystemVirtualFile.cs +++ b/src/UmbracoFileSystemProviders.Azure.Media/FileSystemVirtualFile.cs @@ -75,6 +75,12 @@ public override Stream Open() cache.SetExpires(DateTime.Now.ToUniversalTime().AddDays(maxDays)); cache.SetMaxAge(new TimeSpan(maxDays, 0, 0, 0)); cache.SetRevalidation(HttpCacheRevalidation.AllCaches); + cache.SetLastModified(azureBlobFileSystem.GetLastModified(VirtualPath).DateTime); + var etag = ((AzureBlobFileSystem)azureBlobFileSystem).FileSystem.GetETag(VirtualPath); + if (!string.IsNullOrWhiteSpace(etag)) + { + cache.SetETag(etag); + } } return this.stream(); diff --git a/src/UmbracoFileSystemProviders.Azure/AzureFileSystem.cs b/src/UmbracoFileSystemProviders.Azure/AzureFileSystem.cs index c8c48f4..9f15739 100644 --- a/src/UmbracoFileSystemProviders.Azure/AzureFileSystem.cs +++ b/src/UmbracoFileSystemProviders.Azure/AzureFileSystem.cs @@ -704,6 +704,20 @@ public Stream OpenFile(string path) return null; } + public string GetETag(string path,string format = "G") + { + Current.Logger.Debug($"GetSize(path) method executed with path:{path}"); + + var blockBlob = this.GetBlockBlobReference(path); + + if (blockBlob != null) + { + var properties = blockBlob.GetProperties().Value; + return properties.ETag.ToString(format); + } + + return null; + } private string _connectionString; From 7a76fcc147b9bf0697f8eb0b7811a0dc1ca2896b Mon Sep 17 00:00:00 2001 From: nzdev Date: Mon, 26 Apr 2021 21:17:29 +1200 Subject: [PATCH 03/15] Update azure packages. SAS tokens will need manual validation, but are supported. Removed automapper and xmlrpc as they are not required. --- ...FileSystemProviders.Azure.Installer.csproj | 22 +++++-------------- .../app.config | 4 ++++ .../packages.config | 9 +++----- ...racoFileSystemProviders.Azure.Tests.csproj | 21 +++++------------- .../app.config | 4 ++++ .../packages.config | 9 +++----- .../AzureFileSystem.cs | 7 +++--- .../UmbracoFileSystemProviders.Azure.csproj | 22 +++++-------------- .../app.config | 4 ++++ .../packages.config | 9 +++----- 10 files changed, 43 insertions(+), 68 deletions(-) diff --git a/src/UmbracoFileSystemProviders.Azure.Installer/UmbracoFileSystemProviders.Azure.Installer.csproj b/src/UmbracoFileSystemProviders.Azure.Installer/UmbracoFileSystemProviders.Azure.Installer.csproj index 8bf33d5..a3aad06 100644 --- a/src/UmbracoFileSystemProviders.Azure.Installer/UmbracoFileSystemProviders.Azure.Installer.csproj +++ b/src/UmbracoFileSystemProviders.Azure.Installer/UmbracoFileSystemProviders.Azure.Installer.csproj @@ -54,17 +54,14 @@ MinimumRecommendedRules.ruleset - - ..\packages\AutoMapper.8.0.0\lib\net461\AutoMapper.dll + + ..\packages\Azure.Core.1.8.1\lib\net461\Azure.Core.dll - - ..\packages\Azure.Core.1.6.0\lib\net461\Azure.Core.dll + + ..\packages\Azure.Storage.Blobs.12.8.1\lib\netstandard2.0\Azure.Storage.Blobs.dll - - ..\packages\Azure.Storage.Blobs.12.7.0\lib\netstandard2.0\Azure.Storage.Blobs.dll - - - ..\packages\Azure.Storage.Common.12.6.0\lib\netstandard2.0\Azure.Storage.Common.dll + + ..\packages\Azure.Storage.Common.12.7.2\lib\netstandard2.0\Azure.Storage.Common.dll ..\packages\ClientDependency.1.9.7\lib\net45\ClientDependency.Core.dll @@ -72,10 +69,6 @@ ..\packages\ClientDependency-Mvc5.1.8.0.0\lib\net45\ClientDependency.Core.Mvc.dll - - ..\packages\xmlrpcnet.2.5.0\lib\net20\CookComputing.XmlRpcV2.dll - True - ..\packages\CSharpTest.Net.Collections.14.906.1403.1082\lib\net40\CSharpTest.Net.Collections.dll @@ -176,9 +169,6 @@ ..\packages\MiniProfiler.Shared.4.0.138\lib\net461\MiniProfiler.Shared.dll - - ..\packages\MySql.Data.6.10.7\lib\net452\MySql.Data.dll - ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll diff --git a/src/UmbracoFileSystemProviders.Azure.Installer/app.config b/src/UmbracoFileSystemProviders.Azure.Installer/app.config index 48e4869..f4feb41 100644 --- a/src/UmbracoFileSystemProviders.Azure.Installer/app.config +++ b/src/UmbracoFileSystemProviders.Azure.Installer/app.config @@ -94,6 +94,10 @@ + + + + diff --git a/src/UmbracoFileSystemProviders.Azure.Installer/packages.config b/src/UmbracoFileSystemProviders.Azure.Installer/packages.config index 810846f..4c5bbba 100644 --- a/src/UmbracoFileSystemProviders.Azure.Installer/packages.config +++ b/src/UmbracoFileSystemProviders.Azure.Installer/packages.config @@ -1,9 +1,8 @@  - - - - + + + @@ -48,7 +47,6 @@ - @@ -84,5 +82,4 @@ - \ No newline at end of file diff --git a/src/UmbracoFileSystemProviders.Azure.Tests/UmbracoFileSystemProviders.Azure.Tests.csproj b/src/UmbracoFileSystemProviders.Azure.Tests/UmbracoFileSystemProviders.Azure.Tests.csproj index 4c011dc..5da43f9 100644 --- a/src/UmbracoFileSystemProviders.Azure.Tests/UmbracoFileSystemProviders.Azure.Tests.csproj +++ b/src/UmbracoFileSystemProviders.Azure.Tests/UmbracoFileSystemProviders.Azure.Tests.csproj @@ -56,17 +56,14 @@ MinimumRecommendedRules.ruleset - - ..\packages\AutoMapper.8.0.0\lib\net461\AutoMapper.dll + + ..\packages\Azure.Core.1.8.1\lib\net461\Azure.Core.dll - - ..\packages\Azure.Core.1.6.0\lib\net461\Azure.Core.dll + + ..\packages\Azure.Storage.Blobs.12.8.1\lib\netstandard2.0\Azure.Storage.Blobs.dll - - ..\packages\Azure.Storage.Blobs.12.7.0\lib\netstandard2.0\Azure.Storage.Blobs.dll - - - ..\packages\Azure.Storage.Common.12.6.0\lib\netstandard2.0\Azure.Storage.Common.dll + + ..\packages\Azure.Storage.Common.12.7.2\lib\netstandard2.0\Azure.Storage.Common.dll ..\packages\ClientDependency.1.9.7\lib\net45\ClientDependency.Core.dll @@ -74,9 +71,6 @@ ..\packages\ClientDependency-Mvc5.1.8.0.0\lib\net45\ClientDependency.Core.Mvc.dll - - ..\packages\xmlrpcnet.2.5.0\lib\net20\CookComputing.XmlRpcV2.dll - ..\packages\CSharpTest.Net.Collections.14.906.1403.1082\lib\net40\CSharpTest.Net.Collections.dll @@ -175,9 +169,6 @@ ..\packages\Moq.4.2.1502.0911\lib\net40\Moq.dll - - ..\packages\MySql.Data.6.10.7\lib\net452\MySql.Data.dll - ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll diff --git a/src/UmbracoFileSystemProviders.Azure.Tests/app.config b/src/UmbracoFileSystemProviders.Azure.Tests/app.config index 7b73006..a0c48be 100644 --- a/src/UmbracoFileSystemProviders.Azure.Tests/app.config +++ b/src/UmbracoFileSystemProviders.Azure.Tests/app.config @@ -126,6 +126,10 @@ + + + + diff --git a/src/UmbracoFileSystemProviders.Azure.Tests/packages.config b/src/UmbracoFileSystemProviders.Azure.Tests/packages.config index 56cb841..2acba20 100644 --- a/src/UmbracoFileSystemProviders.Azure.Tests/packages.config +++ b/src/UmbracoFileSystemProviders.Azure.Tests/packages.config @@ -1,9 +1,8 @@  - - - - + + + @@ -47,7 +46,6 @@ - @@ -85,5 +83,4 @@ - \ No newline at end of file diff --git a/src/UmbracoFileSystemProviders.Azure/AzureFileSystem.cs b/src/UmbracoFileSystemProviders.Azure/AzureFileSystem.cs index c8c48f4..8d466ea 100644 --- a/src/UmbracoFileSystemProviders.Azure/AzureFileSystem.cs +++ b/src/UmbracoFileSystemProviders.Azure/AzureFileSystem.cs @@ -114,7 +114,7 @@ internal AzureFileSystem(string containerName, string rootUrl, string connection _connectionString = connectionString; } - + ValidateSasToken(connectionString); this.cloudBlobContainer = CreateContainer(containerName, accessType); @@ -135,9 +135,10 @@ internal AzureFileSystem(string containerName, string rootUrl, string connection this.MimeTypeResolver = new MimeTypeResolver(); } - private static void ValidateSasToken(string cloudStorageAccount) + private static void ValidateSasToken(string connectionString) { - throw new NotImplementedException(); + //TODO: Validate SAS + //bool isValidSas = true; //var sasTokenParts = cloudStorageAccount.Credentials.SASToken.Split('&'); //var si = sasTokenParts.Where(t => t.StartsWith("si=")).FirstOrDefault(); diff --git a/src/UmbracoFileSystemProviders.Azure/UmbracoFileSystemProviders.Azure.csproj b/src/UmbracoFileSystemProviders.Azure/UmbracoFileSystemProviders.Azure.csproj index 9548407..242572f 100644 --- a/src/UmbracoFileSystemProviders.Azure/UmbracoFileSystemProviders.Azure.csproj +++ b/src/UmbracoFileSystemProviders.Azure/UmbracoFileSystemProviders.Azure.csproj @@ -56,17 +56,14 @@ MinimumRecommendedRules.ruleset - - ..\packages\AutoMapper.8.0.0\lib\net461\AutoMapper.dll + + ..\packages\Azure.Core.1.8.1\lib\net461\Azure.Core.dll - - ..\packages\Azure.Core.1.6.0\lib\net461\Azure.Core.dll + + ..\packages\Azure.Storage.Blobs.12.8.1\lib\netstandard2.0\Azure.Storage.Blobs.dll - - ..\packages\Azure.Storage.Blobs.12.7.0\lib\netstandard2.0\Azure.Storage.Blobs.dll - - - ..\packages\Azure.Storage.Common.12.6.0\lib\netstandard2.0\Azure.Storage.Common.dll + + ..\packages\Azure.Storage.Common.12.7.2\lib\netstandard2.0\Azure.Storage.Common.dll ..\packages\ClientDependency.1.9.7\lib\net45\ClientDependency.Core.dll @@ -74,10 +71,6 @@ ..\packages\ClientDependency-Mvc5.1.8.0.0\lib\net45\ClientDependency.Core.Mvc.dll - - ..\packages\xmlrpcnet.2.5.0\lib\net20\CookComputing.XmlRpcV2.dll - True - ..\packages\CSharpTest.Net.Collections.14.906.1403.1082\lib\net40\CSharpTest.Net.Collections.dll @@ -173,9 +166,6 @@ ..\packages\MiniProfiler.Shared.4.0.138\lib\net461\MiniProfiler.Shared.dll - - ..\packages\MySql.Data.6.10.7\lib\net452\MySql.Data.dll - ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll diff --git a/src/UmbracoFileSystemProviders.Azure/app.config b/src/UmbracoFileSystemProviders.Azure/app.config index ebcc5cd..33058ba 100644 --- a/src/UmbracoFileSystemProviders.Azure/app.config +++ b/src/UmbracoFileSystemProviders.Azure/app.config @@ -86,6 +86,10 @@ + + + + diff --git a/src/UmbracoFileSystemProviders.Azure/packages.config b/src/UmbracoFileSystemProviders.Azure/packages.config index 0f840e5..37cd809 100644 --- a/src/UmbracoFileSystemProviders.Azure/packages.config +++ b/src/UmbracoFileSystemProviders.Azure/packages.config @@ -1,9 +1,8 @@  - - - - + + + @@ -46,7 +45,6 @@ - @@ -82,5 +80,4 @@ - \ No newline at end of file From 1dc8302885d13866fedfd19a25d22930f662fcd8 Mon Sep 17 00:00:00 2001 From: Jeavon Leopold Date: Tue, 27 Apr 2021 10:59:00 +0100 Subject: [PATCH 04/15] Build tweaks for SDK 12 --- appveyor.yml | 2 +- build/UmbracoFileSystemProviders.Azure.Media.proj | 2 +- build/UmbracoFileSystemProviders.Azure.nuspec | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 868ac32..2cdb954 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 2.1.0.{build} +version: 3.0.0.{build} os: Visual Studio 2019 diff --git a/build/UmbracoFileSystemProviders.Azure.Media.proj b/build/UmbracoFileSystemProviders.Azure.Media.proj index b010736..9d76712 100644 --- a/build/UmbracoFileSystemProviders.Azure.Media.proj +++ b/build/UmbracoFileSystemProviders.Azure.Media.proj @@ -88,7 +88,7 @@ - + diff --git a/build/UmbracoFileSystemProviders.Azure.nuspec b/build/UmbracoFileSystemProviders.Azure.nuspec index 313fd4e..61fccaa 100644 --- a/build/UmbracoFileSystemProviders.Azure.nuspec +++ b/build/UmbracoFileSystemProviders.Azure.nuspec @@ -18,7 +18,9 @@ - + + + From bccced2868d5a2b9303a0bcdecaa78e2b5fb71b6 Mon Sep 17 00:00:00 2001 From: Jeavon Leopold Date: Tue, 18 May 2021 09:24:52 +0100 Subject: [PATCH 05/15] Push sdk12 to MyGet --- appveyor.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 2cdb954..0ac8907 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -73,6 +73,16 @@ deploy: on: branch: develop-umbraco-version-8 + # Umbraco MyGet community feed + - provider: NuGet + server: https://www.myget.org/F/umbraco-packages/api/v2/package + symbol_server: https://www.myget.org/F/umbraco-packages/symbols/api/v2/package + api_key: + secure: yvlnQEq6tmxGOdbtTuKyAhcdY1GCD98/sG9+Qo7y7SNb89GAbjLXxueOMspkjvUh + artifact: /.*\.nupkg/ + on: + branch: feature/sdk12 + # GitHub Deployment for releases - provider: GitHub auth_token: From 1bd9de581e8d681694984052fbdb4d7d08df2d11 Mon Sep 17 00:00:00 2001 From: Jeavon Leopold Date: Tue, 18 May 2021 10:05:14 +0100 Subject: [PATCH 06/15] Updated packages --- build/UmbracoFileSystemProviders.Azure.nuspec | 6 +++--- ...FileSystemProviders.Azure.Installer.csproj | 19 +++++++++++-------- .../app.config | 8 ++++++++ .../packages.config | 11 ++++++----- ...racoFileSystemProviders.Azure.Tests.csproj | 19 +++++++++++-------- .../app.config | 8 ++++++++ .../packages.config | 11 ++++++----- .../UmbracoFileSystemProviders.Azure.csproj | 19 +++++++++++-------- .../app.config | 8 ++++++++ .../packages.config | 11 ++++++----- 10 files changed, 78 insertions(+), 42 deletions(-) diff --git a/build/UmbracoFileSystemProviders.Azure.nuspec b/build/UmbracoFileSystemProviders.Azure.nuspec index 61fccaa..d04165d 100644 --- a/build/UmbracoFileSystemProviders.Azure.nuspec +++ b/build/UmbracoFileSystemProviders.Azure.nuspec @@ -18,9 +18,9 @@ - - - + + + diff --git a/src/UmbracoFileSystemProviders.Azure.Installer/UmbracoFileSystemProviders.Azure.Installer.csproj b/src/UmbracoFileSystemProviders.Azure.Installer/UmbracoFileSystemProviders.Azure.Installer.csproj index a3aad06..f5651fc 100644 --- a/src/UmbracoFileSystemProviders.Azure.Installer/UmbracoFileSystemProviders.Azure.Installer.csproj +++ b/src/UmbracoFileSystemProviders.Azure.Installer/UmbracoFileSystemProviders.Azure.Installer.csproj @@ -54,11 +54,11 @@ MinimumRecommendedRules.ruleset - - ..\packages\Azure.Core.1.8.1\lib\net461\Azure.Core.dll + + ..\packages\Azure.Core.1.14.0\lib\net461\Azure.Core.dll - - ..\packages\Azure.Storage.Blobs.12.8.1\lib\netstandard2.0\Azure.Storage.Blobs.dll + + ..\packages\Azure.Storage.Blobs.12.8.3\lib\netstandard2.0\Azure.Storage.Blobs.dll ..\packages\Azure.Storage.Common.12.7.2\lib\netstandard2.0\Azure.Storage.Common.dll @@ -216,7 +216,7 @@ - ..\packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll + ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll @@ -239,7 +239,10 @@ - ..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll + ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll + + + ..\packages\System.Memory.Data.1.0.2\lib\net461\System.Memory.Data.dll ..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll @@ -259,8 +262,8 @@ ..\packages\System.Spatial.5.8.4\lib\net40\System.Spatial.dll - - ..\packages\System.Text.Encodings.Web.4.6.0\lib\netstandard2.0\System.Text.Encodings.Web.dll + + ..\packages\System.Text.Encodings.Web.4.7.2\lib\net461\System.Text.Encodings.Web.dll ..\packages\System.Text.Json.4.6.0\lib\net461\System.Text.Json.dll diff --git a/src/UmbracoFileSystemProviders.Azure.Installer/app.config b/src/UmbracoFileSystemProviders.Azure.Installer/app.config index f4feb41..97c37cf 100644 --- a/src/UmbracoFileSystemProviders.Azure.Installer/app.config +++ b/src/UmbracoFileSystemProviders.Azure.Installer/app.config @@ -98,6 +98,14 @@ + + + + + + + + diff --git a/src/UmbracoFileSystemProviders.Azure.Installer/packages.config b/src/UmbracoFileSystemProviders.Azure.Installer/packages.config index 4c5bbba..1260e3e 100644 --- a/src/UmbracoFileSystemProviders.Azure.Installer/packages.config +++ b/src/UmbracoFileSystemProviders.Azure.Installer/packages.config @@ -1,7 +1,7 @@  - - + + @@ -64,17 +64,18 @@ - + - + + - + diff --git a/src/UmbracoFileSystemProviders.Azure.Tests/UmbracoFileSystemProviders.Azure.Tests.csproj b/src/UmbracoFileSystemProviders.Azure.Tests/UmbracoFileSystemProviders.Azure.Tests.csproj index 5da43f9..451b6ab 100644 --- a/src/UmbracoFileSystemProviders.Azure.Tests/UmbracoFileSystemProviders.Azure.Tests.csproj +++ b/src/UmbracoFileSystemProviders.Azure.Tests/UmbracoFileSystemProviders.Azure.Tests.csproj @@ -56,11 +56,11 @@ MinimumRecommendedRules.ruleset - - ..\packages\Azure.Core.1.8.1\lib\net461\Azure.Core.dll + + ..\packages\Azure.Core.1.14.0\lib\net461\Azure.Core.dll - - ..\packages\Azure.Storage.Blobs.12.8.1\lib\netstandard2.0\Azure.Storage.Blobs.dll + + ..\packages\Azure.Storage.Blobs.12.8.3\lib\netstandard2.0\Azure.Storage.Blobs.dll ..\packages\Azure.Storage.Common.12.7.2\lib\netstandard2.0\Azure.Storage.Common.dll @@ -219,7 +219,7 @@ - ..\packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll + ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll @@ -242,7 +242,10 @@ - ..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll + ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll + + + ..\packages\System.Memory.Data.1.0.2\lib\net461\System.Memory.Data.dll @@ -263,8 +266,8 @@ ..\packages\System.Spatial.5.8.4\lib\net40\System.Spatial.dll - - ..\packages\System.Text.Encodings.Web.4.6.0\lib\netstandard2.0\System.Text.Encodings.Web.dll + + ..\packages\System.Text.Encodings.Web.4.7.2\lib\net461\System.Text.Encodings.Web.dll ..\packages\System.Text.Json.4.6.0\lib\net461\System.Text.Json.dll diff --git a/src/UmbracoFileSystemProviders.Azure.Tests/app.config b/src/UmbracoFileSystemProviders.Azure.Tests/app.config index a0c48be..99df905 100644 --- a/src/UmbracoFileSystemProviders.Azure.Tests/app.config +++ b/src/UmbracoFileSystemProviders.Azure.Tests/app.config @@ -130,6 +130,14 @@ + + + + + + + + diff --git a/src/UmbracoFileSystemProviders.Azure.Tests/packages.config b/src/UmbracoFileSystemProviders.Azure.Tests/packages.config index 2acba20..db08f50 100644 --- a/src/UmbracoFileSystemProviders.Azure.Tests/packages.config +++ b/src/UmbracoFileSystemProviders.Azure.Tests/packages.config @@ -1,7 +1,7 @@  - - + + @@ -65,17 +65,18 @@ - + - + + - + diff --git a/src/UmbracoFileSystemProviders.Azure/UmbracoFileSystemProviders.Azure.csproj b/src/UmbracoFileSystemProviders.Azure/UmbracoFileSystemProviders.Azure.csproj index 4c5d0a7..bccb1e1 100644 --- a/src/UmbracoFileSystemProviders.Azure/UmbracoFileSystemProviders.Azure.csproj +++ b/src/UmbracoFileSystemProviders.Azure/UmbracoFileSystemProviders.Azure.csproj @@ -56,11 +56,11 @@ MinimumRecommendedRules.ruleset - - ..\packages\Azure.Core.1.8.1\lib\net461\Azure.Core.dll + + ..\packages\Azure.Core.1.14.0\lib\net461\Azure.Core.dll - - ..\packages\Azure.Storage.Blobs.12.8.1\lib\netstandard2.0\Azure.Storage.Blobs.dll + + ..\packages\Azure.Storage.Blobs.12.8.3\lib\netstandard2.0\Azure.Storage.Blobs.dll ..\packages\Azure.Storage.Common.12.7.2\lib\netstandard2.0\Azure.Storage.Common.dll @@ -213,7 +213,7 @@ - ..\packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll + ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll @@ -236,7 +236,10 @@ - ..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll + ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll + + + ..\packages\System.Memory.Data.1.0.2\lib\net461\System.Memory.Data.dll @@ -257,8 +260,8 @@ ..\packages\System.Spatial.5.8.4\lib\net40\System.Spatial.dll - - ..\packages\System.Text.Encodings.Web.4.6.0\lib\netstandard2.0\System.Text.Encodings.Web.dll + + ..\packages\System.Text.Encodings.Web.4.7.2\lib\net461\System.Text.Encodings.Web.dll ..\packages\System.Text.Json.4.6.0\lib\net461\System.Text.Json.dll diff --git a/src/UmbracoFileSystemProviders.Azure/app.config b/src/UmbracoFileSystemProviders.Azure/app.config index 33058ba..3d9e3f8 100644 --- a/src/UmbracoFileSystemProviders.Azure/app.config +++ b/src/UmbracoFileSystemProviders.Azure/app.config @@ -90,6 +90,14 @@ + + + + + + + + diff --git a/src/UmbracoFileSystemProviders.Azure/packages.config b/src/UmbracoFileSystemProviders.Azure/packages.config index 37cd809..de73cfc 100644 --- a/src/UmbracoFileSystemProviders.Azure/packages.config +++ b/src/UmbracoFileSystemProviders.Azure/packages.config @@ -1,7 +1,7 @@  - - + + @@ -62,17 +62,18 @@ - + - + + - + From 8d6d91865f90b12d79471dcfa5852387a6a20c9d Mon Sep 17 00:00:00 2001 From: Jeavon Leopold Date: Tue, 18 May 2021 10:48:07 +0100 Subject: [PATCH 07/15] Beta time --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 0ac8907..c625598 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,7 +9,7 @@ configuration: Release environment: # Version Suffix - version_suffix: alpha + version_suffix: beta1 install: - ps: .\build\appveyor-semver.ps1 From 5c0f6fffd378543198c6c354663b94bf38e0ee6a Mon Sep 17 00:00:00 2001 From: Jeavon Leopold Date: Tue, 18 May 2021 10:51:14 +0100 Subject: [PATCH 08/15] New release branch for v3 --- appveyor.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index c625598..0fb7063 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -124,3 +124,24 @@ deploy: on: branch: master-umbraco-version-8 appveyor_repo_tag: true + + # GitHub Deployment for releases + - provider: GitHub + auth_token: + secure: Kucu1gQQf8bjRlkR72fyZUiUtmkz7rtZEIgK/RMT1pMnq700m5sSQTiFHOSQUdR5 + artifact: /.*\.zip/ # upload all Zip packages to release assets + draft: false + prerelease: false + on: + branch: main-version-3 + appveyor_repo_tag: true # deploy on tag push only + + # NuGet Deployment for releases + - provider: NuGet + server: + api_key: + secure: TtE4dizVNNLoy4gfrJDGRH1/vfNMTXiAxuMW0va1bcO1ZPXCw0qy12PUfIB+h9O3 + artifact: /.*\.nupkg/ + on: + branch: main-version-3 + appveyor_repo_tag: true From 56903d919c25d548f427504ef57351d5bb50054b Mon Sep 17 00:00:00 2001 From: Jeavon Leopold Date: Tue, 18 May 2021 11:17:37 +0100 Subject: [PATCH 09/15] Bump --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 0fb7063..a1a46c0 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,7 +9,7 @@ configuration: Release environment: # Version Suffix - version_suffix: beta1 + version_suffix: beta2 install: - ps: .\build\appveyor-semver.ps1 From 2e7f6a336211eb81b8a24e400a3899bacf1b75ba Mon Sep 17 00:00:00 2001 From: Jeavon Date: Tue, 31 Aug 2021 13:08:04 +0100 Subject: [PATCH 10/15] Merge pull request #199 from Shazwazza/patch-1 Makes GetBlockBlobReference public just like v2 (cherry picked from commit 157a29eb362c78c8236d42808ffe941eb93b7534) --- src/UmbracoFileSystemProviders.Azure/AzureFileSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UmbracoFileSystemProviders.Azure/AzureFileSystem.cs b/src/UmbracoFileSystemProviders.Azure/AzureFileSystem.cs index a59e88b..a686a93 100644 --- a/src/UmbracoFileSystemProviders.Azure/AzureFileSystem.cs +++ b/src/UmbracoFileSystemProviders.Azure/AzureFileSystem.cs @@ -809,7 +809,7 @@ private static bool SasCredentialHasContainerCreatePermission() /// /// The reference. /// - private BlobClient GetBlockBlobReference(string path) + public BlobClient GetBlockBlobReference(string path) { Current.Logger.Debug($"GetBlockBlobReference(path) method executed with path:{path}"); From 06198a465b7604f2c9c2833ba209efd90440f096 Mon Sep 17 00:00:00 2001 From: Jeavon Leopold Date: Tue, 31 Aug 2021 13:26:18 +0100 Subject: [PATCH 11/15] Removed Microsoft.Data.Services.Client --- build/UmbracoFileSystemProviders.Azure.Media.proj | 2 +- build/UmbracoFileSystemProviders.Azure.nuspec | 1 - build/transforms/umbpak-web.config.install.xdt | 6 ------ build/transforms/umbpak-web.config.uninstall.xdt | 2 -- .../UmbracoFileSystemProviders.Azure.Installer.csproj | 3 --- .../packages.config | 1 - .../UmbracoFileSystemProviders.Azure.Tests.csproj | 3 --- src/UmbracoFileSystemProviders.Azure.Tests/packages.config | 1 - .../UmbracoFileSystemProviders.Azure.csproj | 3 --- src/UmbracoFileSystemProviders.Azure/packages.config | 1 - 10 files changed, 1 insertion(+), 22 deletions(-) diff --git a/build/UmbracoFileSystemProviders.Azure.Media.proj b/build/UmbracoFileSystemProviders.Azure.Media.proj index 9d76712..7f2aec0 100644 --- a/build/UmbracoFileSystemProviders.Azure.Media.proj +++ b/build/UmbracoFileSystemProviders.Azure.Media.proj @@ -88,7 +88,7 @@ - + diff --git a/build/UmbracoFileSystemProviders.Azure.nuspec b/build/UmbracoFileSystemProviders.Azure.nuspec index d04165d..d705446 100644 --- a/build/UmbracoFileSystemProviders.Azure.nuspec +++ b/build/UmbracoFileSystemProviders.Azure.nuspec @@ -23,7 +23,6 @@ - \ No newline at end of file diff --git a/build/transforms/umbpak-web.config.install.xdt b/build/transforms/umbpak-web.config.install.xdt index 12627eb..716a716 100644 --- a/build/transforms/umbpak-web.config.install.xdt +++ b/build/transforms/umbpak-web.config.install.xdt @@ -2,8 +2,6 @@ - - @@ -11,10 +9,6 @@ - - - - diff --git a/build/transforms/umbpak-web.config.uninstall.xdt b/build/transforms/umbpak-web.config.uninstall.xdt index 4d2396d..c57cdbb 100644 --- a/build/transforms/umbpak-web.config.uninstall.xdt +++ b/build/transforms/umbpak-web.config.uninstall.xdt @@ -2,8 +2,6 @@ - - diff --git a/src/UmbracoFileSystemProviders.Azure.Installer/UmbracoFileSystemProviders.Azure.Installer.csproj b/src/UmbracoFileSystemProviders.Azure.Installer/UmbracoFileSystemProviders.Azure.Installer.csproj index f5651fc..11e4fc7 100644 --- a/src/UmbracoFileSystemProviders.Azure.Installer/UmbracoFileSystemProviders.Azure.Installer.csproj +++ b/src/UmbracoFileSystemProviders.Azure.Installer/UmbracoFileSystemProviders.Azure.Installer.csproj @@ -134,9 +134,6 @@ ..\packages\Microsoft.Data.OData.5.8.4\lib\net40\Microsoft.Data.OData.dll - - ..\packages\Microsoft.Data.Services.Client.5.8.4\lib\net40\Microsoft.Data.Services.Client.dll - ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.0.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll diff --git a/src/UmbracoFileSystemProviders.Azure.Installer/packages.config b/src/UmbracoFileSystemProviders.Azure.Installer/packages.config index 1260e3e..2e04666 100644 --- a/src/UmbracoFileSystemProviders.Azure.Installer/packages.config +++ b/src/UmbracoFileSystemProviders.Azure.Installer/packages.config @@ -35,7 +35,6 @@ - diff --git a/src/UmbracoFileSystemProviders.Azure.Tests/UmbracoFileSystemProviders.Azure.Tests.csproj b/src/UmbracoFileSystemProviders.Azure.Tests/UmbracoFileSystemProviders.Azure.Tests.csproj index 451b6ab..852de27 100644 --- a/src/UmbracoFileSystemProviders.Azure.Tests/UmbracoFileSystemProviders.Azure.Tests.csproj +++ b/src/UmbracoFileSystemProviders.Azure.Tests/UmbracoFileSystemProviders.Azure.Tests.csproj @@ -135,9 +135,6 @@ ..\packages\Microsoft.Data.OData.5.8.4\lib\net40\Microsoft.Data.OData.dll - - ..\packages\Microsoft.Data.Services.Client.5.8.4\lib\net40\Microsoft.Data.Services.Client.dll - ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.0.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll diff --git a/src/UmbracoFileSystemProviders.Azure.Tests/packages.config b/src/UmbracoFileSystemProviders.Azure.Tests/packages.config index db08f50..9820aa2 100644 --- a/src/UmbracoFileSystemProviders.Azure.Tests/packages.config +++ b/src/UmbracoFileSystemProviders.Azure.Tests/packages.config @@ -34,7 +34,6 @@ - diff --git a/src/UmbracoFileSystemProviders.Azure/UmbracoFileSystemProviders.Azure.csproj b/src/UmbracoFileSystemProviders.Azure/UmbracoFileSystemProviders.Azure.csproj index bccb1e1..cbc9c1e 100644 --- a/src/UmbracoFileSystemProviders.Azure/UmbracoFileSystemProviders.Azure.csproj +++ b/src/UmbracoFileSystemProviders.Azure/UmbracoFileSystemProviders.Azure.csproj @@ -135,9 +135,6 @@ ..\packages\Microsoft.Data.OData.5.8.4\lib\net40\Microsoft.Data.OData.dll - - ..\packages\Microsoft.Data.Services.Client.5.8.4\lib\net40\Microsoft.Data.Services.Client.dll - ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.0.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll diff --git a/src/UmbracoFileSystemProviders.Azure/packages.config b/src/UmbracoFileSystemProviders.Azure/packages.config index de73cfc..011d0e9 100644 --- a/src/UmbracoFileSystemProviders.Azure/packages.config +++ b/src/UmbracoFileSystemProviders.Azure/packages.config @@ -34,7 +34,6 @@ - From cea66217d92f94ab772fba2eaf580bd911d28a17 Mon Sep 17 00:00:00 2001 From: Jeavon Leopold Date: Tue, 31 Aug 2021 13:45:39 +0100 Subject: [PATCH 12/15] Removed some old dependencies and upgraded current Azure packages --- ...UmbracoFileSystemProviders.Azure.Media.proj | 2 +- build/UmbracoFileSystemProviders.Azure.nuspec | 8 +++----- build/transforms/umbpak-web.config.install.xdt | 4 ---- .../transforms/umbpak-web.config.uninstall.xdt | 2 -- ...oFileSystemProviders.Azure.Installer.csproj | 18 ++++++------------ .../app.config | 2 +- .../packages.config | 8 +++----- ...bracoFileSystemProviders.Azure.Tests.csproj | 18 ++++++------------ .../app.config | 2 +- .../packages.config | 8 +++----- .../UmbracoFileSystemProviders.Azure.csproj | 18 ++++++------------ .../app.config | 2 +- .../packages.config | 8 +++----- 13 files changed, 34 insertions(+), 66 deletions(-) diff --git a/build/UmbracoFileSystemProviders.Azure.Media.proj b/build/UmbracoFileSystemProviders.Azure.Media.proj index 7f2aec0..73c49a0 100644 --- a/build/UmbracoFileSystemProviders.Azure.Media.proj +++ b/build/UmbracoFileSystemProviders.Azure.Media.proj @@ -88,7 +88,7 @@ - + diff --git a/build/UmbracoFileSystemProviders.Azure.nuspec b/build/UmbracoFileSystemProviders.Azure.nuspec index d705446..af9fad0 100644 --- a/build/UmbracoFileSystemProviders.Azure.nuspec +++ b/build/UmbracoFileSystemProviders.Azure.nuspec @@ -18,11 +18,9 @@ - - - - - + + + \ No newline at end of file diff --git a/build/transforms/umbpak-web.config.install.xdt b/build/transforms/umbpak-web.config.install.xdt index 716a716..9a3a88e 100644 --- a/build/transforms/umbpak-web.config.install.xdt +++ b/build/transforms/umbpak-web.config.install.xdt @@ -17,10 +17,6 @@ - - - - \ No newline at end of file diff --git a/build/transforms/umbpak-web.config.uninstall.xdt b/build/transforms/umbpak-web.config.uninstall.xdt index c57cdbb..cd8725c 100644 --- a/build/transforms/umbpak-web.config.uninstall.xdt +++ b/build/transforms/umbpak-web.config.uninstall.xdt @@ -6,8 +6,6 @@ - - diff --git a/src/UmbracoFileSystemProviders.Azure.Installer/UmbracoFileSystemProviders.Azure.Installer.csproj b/src/UmbracoFileSystemProviders.Azure.Installer/UmbracoFileSystemProviders.Azure.Installer.csproj index 11e4fc7..fbdfc58 100644 --- a/src/UmbracoFileSystemProviders.Azure.Installer/UmbracoFileSystemProviders.Azure.Installer.csproj +++ b/src/UmbracoFileSystemProviders.Azure.Installer/UmbracoFileSystemProviders.Azure.Installer.csproj @@ -54,14 +54,14 @@ MinimumRecommendedRules.ruleset - - ..\packages\Azure.Core.1.14.0\lib\net461\Azure.Core.dll + + ..\packages\Azure.Core.1.18.0\lib\net461\Azure.Core.dll - - ..\packages\Azure.Storage.Blobs.12.8.3\lib\netstandard2.0\Azure.Storage.Blobs.dll + + ..\packages\Azure.Storage.Blobs.12.9.1\lib\netstandard2.0\Azure.Storage.Blobs.dll - - ..\packages\Azure.Storage.Common.12.7.2\lib\netstandard2.0\Azure.Storage.Common.dll + + ..\packages\Azure.Storage.Common.12.8.0\lib\netstandard2.0\Azure.Storage.Common.dll ..\packages\ClientDependency.1.9.7\lib\net45\ClientDependency.Core.dll @@ -119,12 +119,6 @@ ..\packages\Microsoft.AspNet.SignalR.Core.2.4.0\lib\net45\Microsoft.AspNet.SignalR.Core.dll - - ..\packages\Microsoft.Azure.ConfigurationManager.4.0.0\lib\net452\Microsoft.Azure.ConfigurationManager.dll - - - ..\packages\Microsoft.Azure.KeyVault.Core.3.0.3\lib\net452\Microsoft.Azure.KeyVault.Core.dll - ..\packages\Microsoft.Bcl.AsyncInterfaces.1.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll diff --git a/src/UmbracoFileSystemProviders.Azure.Installer/app.config b/src/UmbracoFileSystemProviders.Azure.Installer/app.config index 97c37cf..c5806ea 100644 --- a/src/UmbracoFileSystemProviders.Azure.Installer/app.config +++ b/src/UmbracoFileSystemProviders.Azure.Installer/app.config @@ -100,7 +100,7 @@ - + diff --git a/src/UmbracoFileSystemProviders.Azure.Installer/packages.config b/src/UmbracoFileSystemProviders.Azure.Installer/packages.config index 2e04666..5b0c333 100644 --- a/src/UmbracoFileSystemProviders.Azure.Installer/packages.config +++ b/src/UmbracoFileSystemProviders.Azure.Installer/packages.config @@ -1,8 +1,8 @@  - - - + + + @@ -30,8 +30,6 @@ - - diff --git a/src/UmbracoFileSystemProviders.Azure.Tests/UmbracoFileSystemProviders.Azure.Tests.csproj b/src/UmbracoFileSystemProviders.Azure.Tests/UmbracoFileSystemProviders.Azure.Tests.csproj index 852de27..9ac7ca4 100644 --- a/src/UmbracoFileSystemProviders.Azure.Tests/UmbracoFileSystemProviders.Azure.Tests.csproj +++ b/src/UmbracoFileSystemProviders.Azure.Tests/UmbracoFileSystemProviders.Azure.Tests.csproj @@ -56,14 +56,14 @@ MinimumRecommendedRules.ruleset - - ..\packages\Azure.Core.1.14.0\lib\net461\Azure.Core.dll + + ..\packages\Azure.Core.1.18.0\lib\net461\Azure.Core.dll - - ..\packages\Azure.Storage.Blobs.12.8.3\lib\netstandard2.0\Azure.Storage.Blobs.dll + + ..\packages\Azure.Storage.Blobs.12.9.1\lib\netstandard2.0\Azure.Storage.Blobs.dll - - ..\packages\Azure.Storage.Common.12.7.2\lib\netstandard2.0\Azure.Storage.Common.dll + + ..\packages\Azure.Storage.Common.12.8.0\lib\netstandard2.0\Azure.Storage.Common.dll ..\packages\ClientDependency.1.9.7\lib\net45\ClientDependency.Core.dll @@ -120,12 +120,6 @@ ..\packages\Microsoft.AspNet.SignalR.Core.2.4.0\lib\net45\Microsoft.AspNet.SignalR.Core.dll - - ..\packages\Microsoft.Azure.ConfigurationManager.4.0.0\lib\net452\Microsoft.Azure.ConfigurationManager.dll - - - ..\packages\Microsoft.Azure.KeyVault.Core.3.0.3\lib\net452\Microsoft.Azure.KeyVault.Core.dll - ..\packages\Microsoft.Bcl.AsyncInterfaces.1.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll diff --git a/src/UmbracoFileSystemProviders.Azure.Tests/app.config b/src/UmbracoFileSystemProviders.Azure.Tests/app.config index 99df905..2ab61d5 100644 --- a/src/UmbracoFileSystemProviders.Azure.Tests/app.config +++ b/src/UmbracoFileSystemProviders.Azure.Tests/app.config @@ -132,7 +132,7 @@ - + diff --git a/src/UmbracoFileSystemProviders.Azure.Tests/packages.config b/src/UmbracoFileSystemProviders.Azure.Tests/packages.config index 9820aa2..6f66ebf 100644 --- a/src/UmbracoFileSystemProviders.Azure.Tests/packages.config +++ b/src/UmbracoFileSystemProviders.Azure.Tests/packages.config @@ -1,8 +1,8 @@  - - - + + + @@ -29,8 +29,6 @@ - - diff --git a/src/UmbracoFileSystemProviders.Azure/UmbracoFileSystemProviders.Azure.csproj b/src/UmbracoFileSystemProviders.Azure/UmbracoFileSystemProviders.Azure.csproj index cbc9c1e..26794f1 100644 --- a/src/UmbracoFileSystemProviders.Azure/UmbracoFileSystemProviders.Azure.csproj +++ b/src/UmbracoFileSystemProviders.Azure/UmbracoFileSystemProviders.Azure.csproj @@ -56,14 +56,14 @@ MinimumRecommendedRules.ruleset - - ..\packages\Azure.Core.1.14.0\lib\net461\Azure.Core.dll + + ..\packages\Azure.Core.1.18.0\lib\net461\Azure.Core.dll - - ..\packages\Azure.Storage.Blobs.12.8.3\lib\netstandard2.0\Azure.Storage.Blobs.dll + + ..\packages\Azure.Storage.Blobs.12.9.1\lib\netstandard2.0\Azure.Storage.Blobs.dll - - ..\packages\Azure.Storage.Common.12.7.2\lib\netstandard2.0\Azure.Storage.Common.dll + + ..\packages\Azure.Storage.Common.12.8.0\lib\netstandard2.0\Azure.Storage.Common.dll ..\packages\ClientDependency.1.9.7\lib\net45\ClientDependency.Core.dll @@ -120,12 +120,6 @@ ..\packages\Microsoft.AspNet.SignalR.Core.2.4.0\lib\net45\Microsoft.AspNet.SignalR.Core.dll - - ..\packages\Microsoft.Azure.ConfigurationManager.4.0.0\lib\net452\Microsoft.Azure.ConfigurationManager.dll - - - ..\packages\Microsoft.Azure.KeyVault.Core.3.0.3\lib\net452\Microsoft.Azure.KeyVault.Core.dll - ..\packages\Microsoft.Bcl.AsyncInterfaces.1.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll diff --git a/src/UmbracoFileSystemProviders.Azure/app.config b/src/UmbracoFileSystemProviders.Azure/app.config index 3d9e3f8..9240a30 100644 --- a/src/UmbracoFileSystemProviders.Azure/app.config +++ b/src/UmbracoFileSystemProviders.Azure/app.config @@ -92,7 +92,7 @@ - + diff --git a/src/UmbracoFileSystemProviders.Azure/packages.config b/src/UmbracoFileSystemProviders.Azure/packages.config index 011d0e9..5b6bce7 100644 --- a/src/UmbracoFileSystemProviders.Azure/packages.config +++ b/src/UmbracoFileSystemProviders.Azure/packages.config @@ -1,8 +1,8 @@  - - - + + + @@ -29,8 +29,6 @@ - - From 71288eeb0bfc18e801e1e3bc32273e9284c31252 Mon Sep 17 00:00:00 2001 From: Jeavon Leopold Date: Thu, 2 Sep 2021 09:54:24 +0100 Subject: [PATCH 13/15] Bump to beta3 --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index a1a46c0..df57074 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,7 +9,7 @@ configuration: Release environment: # Version Suffix - version_suffix: beta2 + version_suffix: beta3 install: - ps: .\build\appveyor-semver.ps1 From 20194fc52380aaef04791b392b9659f1266af56f Mon Sep 17 00:00:00 2001 From: Jeavon Leopold Date: Thu, 2 Sep 2021 10:15:51 +0100 Subject: [PATCH 14/15] Specifying <9 for Umbraco --- build/UmbracoFileSystemProviders.Azure.Forms.proj | 2 +- build/UmbracoFileSystemProviders.Azure.Media.proj | 2 +- build/UmbracoFileSystemProviders.Azure.proj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/UmbracoFileSystemProviders.Azure.Forms.proj b/build/UmbracoFileSystemProviders.Azure.Forms.proj index eb6e36c..7a79313 100644 --- a/build/UmbracoFileSystemProviders.Azure.Forms.proj +++ b/build/UmbracoFileSystemProviders.Azure.Forms.proj @@ -105,7 +105,7 @@ Description="$(Description)" Summary="$(Readme)" Version="$(FileVersion)" - MinimumRequiredUmbracoVersion ="$(MinUmbracoVersion)" + MinimumRequiredUmbracoVersion ="[$(MinUmbracoVersion),9.0.0)" Authors="$(AuthorName)" Owners="$(Owners)" Copyright="$(Copyright)" diff --git a/build/UmbracoFileSystemProviders.Azure.Media.proj b/build/UmbracoFileSystemProviders.Azure.Media.proj index 73c49a0..8b16fd3 100644 --- a/build/UmbracoFileSystemProviders.Azure.Media.proj +++ b/build/UmbracoFileSystemProviders.Azure.Media.proj @@ -136,7 +136,7 @@ Date: Thu, 9 Sep 2021 11:44:16 +0100 Subject: [PATCH 15/15] Fix max dependency --- build/UmbracoFileSystemProviders.Azure.Media.proj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/UmbracoFileSystemProviders.Azure.Media.proj b/build/UmbracoFileSystemProviders.Azure.Media.proj index 8b16fd3..3c58ff4 100644 --- a/build/UmbracoFileSystemProviders.Azure.Media.proj +++ b/build/UmbracoFileSystemProviders.Azure.Media.proj @@ -136,7 +136,7 @@