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 92eecf4..0e1079e 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. @@ -112,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. @@ -138,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-"); @@ -329,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); @@ -342,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 b0a3e5c..07a6dcf 100644 --- a/BlobStorage/App.config +++ b/BlobStorage/App.config @@ -25,8 +25,13 @@ - + + + + + - \ No newline at end of file + + diff --git a/BlobStorage/BlobStorage.csproj b/BlobStorage/BlobStorage.csproj index 21aedcf..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 @@ -33,40 +34,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.2\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.2\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..9c78b18 100644 --- a/BlobStorage/packages.config +++ b/BlobStorage/packages.config @@ -1,11 +1,12 @@  - - - - - - - - + + + + + + + + + \ No newline at end of file