Skip to content

Update DataProtection.AzureStorage to use latest Azure SDK dependency (Microsoft.Azure.Storage.Blob) #9465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/Dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ and are generated based on the last package release.
<LatestPackageReference Include="Microsoft.AspNetCore.Razor.Language" Version="$(MicrosoftAspNetCoreRazorLanguagePackageVersion)" />
<LatestPackageReference Include="Microsoft.AspNetCore.Testing" Version="$(MicrosoftAspNetCoreTestingPackageVersion)" />
<LatestPackageReference Include="Microsoft.Azure.KeyVault" Version="$(MicrosoftAzureKeyVaultPackageVersion)" />
<LatestPackageReference Include="Microsoft.Azure.Storage.Blob" Version="$(MicrosoftAzureStorageBlobPackageVersion)" />
<LatestPackageReference Include="Microsoft.Bcl.Json.Sources" Version="$(MicrosoftBclJsonSourcesPackageVersion)" />
<LatestPackageReference Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildFrameworkPackageVersion)" />
<LatestPackageReference Include="Microsoft.Build.Utilities.Core" Version="$(MicrosoftBuildUtilitiesCorePackageVersion)" />
Expand Down Expand Up @@ -159,7 +160,6 @@ and are generated based on the last package release.
<LatestPackageReference Include="System.Threading.Channels" Version="$(SystemThreadingChannelsPackageVersion)" />
<LatestPackageReference Include="System.Threading.Tasks.Extensions" Version="$(SystemThreadingTasksExtensionsPackageVersion)" />
<LatestPackageReference Include="Utf8Json" Version="$(Utf8JsonPackageVersion)" />
<LatestPackageReference Include="WindowsAzure.Storage" Version="$(WindowsAzureStoragePackageVersion)" />
<LatestPackageReference Include="xunit.abstractions" Version="$(XunitAbstractionsPackageVersion)" />
<LatestPackageReference Include="xunit.analyzers" Version="$(XunitAnalyzersPackageVersion)" />
<LatestPackageReference Include="xunit.assert" Version="$(XunitAssertPackageVersion)" />
Expand Down
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
<MicrosoftAspNetWebApiClientPackageVersion>5.2.6</MicrosoftAspNetWebApiClientPackageVersion>
<!-- Partner teams -->
<MicrosoftAzureKeyVaultPackageVersion>2.3.2</MicrosoftAzureKeyVaultPackageVersion>
<MicrosoftAzureStorageBlobPackageVersion>10.0.1</MicrosoftAzureStorageBlobPackageVersion>
<MicrosoftBuildFrameworkPackageVersion>15.8.166</MicrosoftBuildFrameworkPackageVersion>
<MicrosoftBuildUtilitiesCorePackageVersion>15.8.166</MicrosoftBuildUtilitiesCorePackageVersion>
<MicrosoftCodeAnalysisCommonPackageVersion>2.8.0</MicrosoftCodeAnalysisCommonPackageVersion>
Expand All @@ -162,7 +163,6 @@
<MicrosoftWebAdministrationPackageVersion>11.1.0</MicrosoftWebAdministrationPackageVersion>
<MicrosoftWebXdtPackageVersion>1.4.0</MicrosoftWebXdtPackageVersion>
<SystemIdentityModelTokensJwtPackageVersion>5.3.0</SystemIdentityModelTokensJwtPackageVersion>
<WindowsAzureStoragePackageVersion>8.1.4</WindowsAzureStoragePackageVersion>
<!-- Dependencies for Blazor. -->
<MicrosoftAspNetCoreBlazorMonoPackageVersion>0.10.0-preview-20190325.1</MicrosoftAspNetCoreBlazorMonoPackageVersion>
<!-- Packages from 2.1/2.2 branches used for site extension build -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<Compile Include="Microsoft.AspNetCore.DataProtection.AzureStorage.netcoreapp3.0.cs" />
<Reference Include="Microsoft.AspNetCore.DataProtection" />
<Reference Include="WindowsAzure.Storage" />
<Reference Include="Microsoft.Azure.Storage.Blob" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ namespace Microsoft.AspNetCore.DataProtection
{
public static partial class AzureDataProtectionBuilderExtensions
{
public static Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder PersistKeysToAzureBlobStorage(this Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder builder, Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer container, string blobName) { throw null; }
public static Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder PersistKeysToAzureBlobStorage(this Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder builder, Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob blobReference) { throw null; }
public static Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder PersistKeysToAzureBlobStorage(this Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder builder, Microsoft.WindowsAzure.Storage.CloudStorageAccount storageAccount, string relativePath) { throw null; }
public static Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder PersistKeysToAzureBlobStorage(this Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder builder, Microsoft.Azure.Storage.Blob.CloudBlobContainer container, string blobName) { throw null; }
public static Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder PersistKeysToAzureBlobStorage(this Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder builder, Microsoft.Azure.Storage.Blob.CloudBlockBlob blobReference) { throw null; }
public static Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder PersistKeysToAzureBlobStorage(this Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder builder, Microsoft.Azure.Storage.CloudStorageAccount storageAccount, string relativePath) { throw null; }
public static Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder PersistKeysToAzureBlobStorage(this Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder builder, System.Uri blobUri) { throw null; }
}
}
namespace Microsoft.AspNetCore.DataProtection.AzureStorage
{
public sealed partial class AzureBlobXmlRepository : Microsoft.AspNetCore.DataProtection.Repositories.IXmlRepository
{
public AzureBlobXmlRepository(System.Func<Microsoft.WindowsAzure.Storage.Blob.ICloudBlob> blobRefFactory) { }
public AzureBlobXmlRepository(System.Func<Microsoft.Azure.Storage.Blob.ICloudBlob> blobRefFactory) { }
public System.Collections.Generic.IReadOnlyCollection<System.Xml.Linq.XElement> GetAllElements() { throw null; }
public void StoreElement(System.Xml.Linq.XElement element, string friendlyName) { }
}
Expand Down
13 changes: 4 additions & 9 deletions src/DataProtection/AzureStorage/src/AzureBlobXmlRepository.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
Expand All @@ -12,8 +12,8 @@
using System.Xml;
using System.Xml.Linq;
using Microsoft.AspNetCore.DataProtection.Repositories;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Blob;
using Microsoft.Azure.Storage;
using Microsoft.Azure.Storage.Blob;

namespace Microsoft.AspNetCore.DataProtection.AzureStorage
{
Expand Down Expand Up @@ -42,12 +42,7 @@ public sealed class AzureBlobXmlRepository : IXmlRepository
/// concurrent threads, and each invocation must return a new object.</param>
public AzureBlobXmlRepository(Func<ICloudBlob> blobRefFactory)
{
if (blobRefFactory == null)
{
throw new ArgumentNullException(nameof(blobRefFactory));
}

_blobRefFactory = blobRefFactory;
_blobRefFactory = blobRefFactory ?? throw new ArgumentNullException(nameof(blobRefFactory));
_random = new Random();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using Microsoft.AspNetCore.DataProtection.AzureStorage;
using Microsoft.AspNetCore.DataProtection.KeyManagement;
using Microsoft.Azure.Storage;
using Microsoft.Azure.Storage.Auth;
using Microsoft.Azure.Storage.Blob;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Auth;
using Microsoft.WindowsAzure.Storage.Blob;

namespace Microsoft.AspNetCore.DataProtection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@

<ItemGroup>
<Reference Include="Microsoft.AspNetCore.DataProtection" />
<Reference Include="WindowsAzure.Storage" />
<Reference Include="Microsoft.Azure.Storage.Blob" />
</ItemGroup>

<ItemGroup Condition="'$(AspNetCoreMajorMinorVersion)' == '3.0'">
<!-- 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. -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to file a bug to remember this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened #9473 and put it in the 3.1 milestone. It's not super urgent because I've written this code to only apply when building 3.0. But yes, can be deleted later when it effectively becomes dead code.

<SuppressBaselineReference Include="WindowsAzure.Storage" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Blob;
using Microsoft.Azure.Storage;
using Microsoft.Azure.Storage.Blob;
using Moq;
using Xunit;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using Microsoft.AspNetCore.DataProtection.KeyManagement;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Microsoft.WindowsAzure.Storage.Blob;
using Microsoft.Azure.Storage.Blob;
using Xunit;

namespace Microsoft.AspNetCore.DataProtection.AzureStorage
Expand Down
5 changes: 3 additions & 2 deletions src/DataProtection/samples/AzureBlob/Program.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.Azure.Storage;
using Microsoft.Azure.Storage.Blob;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.WindowsAzure.Storage;
using LogLevel = Microsoft.Extensions.Logging.LogLevel;

namespace AzureBlob
Expand Down