Skip to content

Commit abaf1b7

Browse files
committed
Updated to latest NuGet packages.
1 parent d976dde commit abaf1b7

File tree

5 files changed

+13
-57
lines changed

5 files changed

+13
-57
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ BlobStorage/StyleCop.cache
99
*.nupkg
1010
packages/*
1111
*.ps1
12+
.vs/*

BlobStorage/Advanced.cs

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -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

BlobStorage/App.config

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
you can create a storage account and run against Azure Storage. Comment out the connection string below and use the
77
second connection string. Insert your storage account name and key in the placeholders in the line below.
88
We recommend creating a new storage account for testing purposes, rather than using a production account for running the samples.-->
9-
<add key="StorageConnectionString" value="UseDevelopmentStorage=true;" />
10-
<!-- <add key="StorageConnectionString" value="DefaultEndpointsProtocol=https;AccountName=[Account Name];AccountKey=[Account Key]" /> -->
9+
<add key="StorageConnectionString" value="UseDevelopmentStorage=true;"/>
10+
<!--<add key="StorageConnectionString" value="DefaultEndpointsProtocol=https;AccountName=[Account Name];AccountKey=[Account Key]" />-->
1111
</appSettings>
1212
<runtime>
1313
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
@@ -33,4 +33,4 @@
3333
</dependentAssembly>
3434
</assemblyBinding>
3535
</runtime>
36-
</configuration>
36+
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /></startup></configuration>

BlobStorage/BlobStorage.csproj

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
<AppDesignerFolder>Properties</AppDesignerFolder>
1010
<RootNamespace>BlobStorage</RootNamespace>
1111
<AssemblyName>BlobStorage</AssemblyName>
12-
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
12+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
1414
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
15+
<TargetFrameworkProfile />
1516
</PropertyGroup>
1617
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1718
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -39,11 +40,11 @@
3940
<Reference Include="Microsoft.Azure.KeyVault.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
4041
<HintPath>..\packages\Microsoft.Azure.KeyVault.Core.3.0.3\lib\net452\Microsoft.Azure.KeyVault.Core.dll</HintPath>
4142
</Reference>
42-
<Reference Include="Microsoft.Azure.Storage.Blob, Version=10.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
43-
<HintPath>..\packages\Microsoft.Azure.Storage.Blob.10.0.1\lib\net452\Microsoft.Azure.Storage.Blob.dll</HintPath>
43+
<Reference Include="Microsoft.Azure.Storage.Blob, Version=10.0.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
44+
<HintPath>..\packages\Microsoft.Azure.Storage.Blob.10.0.2\lib\net452\Microsoft.Azure.Storage.Blob.dll</HintPath>
4445
</Reference>
45-
<Reference Include="Microsoft.Azure.Storage.Common, Version=10.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
46-
<HintPath>..\packages\Microsoft.Azure.Storage.Common.10.0.1\lib\net452\Microsoft.Azure.Storage.Common.dll</HintPath>
46+
<Reference Include="Microsoft.Azure.Storage.Common, Version=10.0.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
47+
<HintPath>..\packages\Microsoft.Azure.Storage.Common.10.0.2\lib\net452\Microsoft.Azure.Storage.Common.dll</HintPath>
4748
</Reference>
4849
<Reference Include="Microsoft.Data.Edm, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
4950
<HintPath>..\packages\Microsoft.Data.Edm.5.8.4\lib\net40\Microsoft.Data.Edm.dll</HintPath>

BlobStorage/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<packages>
33
<package id="Microsoft.Azure.ConfigurationManager" version="4.0.0" targetFramework="net452" />
44
<package id="Microsoft.Azure.KeyVault.Core" version="3.0.3" targetFramework="net452" />
5-
<package id="Microsoft.Azure.Storage.Blob" version="10.0.1" targetFramework="net452" />
6-
<package id="Microsoft.Azure.Storage.Common" version="10.0.1" targetFramework="net452" />
5+
<package id="Microsoft.Azure.Storage.Blob" version="10.0.2" targetFramework="net472" />
6+
<package id="Microsoft.Azure.Storage.Common" version="10.0.2" targetFramework="net472" />
77
<package id="Microsoft.Data.Edm" version="5.8.4" targetFramework="net452" />
88
<package id="Microsoft.Data.OData" version="5.8.4" targetFramework="net452" />
99
<package id="Microsoft.Data.Services.Client" version="5.8.4" targetFramework="net452" />

0 commit comments

Comments
 (0)