Skip to content

Commit 5949ddb

Browse files
Merge pull request #12 from mhopkins-msft/master
Updated to use latest NuGet packages
2 parents 0d0725d + 0b340ed commit 5949ddb

File tree

8 files changed

+50
-94
lines changed

8 files changed

+50
-94
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: 6 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616

1717
namespace BlobStorage
1818
{
19+
using Microsoft.Azure;
20+
using Microsoft.Azure.Storage;
21+
using Microsoft.Azure.Storage.Blob;
22+
using Microsoft.Azure.Storage.RetryPolicies;
23+
using Microsoft.Azure.Storage.Shared.Protocol;
1924
using System;
2025
using System.Collections.Generic;
2126
using System.IO;
@@ -24,12 +29,6 @@ namespace BlobStorage
2429
using System.ServiceModel.Channels;
2530
using System.Text;
2631
using System.Threading.Tasks;
27-
using Microsoft.Azure;
28-
using Microsoft.WindowsAzure.Storage;
29-
using Microsoft.WindowsAzure.Storage.Auth;
30-
using Microsoft.WindowsAzure.Storage.Blob;
31-
using Microsoft.WindowsAzure.Storage.RetryPolicies;
32-
using Microsoft.WindowsAzure.Storage.Shared.Protocol;
3332

3433
/// <summary>
3534
/// 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()
112111
// The sample code deletes any containers it created if it runs completely. However, if you need to delete containers
113112
// created by previous sessions (for example, if you interrupted the running code before it completed),
114113
// you can uncomment and run the following line to delete them.
115-
116114
//await DeleteContainersWithPrefix(blobClient, ContainerPrefix);
117115

118116
// Return the service properties/storage analytics settings to their original values.
@@ -138,9 +136,6 @@ private static async Task CallBlobClientSamples(CloudBlobClient blobClient)
138136
// Configure storage analytics (metrics and logging) on Blob storage.
139137
await ConfigureBlobAnalyticsAsync(blobClient);
140138

141-
// Get geo-replication stats for Blob storage.
142-
await GetServiceStatsForSecondaryAsync(blobClient);
143-
144139
// List all containers in the storage account.
145140
ListAllContainers(blobClient, "sample-");
146141

@@ -329,7 +324,7 @@ private static async Task ConfigureBlobAnalyticsAsync(CloudBlobClient blobClient
329324
serviceProperties.MinuteMetrics.Version = "1.0";
330325

331326
// Set the default service version to be used for anonymous requests.
332-
serviceProperties.DefaultServiceVersion = "2015-04-05";
327+
serviceProperties.DefaultServiceVersion = "2018-11-09";
333328

334329
// Set the service properties.
335330
await blobClient.SetServicePropertiesAsync(serviceProperties);
@@ -342,48 +337,6 @@ private static async Task ConfigureBlobAnalyticsAsync(CloudBlobClient blobClient
342337
}
343338
}
344339

345-
/// <summary>
346-
/// Gets the Blob service stats for the secondary endpoint for an RA-GRS (read-access geo-redundant) storage account.
347-
/// </summary>
348-
/// <param name="blobClient">The Blob service client.</param>
349-
/// <returns>A Task object.</returns>
350-
private static async Task GetServiceStatsForSecondaryAsync(CloudBlobClient blobClient)
351-
{
352-
try
353-
{
354-
// Get the URI for the secondary endpoint for Blob storage.
355-
Uri secondaryUri = blobClient.StorageUri.SecondaryUri;
356-
357-
// Create a new service client based on the secondary endpoint.
358-
CloudBlobClient blobClientSecondary = new CloudBlobClient(secondaryUri, blobClient.Credentials);
359-
360-
// Get the current stats for the secondary.
361-
// The call will fail if your storage account does not have RA-GRS enabled.
362-
ServiceStats blobStats = await blobClientSecondary.GetServiceStatsAsync();
363-
364-
Console.WriteLine("Geo-replication status: {0}", blobStats.GeoReplication.Status);
365-
Console.WriteLine("Last geo-replication sync time: {0}", blobStats.GeoReplication.LastSyncTime);
366-
Console.WriteLine();
367-
}
368-
catch (StorageException e)
369-
{
370-
// 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
371-
// for this storage account.
372-
if (e.RequestInformation.HttpStatusCode == 403)
373-
{
374-
Console.WriteLine("This storage account does not appear to support RA-GRS.");
375-
Console.WriteLine("More information: {0}", e.Message);
376-
Console.WriteLine();
377-
}
378-
else
379-
{
380-
Console.WriteLine(e.Message);
381-
Console.ReadLine();
382-
throw;
383-
}
384-
}
385-
}
386-
387340
/// <summary>
388341
/// Lists all containers in the storage account.
389342
/// Note that the ListContainers method is called synchronously, for the purposes of the sample. However, in a real-world

BlobStorage/App.config

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,13 @@
2525
</dependentAssembly>
2626
<dependentAssembly>
2727
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
28-
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
28+
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
29+
</dependentAssembly>
30+
<dependentAssembly>
31+
<assemblyIdentity name="Microsoft.Azure.KeyVault.Core" publicKeyToken="31bf3856ad364e35" culture="neutral" />
32+
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
2933
</dependentAssembly>
3034
</assemblyBinding>
3135
</runtime>
32-
</configuration>
36+
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /></startup>
37+
</configuration>

BlobStorage/BlobStorage.csproj

Lines changed: 21 additions & 25 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>
@@ -33,40 +34,35 @@
3334
<WarningLevel>4</WarningLevel>
3435
</PropertyGroup>
3536
<ItemGroup>
36-
<Reference Include="Microsoft.Azure.KeyVault.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
37-
<HintPath>..\packages\Microsoft.Azure.KeyVault.Core.1.0.0\lib\net40\Microsoft.Azure.KeyVault.Core.dll</HintPath>
38-
<Private>True</Private>
37+
<Reference Include="Microsoft.Azure.ConfigurationManager, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
38+
<HintPath>..\packages\Microsoft.Azure.ConfigurationManager.4.0.0\lib\net452\Microsoft.Azure.ConfigurationManager.dll</HintPath>
3939
</Reference>
40-
<Reference Include="Microsoft.Data.Edm, Version=5.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
41-
<HintPath>..\packages\Microsoft.Data.Edm.5.7.0\lib\net40\Microsoft.Data.Edm.dll</HintPath>
42-
<Private>True</Private>
40+
<Reference Include="Microsoft.Azure.KeyVault.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
41+
<HintPath>..\packages\Microsoft.Azure.KeyVault.Core.3.0.3\lib\net452\Microsoft.Azure.KeyVault.Core.dll</HintPath>
4342
</Reference>
44-
<Reference Include="Microsoft.Data.OData, Version=5.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
45-
<HintPath>..\packages\Microsoft.Data.OData.5.7.0\lib\net40\Microsoft.Data.OData.dll</HintPath>
46-
<Private>True</Private>
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>
4745
</Reference>
48-
<Reference Include="Microsoft.Data.Services.Client, Version=5.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
49-
<HintPath>..\packages\Microsoft.Data.Services.Client.5.7.0\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
50-
<Private>True</Private>
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>
5148
</Reference>
52-
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
53-
<HintPath>..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.1\lib\net40\Microsoft.WindowsAzure.Configuration.dll</HintPath>
54-
<Private>True</Private>
49+
<Reference Include="Microsoft.Data.Edm, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
50+
<HintPath>..\packages\Microsoft.Data.Edm.5.8.4\lib\net40\Microsoft.Data.Edm.dll</HintPath>
5551
</Reference>
56-
<Reference Include="Microsoft.WindowsAzure.Storage, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
57-
<HintPath>..\packages\WindowsAzure.Storage.7.0.0\lib\net40\Microsoft.WindowsAzure.Storage.dll</HintPath>
58-
<Private>True</Private>
52+
<Reference Include="Microsoft.Data.OData, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
53+
<HintPath>..\packages\Microsoft.Data.OData.5.8.4\lib\net40\Microsoft.Data.OData.dll</HintPath>
5954
</Reference>
60-
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
61-
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
62-
<Private>True</Private>
55+
<Reference Include="Microsoft.Data.Services.Client, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
56+
<HintPath>..\packages\Microsoft.Data.Services.Client.5.8.4\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
57+
</Reference>
58+
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
59+
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
6360
</Reference>
6461
<Reference Include="System" />
6562
<Reference Include="System.Core" />
6663
<Reference Include="System.ServiceModel" />
67-
<Reference Include="System.Spatial, Version=5.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
68-
<HintPath>..\packages\System.Spatial.5.7.0\lib\net40\System.Spatial.dll</HintPath>
69-
<Private>True</Private>
64+
<Reference Include="System.Spatial, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
65+
<HintPath>..\packages\System.Spatial.5.8.4\lib\net40\System.Spatial.dll</HintPath>
7066
</Reference>
7167
<Reference Include="System.Xml.Linq" />
7268
<Reference Include="System.Data.DataSetExtensions" />

BlobStorage/Common.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace BlobStorage
1919
{
2020
using System;
2121
using Microsoft.Azure;
22-
using Microsoft.WindowsAzure.Storage;
22+
using Microsoft.Azure.Storage;
2323

2424
/// <summary>
2525
/// Contains public method for validating the storage connection string.

BlobStorage/GettingStarted.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ namespace BlobStorage
2020
using System.IO;
2121
using System.Linq;
2222
using System.Threading.Tasks;
23-
using Microsoft.WindowsAzure.Storage;
24-
using Microsoft.WindowsAzure.Storage.Auth;
25-
using Microsoft.WindowsAzure.Storage.Blob;
26-
using Microsoft.WindowsAzure.Storage.RetryPolicies;
23+
using Microsoft.Azure.Storage;
24+
using Microsoft.Azure.Storage.Auth;
25+
using Microsoft.Azure.Storage.Blob;
26+
using Microsoft.Azure.Storage.RetryPolicies;
2727

2828
/// <summary>
2929
/// Getting started samples for Blob storage

BlobStorage/WCFBufferManagerAdapter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using System.ServiceModel.Channels;
2-
using Microsoft.WindowsAzure.Storage;
2+
using Microsoft.Azure.Storage;
33

44
namespace BlobStorage
55
{

BlobStorage/packages.config

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net452" />
4-
<package id="Microsoft.Data.Edm" version="5.7.0" targetFramework="net452" />
5-
<package id="Microsoft.Data.OData" version="5.7.0" targetFramework="net452" />
6-
<package id="Microsoft.Data.Services.Client" version="5.7.0" targetFramework="net452" />
7-
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="3.2.1" targetFramework="net452" />
8-
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net452" />
9-
<package id="System.Spatial" version="5.7.0" targetFramework="net452" />
10-
<package id="WindowsAzure.Storage" version="7.0.0" targetFramework="net452" />
3+
<package id="Microsoft.Azure.ConfigurationManager" version="4.0.0" targetFramework="net452" />
4+
<package id="Microsoft.Azure.KeyVault.Core" version="3.0.3" 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" />
7+
<package id="Microsoft.Data.Edm" version="5.8.4" targetFramework="net452" />
8+
<package id="Microsoft.Data.OData" version="5.8.4" targetFramework="net452" />
9+
<package id="Microsoft.Data.Services.Client" version="5.8.4" targetFramework="net452" />
10+
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net452" />
11+
<package id="System.Spatial" version="5.8.4" targetFramework="net452" />
1112
</packages>

0 commit comments

Comments
 (0)