From d976dde4e21ed3e4209d33dcba12b5d7ded8831c Mon Sep 17 00:00:00 2001 From: Mark Hopkins Date: Wed, 24 Apr 2019 13:33:54 -0700 Subject: [PATCH 1/5] Updated to use the latest NuGet packages --- BlobStorage/Advanced.cs | 11 +++---- BlobStorage/App.config | 8 +++-- BlobStorage/BlobStorage.csproj | 43 ++++++++++++-------------- BlobStorage/Common.cs | 2 +- BlobStorage/GettingStarted.cs | 8 ++--- BlobStorage/WCFBufferManagerAdapter.cs | 2 +- BlobStorage/packages.config | 17 +++++----- 7 files changed, 45 insertions(+), 46 deletions(-) diff --git a/BlobStorage/Advanced.cs b/BlobStorage/Advanced.cs index 92eecf4..805b871 100644 --- a/BlobStorage/Advanced.cs +++ b/BlobStorage/Advanced.cs @@ -16,6 +16,11 @@ namespace BlobStorage { + using Microsoft.Azure; + using Microsoft.Azure.Storage; + using Microsoft.Azure.Storage.Blob; + using Microsoft.Azure.Storage.RetryPolicies; + using Microsoft.Azure.Storage.Shared.Protocol; using System; using System.Collections.Generic; using System.IO; @@ -24,12 +29,6 @@ namespace BlobStorage using System.ServiceModel.Channels; using System.Text; using System.Threading.Tasks; - using Microsoft.Azure; - using Microsoft.WindowsAzure.Storage; - using Microsoft.WindowsAzure.Storage.Auth; - using Microsoft.WindowsAzure.Storage.Blob; - using Microsoft.WindowsAzure.Storage.RetryPolicies; - using Microsoft.WindowsAzure.Storage.Shared.Protocol; /// /// Advanced samples for Blob storage, including samples demonstrating a variety of client library classes and methods. diff --git a/BlobStorage/App.config b/BlobStorage/App.config index b0a3e5c..e2068c9 100644 --- a/BlobStorage/App.config +++ b/BlobStorage/App.config @@ -7,7 +7,7 @@ second connection string. Insert your storage account name and key in the placeholders in the line below. We recommend creating a new storage account for testing purposes, rather than using a production account for running the samples.--> - + @@ -25,7 +25,11 @@ - + + + + + diff --git a/BlobStorage/BlobStorage.csproj b/BlobStorage/BlobStorage.csproj index 21aedcf..46ebec1 100644 --- a/BlobStorage/BlobStorage.csproj +++ b/BlobStorage/BlobStorage.csproj @@ -33,40 +33,35 @@ 4 - - ..\packages\Microsoft.Azure.KeyVault.Core.1.0.0\lib\net40\Microsoft.Azure.KeyVault.Core.dll - True + + ..\packages\Microsoft.Azure.ConfigurationManager.4.0.0\lib\net452\Microsoft.Azure.ConfigurationManager.dll - - ..\packages\Microsoft.Data.Edm.5.7.0\lib\net40\Microsoft.Data.Edm.dll - True + + ..\packages\Microsoft.Azure.KeyVault.Core.3.0.3\lib\net452\Microsoft.Azure.KeyVault.Core.dll - - ..\packages\Microsoft.Data.OData.5.7.0\lib\net40\Microsoft.Data.OData.dll - True + + ..\packages\Microsoft.Azure.Storage.Blob.10.0.1\lib\net452\Microsoft.Azure.Storage.Blob.dll - - ..\packages\Microsoft.Data.Services.Client.5.7.0\lib\net40\Microsoft.Data.Services.Client.dll - True + + ..\packages\Microsoft.Azure.Storage.Common.10.0.1\lib\net452\Microsoft.Azure.Storage.Common.dll - - ..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.1\lib\net40\Microsoft.WindowsAzure.Configuration.dll - True + + ..\packages\Microsoft.Data.Edm.5.8.4\lib\net40\Microsoft.Data.Edm.dll - - ..\packages\WindowsAzure.Storage.7.0.0\lib\net40\Microsoft.WindowsAzure.Storage.dll - True + + ..\packages\Microsoft.Data.OData.5.8.4\lib\net40\Microsoft.Data.OData.dll - - ..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll - True + + ..\packages\Microsoft.Data.Services.Client.5.8.4\lib\net40\Microsoft.Data.Services.Client.dll + + + ..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll - - ..\packages\System.Spatial.5.7.0\lib\net40\System.Spatial.dll - True + + ..\packages\System.Spatial.5.8.4\lib\net40\System.Spatial.dll diff --git a/BlobStorage/Common.cs b/BlobStorage/Common.cs index 033e88e..7de7a88 100644 --- a/BlobStorage/Common.cs +++ b/BlobStorage/Common.cs @@ -19,7 +19,7 @@ namespace BlobStorage { using System; using Microsoft.Azure; - using Microsoft.WindowsAzure.Storage; + using Microsoft.Azure.Storage; /// /// Contains public method for validating the storage connection string. diff --git a/BlobStorage/GettingStarted.cs b/BlobStorage/GettingStarted.cs index 0a10485..53093dc 100644 --- a/BlobStorage/GettingStarted.cs +++ b/BlobStorage/GettingStarted.cs @@ -20,10 +20,10 @@ namespace BlobStorage using System.IO; using System.Linq; using System.Threading.Tasks; - using Microsoft.WindowsAzure.Storage; - using Microsoft.WindowsAzure.Storage.Auth; - using Microsoft.WindowsAzure.Storage.Blob; - using Microsoft.WindowsAzure.Storage.RetryPolicies; + using Microsoft.Azure.Storage; + using Microsoft.Azure.Storage.Auth; + using Microsoft.Azure.Storage.Blob; + using Microsoft.Azure.Storage.RetryPolicies; /// /// Getting started samples for Blob storage diff --git a/BlobStorage/WCFBufferManagerAdapter.cs b/BlobStorage/WCFBufferManagerAdapter.cs index fe490ef..c40d2f7 100644 --- a/BlobStorage/WCFBufferManagerAdapter.cs +++ b/BlobStorage/WCFBufferManagerAdapter.cs @@ -1,5 +1,5 @@ using System.ServiceModel.Channels; -using Microsoft.WindowsAzure.Storage; +using Microsoft.Azure.Storage; namespace BlobStorage { diff --git a/BlobStorage/packages.config b/BlobStorage/packages.config index f5c5eb9..a86b8c0 100644 --- a/BlobStorage/packages.config +++ b/BlobStorage/packages.config @@ -1,11 +1,12 @@  - - - - - - - - + + + + + + + + + \ No newline at end of file From 287a7ac2a0ade9f0eba92269b376bd1707d49b84 Mon Sep 17 00:00:00 2001 From: Mark Hopkins Date: Wed, 24 Apr 2019 13:35:57 -0700 Subject: [PATCH 2/5] Update App.config --- BlobStorage/App.config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BlobStorage/App.config b/BlobStorage/App.config index e2068c9..c9cc6d4 100644 --- a/BlobStorage/App.config +++ b/BlobStorage/App.config @@ -7,7 +7,7 @@ second connection string. Insert your storage account name and key in the placeholders in the line below. We recommend creating a new storage account for testing purposes, rather than using a production account for running the samples.--> - + @@ -33,4 +33,4 @@ - \ No newline at end of file + From d5d51592cb6f16e63c719ebcc68f3fc5a88e6b04 Mon Sep 17 00:00:00 2001 From: Mark Hopkins Date: Wed, 24 Apr 2019 13:42:26 -0700 Subject: [PATCH 3/5] Spaces Removed extraneous spaces --- BlobStorage/App.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BlobStorage/App.config b/BlobStorage/App.config index c9cc6d4..969b7ea 100644 --- a/BlobStorage/App.config +++ b/BlobStorage/App.config @@ -7,7 +7,7 @@ second connection string. Insert your storage account name and key in the placeholders in the line below. We recommend creating a new storage account for testing purposes, rather than using a production account for running the samples.--> - + From abaf1b7d81e273fee281fa7963970ea270bc06b0 Mon Sep 17 00:00:00 2001 From: Mark Hopkins Date: Tue, 7 May 2019 14:03:34 -0700 Subject: [PATCH 4/5] Updated to latest NuGet packages. --- .gitignore | 1 + BlobStorage/Advanced.cs | 48 +--------------------------------- BlobStorage/App.config | 6 ++--- BlobStorage/BlobStorage.csproj | 11 ++++---- BlobStorage/packages.config | 4 +-- 5 files changed, 13 insertions(+), 57 deletions(-) diff --git a/.gitignore b/.gitignore index d74a876..656aa31 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ BlobStorage/StyleCop.cache *.nupkg packages/* *.ps1 +.vs/* diff --git a/BlobStorage/Advanced.cs b/BlobStorage/Advanced.cs index 805b871..0e1079e 100644 --- a/BlobStorage/Advanced.cs +++ b/BlobStorage/Advanced.cs @@ -111,7 +111,6 @@ public static async Task CallBlobAdvancedSamples() // The sample code deletes any containers it created if it runs completely. However, if you need to delete containers // created by previous sessions (for example, if you interrupted the running code before it completed), // you can uncomment and run the following line to delete them. - //await DeleteContainersWithPrefix(blobClient, ContainerPrefix); // Return the service properties/storage analytics settings to their original values. @@ -137,9 +136,6 @@ private static async Task CallBlobClientSamples(CloudBlobClient blobClient) // Configure storage analytics (metrics and logging) on Blob storage. await ConfigureBlobAnalyticsAsync(blobClient); - // Get geo-replication stats for Blob storage. - await GetServiceStatsForSecondaryAsync(blobClient); - // List all containers in the storage account. ListAllContainers(blobClient, "sample-"); @@ -328,7 +324,7 @@ private static async Task ConfigureBlobAnalyticsAsync(CloudBlobClient blobClient serviceProperties.MinuteMetrics.Version = "1.0"; // Set the default service version to be used for anonymous requests. - serviceProperties.DefaultServiceVersion = "2015-04-05"; + serviceProperties.DefaultServiceVersion = "2018-11-09"; // Set the service properties. await blobClient.SetServicePropertiesAsync(serviceProperties); @@ -341,48 +337,6 @@ private static async Task ConfigureBlobAnalyticsAsync(CloudBlobClient blobClient } } - /// - /// Gets the Blob service stats for the secondary endpoint for an RA-GRS (read-access geo-redundant) storage account. - /// - /// The Blob service client. - /// A Task object. - private static async Task GetServiceStatsForSecondaryAsync(CloudBlobClient blobClient) - { - try - { - // Get the URI for the secondary endpoint for Blob storage. - Uri secondaryUri = blobClient.StorageUri.SecondaryUri; - - // Create a new service client based on the secondary endpoint. - CloudBlobClient blobClientSecondary = new CloudBlobClient(secondaryUri, blobClient.Credentials); - - // Get the current stats for the secondary. - // The call will fail if your storage account does not have RA-GRS enabled. - ServiceStats blobStats = await blobClientSecondary.GetServiceStatsAsync(); - - Console.WriteLine("Geo-replication status: {0}", blobStats.GeoReplication.Status); - Console.WriteLine("Last geo-replication sync time: {0}", blobStats.GeoReplication.LastSyncTime); - Console.WriteLine(); - } - catch (StorageException e) - { - // In this case, we do not re-throw the exception, so that the sample will continue to run even if RA-GRS is not enabled - // for this storage account. - if (e.RequestInformation.HttpStatusCode == 403) - { - Console.WriteLine("This storage account does not appear to support RA-GRS."); - Console.WriteLine("More information: {0}", e.Message); - Console.WriteLine(); - } - else - { - Console.WriteLine(e.Message); - Console.ReadLine(); - throw; - } - } - } - /// /// Lists all containers in the storage account. /// Note that the ListContainers method is called synchronously, for the purposes of the sample. However, in a real-world diff --git a/BlobStorage/App.config b/BlobStorage/App.config index e2068c9..2f2931b 100644 --- a/BlobStorage/App.config +++ b/BlobStorage/App.config @@ -6,8 +6,8 @@ you can create a storage account and run against Azure Storage. Comment out the connection string below and use the second connection string. Insert your storage account name and key in the placeholders in the line below. We recommend creating a new storage account for testing purposes, rather than using a production account for running the samples.--> - - + + @@ -33,4 +33,4 @@ - \ No newline at end of file + diff --git a/BlobStorage/BlobStorage.csproj b/BlobStorage/BlobStorage.csproj index 46ebec1..586eb22 100644 --- a/BlobStorage/BlobStorage.csproj +++ b/BlobStorage/BlobStorage.csproj @@ -9,9 +9,10 @@ Properties BlobStorage BlobStorage - v4.5.2 + v4.7.2 512 true + AnyCPU @@ -39,11 +40,11 @@ ..\packages\Microsoft.Azure.KeyVault.Core.3.0.3\lib\net452\Microsoft.Azure.KeyVault.Core.dll - - ..\packages\Microsoft.Azure.Storage.Blob.10.0.1\lib\net452\Microsoft.Azure.Storage.Blob.dll + + ..\packages\Microsoft.Azure.Storage.Blob.10.0.2\lib\net452\Microsoft.Azure.Storage.Blob.dll - - ..\packages\Microsoft.Azure.Storage.Common.10.0.1\lib\net452\Microsoft.Azure.Storage.Common.dll + + ..\packages\Microsoft.Azure.Storage.Common.10.0.2\lib\net452\Microsoft.Azure.Storage.Common.dll ..\packages\Microsoft.Data.Edm.5.8.4\lib\net40\Microsoft.Data.Edm.dll diff --git a/BlobStorage/packages.config b/BlobStorage/packages.config index a86b8c0..9c78b18 100644 --- a/BlobStorage/packages.config +++ b/BlobStorage/packages.config @@ -2,8 +2,8 @@ - - + + From 0b340edf28b0b212c8662100a82d95af8e0d1e7f Mon Sep 17 00:00:00 2001 From: Mark Hopkins Date: Tue, 7 May 2019 14:15:01 -0700 Subject: [PATCH 5/5] Resolving merge conflicts. --- BlobStorage/App.config | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/BlobStorage/App.config b/BlobStorage/App.config index 2cbcd08..07a6dcf 100644 --- a/BlobStorage/App.config +++ b/BlobStorage/App.config @@ -33,8 +33,5 @@ -<<<<<<< HEAD - -======= + ->>>>>>> d5d51592cb6f16e63c719ebcc68f3fc5a88e6b04