@@ -111,7 +111,6 @@ public static async Task CallBlobAdvancedSamples()
111111 // The sample code deletes any containers it created if it runs completely. However, if you need to delete containers
112112 // created by previous sessions (for example, if you interrupted the running code before it completed),
113113 // you can uncomment and run the following line to delete them.
114-
115114 //await DeleteContainersWithPrefix(blobClient, ContainerPrefix);
116115
117116 // Return the service properties/storage analytics settings to their original values.
@@ -137,9 +136,6 @@ private static async Task CallBlobClientSamples(CloudBlobClient blobClient)
137136 // Configure storage analytics (metrics and logging) on Blob storage.
138137 await ConfigureBlobAnalyticsAsync ( blobClient ) ;
139138
140- // Get geo-replication stats for Blob storage.
141- await GetServiceStatsForSecondaryAsync ( blobClient ) ;
142-
143139 // List all containers in the storage account.
144140 ListAllContainers ( blobClient , "sample-" ) ;
145141
@@ -328,7 +324,7 @@ private static async Task ConfigureBlobAnalyticsAsync(CloudBlobClient blobClient
328324 serviceProperties . MinuteMetrics . Version = "1.0" ;
329325
330326 // Set the default service version to be used for anonymous requests.
331- serviceProperties . DefaultServiceVersion = "2015-04-05 " ;
327+ serviceProperties . DefaultServiceVersion = "2018-11-09 " ;
332328
333329 // Set the service properties.
334330 await blobClient . SetServicePropertiesAsync ( serviceProperties ) ;
@@ -341,48 +337,6 @@ private static async Task ConfigureBlobAnalyticsAsync(CloudBlobClient blobClient
341337 }
342338 }
343339
344- /// <summary>
345- /// Gets the Blob service stats for the secondary endpoint for an RA-GRS (read-access geo-redundant) storage account.
346- /// </summary>
347- /// <param name="blobClient">The Blob service client.</param>
348- /// <returns>A Task object.</returns>
349- private static async Task GetServiceStatsForSecondaryAsync ( CloudBlobClient blobClient )
350- {
351- try
352- {
353- // Get the URI for the secondary endpoint for Blob storage.
354- Uri secondaryUri = blobClient . StorageUri . SecondaryUri ;
355-
356- // Create a new service client based on the secondary endpoint.
357- CloudBlobClient blobClientSecondary = new CloudBlobClient ( secondaryUri , blobClient . Credentials ) ;
358-
359- // Get the current stats for the secondary.
360- // The call will fail if your storage account does not have RA-GRS enabled.
361- ServiceStats blobStats = await blobClientSecondary . GetServiceStatsAsync ( ) ;
362-
363- Console . WriteLine ( "Geo-replication status: {0}" , blobStats . GeoReplication . Status ) ;
364- Console . WriteLine ( "Last geo-replication sync time: {0}" , blobStats . GeoReplication . LastSyncTime ) ;
365- Console . WriteLine ( ) ;
366- }
367- catch ( StorageException e )
368- {
369- // 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
370- // for this storage account.
371- if ( e . RequestInformation . HttpStatusCode == 403 )
372- {
373- Console . WriteLine ( "This storage account does not appear to support RA-GRS." ) ;
374- Console . WriteLine ( "More information: {0}" , e . Message ) ;
375- Console . WriteLine ( ) ;
376- }
377- else
378- {
379- Console . WriteLine ( e . Message ) ;
380- Console . ReadLine ( ) ;
381- throw ;
382- }
383- }
384- }
385-
386340 /// <summary>
387341 /// Lists all containers in the storage account.
388342 /// Note that the ListContainers method is called synchronously, for the purposes of the sample. However, in a real-world
0 commit comments