Skip to content

Commit e4328b2

Browse files
authored
Update DataProtection.AzureStorage to use latest Azure SDK dependency (Microsoft.Azure.Storage.Blob) (#9465)
1 parent 16abec1 commit e4328b2

10 files changed

+29
-28
lines changed

eng/Dependencies.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ and are generated based on the last package release.
4141
<LatestPackageReference Include="Microsoft.AspNetCore.Razor.Language" Version="$(MicrosoftAspNetCoreRazorLanguagePackageVersion)" />
4242
<LatestPackageReference Include="Microsoft.AspNetCore.Testing" Version="$(MicrosoftAspNetCoreTestingPackageVersion)" />
4343
<LatestPackageReference Include="Microsoft.Azure.KeyVault" Version="$(MicrosoftAzureKeyVaultPackageVersion)" />
44+
<LatestPackageReference Include="Microsoft.Azure.Storage.Blob" Version="$(MicrosoftAzureStorageBlobPackageVersion)" />
4445
<LatestPackageReference Include="Microsoft.Bcl.Json.Sources" Version="$(MicrosoftBclJsonSourcesPackageVersion)" />
4546
<LatestPackageReference Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildFrameworkPackageVersion)" />
4647
<LatestPackageReference Include="Microsoft.Build.Utilities.Core" Version="$(MicrosoftBuildUtilitiesCorePackageVersion)" />
@@ -159,7 +160,6 @@ and are generated based on the last package release.
159160
<LatestPackageReference Include="System.Threading.Channels" Version="$(SystemThreadingChannelsPackageVersion)" />
160161
<LatestPackageReference Include="System.Threading.Tasks.Extensions" Version="$(SystemThreadingTasksExtensionsPackageVersion)" />
161162
<LatestPackageReference Include="Utf8Json" Version="$(Utf8JsonPackageVersion)" />
162-
<LatestPackageReference Include="WindowsAzure.Storage" Version="$(WindowsAzureStoragePackageVersion)" />
163163
<LatestPackageReference Include="xunit.abstractions" Version="$(XunitAbstractionsPackageVersion)" />
164164
<LatestPackageReference Include="xunit.analyzers" Version="$(XunitAnalyzersPackageVersion)" />
165165
<LatestPackageReference Include="xunit.assert" Version="$(XunitAssertPackageVersion)" />

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@
146146
<MicrosoftAspNetWebApiClientPackageVersion>5.2.6</MicrosoftAspNetWebApiClientPackageVersion>
147147
<!-- Partner teams -->
148148
<MicrosoftAzureKeyVaultPackageVersion>2.3.2</MicrosoftAzureKeyVaultPackageVersion>
149+
<MicrosoftAzureStorageBlobPackageVersion>10.0.1</MicrosoftAzureStorageBlobPackageVersion>
149150
<MicrosoftBuildFrameworkPackageVersion>15.8.166</MicrosoftBuildFrameworkPackageVersion>
150151
<MicrosoftBuildUtilitiesCorePackageVersion>15.8.166</MicrosoftBuildUtilitiesCorePackageVersion>
151152
<MicrosoftCodeAnalysisCommonPackageVersion>2.8.0</MicrosoftCodeAnalysisCommonPackageVersion>
@@ -162,7 +163,6 @@
162163
<MicrosoftWebAdministrationPackageVersion>11.1.0</MicrosoftWebAdministrationPackageVersion>
163164
<MicrosoftWebXdtPackageVersion>1.4.0</MicrosoftWebXdtPackageVersion>
164165
<SystemIdentityModelTokensJwtPackageVersion>5.3.0</SystemIdentityModelTokensJwtPackageVersion>
165-
<WindowsAzureStoragePackageVersion>8.1.4</WindowsAzureStoragePackageVersion>
166166
<!-- Dependencies for Blazor. -->
167167
<MicrosoftAspNetCoreBlazorMonoPackageVersion>0.10.0-preview-20190325.1</MicrosoftAspNetCoreBlazorMonoPackageVersion>
168168
<!-- Packages from 2.1/2.2 branches used for site extension build -->

src/DataProtection/AzureStorage/ref/Microsoft.AspNetCore.DataProtection.AzureStorage.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
77
<Compile Include="Microsoft.AspNetCore.DataProtection.AzureStorage.netcoreapp3.0.cs" />
88
<Reference Include="Microsoft.AspNetCore.DataProtection" />
9-
<Reference Include="WindowsAzure.Storage" />
9+
<Reference Include="Microsoft.Azure.Storage.Blob" />
1010
</ItemGroup>
1111
</Project>

src/DataProtection/AzureStorage/ref/Microsoft.AspNetCore.DataProtection.AzureStorage.netcoreapp3.0.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ namespace Microsoft.AspNetCore.DataProtection
55
{
66
public static partial class AzureDataProtectionBuilderExtensions
77
{
8-
public static Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder PersistKeysToAzureBlobStorage(this Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder builder, Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer container, string blobName) { throw null; }
9-
public static Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder PersistKeysToAzureBlobStorage(this Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder builder, Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob blobReference) { throw null; }
10-
public static Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder PersistKeysToAzureBlobStorage(this Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder builder, Microsoft.WindowsAzure.Storage.CloudStorageAccount storageAccount, string relativePath) { throw null; }
8+
public static Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder PersistKeysToAzureBlobStorage(this Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder builder, Microsoft.Azure.Storage.Blob.CloudBlobContainer container, string blobName) { throw null; }
9+
public static Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder PersistKeysToAzureBlobStorage(this Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder builder, Microsoft.Azure.Storage.Blob.CloudBlockBlob blobReference) { throw null; }
10+
public static Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder PersistKeysToAzureBlobStorage(this Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder builder, Microsoft.Azure.Storage.CloudStorageAccount storageAccount, string relativePath) { throw null; }
1111
public static Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder PersistKeysToAzureBlobStorage(this Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder builder, System.Uri blobUri) { throw null; }
1212
}
1313
}
1414
namespace Microsoft.AspNetCore.DataProtection.AzureStorage
1515
{
1616
public sealed partial class AzureBlobXmlRepository : Microsoft.AspNetCore.DataProtection.Repositories.IXmlRepository
1717
{
18-
public AzureBlobXmlRepository(System.Func<Microsoft.WindowsAzure.Storage.Blob.ICloudBlob> blobRefFactory) { }
18+
public AzureBlobXmlRepository(System.Func<Microsoft.Azure.Storage.Blob.ICloudBlob> blobRefFactory) { }
1919
public System.Collections.Generic.IReadOnlyCollection<System.Xml.Linq.XElement> GetAllElements() { throw null; }
2020
public void StoreElement(System.Xml.Linq.XElement element, string friendlyName) { }
2121
}

src/DataProtection/AzureStorage/src/AzureBlobXmlRepository.cs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) .NET Foundation. All rights reserved.
1+
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
@@ -12,8 +12,8 @@
1212
using System.Xml;
1313
using System.Xml.Linq;
1414
using Microsoft.AspNetCore.DataProtection.Repositories;
15-
using Microsoft.WindowsAzure.Storage;
16-
using Microsoft.WindowsAzure.Storage.Blob;
15+
using Microsoft.Azure.Storage;
16+
using Microsoft.Azure.Storage.Blob;
1717

1818
namespace Microsoft.AspNetCore.DataProtection.AzureStorage
1919
{
@@ -42,12 +42,7 @@ public sealed class AzureBlobXmlRepository : IXmlRepository
4242
/// concurrent threads, and each invocation must return a new object.</param>
4343
public AzureBlobXmlRepository(Func<ICloudBlob> blobRefFactory)
4444
{
45-
if (blobRefFactory == null)
46-
{
47-
throw new ArgumentNullException(nameof(blobRefFactory));
48-
}
49-
50-
_blobRefFactory = blobRefFactory;
45+
_blobRefFactory = blobRefFactory ?? throw new ArgumentNullException(nameof(blobRefFactory));
5146
_random = new Random();
5247
}
5348

src/DataProtection/AzureStorage/src/AzureDataProtectionBuilderExtensions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
// Copyright (c) .NET Foundation. All rights reserved.
1+
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
55
using Microsoft.AspNetCore.DataProtection.AzureStorage;
66
using Microsoft.AspNetCore.DataProtection.KeyManagement;
7+
using Microsoft.Azure.Storage;
8+
using Microsoft.Azure.Storage.Auth;
9+
using Microsoft.Azure.Storage.Blob;
710
using Microsoft.Extensions.DependencyInjection;
8-
using Microsoft.WindowsAzure.Storage;
9-
using Microsoft.WindowsAzure.Storage.Auth;
10-
using Microsoft.WindowsAzure.Storage.Blob;
1111

1212
namespace Microsoft.AspNetCore.DataProtection
1313
{

src/DataProtection/AzureStorage/src/Microsoft.AspNetCore.DataProtection.AzureStorage.csproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111

1212
<ItemGroup>
1313
<Reference Include="Microsoft.AspNetCore.DataProtection" />
14-
<Reference Include="WindowsAzure.Storage" />
14+
<Reference Include="Microsoft.Azure.Storage.Blob" />
15+
</ItemGroup>
16+
17+
<ItemGroup Condition="'$(AspNetCoreMajorMinorVersion)' == '3.0'">
18+
<!-- This dependency was replaced by Microsoft.Azure.Storage.Blob between 3.0 and 2.2. This suppression can be removed after 3.0 is complete. -->
19+
<SuppressBaselineReference Include="WindowsAzure.Storage" />
1520
</ItemGroup>
1621

1722
</Project>

src/DataProtection/AzureStorage/test/AzureBlobXmlRepositoryTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
// Copyright (c) .NET Foundation. All rights reserved.
1+
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System.IO;
55
using System.Linq;
66
using System.Text;
77
using System.Threading.Tasks;
88
using System.Xml.Linq;
9-
using Microsoft.WindowsAzure.Storage;
10-
using Microsoft.WindowsAzure.Storage.Blob;
9+
using Microsoft.Azure.Storage;
10+
using Microsoft.Azure.Storage.Blob;
1111
using Moq;
1212
using Xunit;
1313

src/DataProtection/AzureStorage/test/AzureDataProtectionBuilderExtensionsTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
// Copyright (c) .NET Foundation. All rights reserved.
1+
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
55
using Microsoft.AspNetCore.DataProtection.KeyManagement;
66
using Microsoft.Extensions.DependencyInjection;
77
using Microsoft.Extensions.Options;
8-
using Microsoft.WindowsAzure.Storage.Blob;
8+
using Microsoft.Azure.Storage.Blob;
99
using Xunit;
1010

1111
namespace Microsoft.AspNetCore.DataProtection.AzureStorage

src/DataProtection/samples/AzureBlob/Program.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
// Copyright (c) .NET Foundation. All rights reserved.
1+
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
55
using Microsoft.AspNetCore.DataProtection;
6+
using Microsoft.Azure.Storage;
7+
using Microsoft.Azure.Storage.Blob;
68
using Microsoft.Extensions.DependencyInjection;
79
using Microsoft.Extensions.Logging;
8-
using Microsoft.WindowsAzure.Storage;
910
using LogLevel = Microsoft.Extensions.Logging.LogLevel;
1011

1112
namespace AzureBlob

0 commit comments

Comments
 (0)