diff --git a/setup/azurecmdfiles.wxi b/setup/azurecmdfiles.wxi index bb751da17f58..3bcc9e71e4e9 100644 --- a/setup/azurecmdfiles.wxi +++ b/setup/azurecmdfiles.wxi @@ -8,6 +8,9 @@ + + + @@ -17,9 +20,15 @@ + + + + + + @@ -29,6 +38,9 @@ + + + @@ -41,12 +53,6 @@ - - - - - - @@ -64,6 +70,9 @@ + + + @@ -73,9 +82,15 @@ + + + + + + @@ -100,6 +115,9 @@ + + + @@ -124,12 +142,6 @@ - - - - - - @@ -156,6 +168,9 @@ + + + @@ -165,9 +180,15 @@ + + + + + + @@ -183,6 +204,9 @@ + + + @@ -195,12 +219,6 @@ - - - - - - @@ -221,6 +239,9 @@ + + + @@ -230,9 +251,15 @@ + + + + + + @@ -266,12 +293,6 @@ - - - - - - @@ -289,6 +310,9 @@ + + + @@ -349,9 +373,15 @@ + + + + + + @@ -373,9 +403,6 @@ - - - @@ -406,12 +433,6 @@ - - - - - - @@ -432,15 +453,24 @@ + + + + + + + + + @@ -459,18 +489,15 @@ + + + - - - - - - @@ -500,6 +527,9 @@ + + + @@ -509,9 +539,15 @@ + + + + + + @@ -530,6 +566,9 @@ + + + @@ -548,12 +587,6 @@ - - - - - - @@ -580,6 +613,9 @@ + + + @@ -589,9 +625,15 @@ + + + + + + @@ -634,12 +676,6 @@ - - - - - - @@ -673,15 +709,24 @@ + + + + + + + + + @@ -691,6 +736,9 @@ + + + @@ -703,12 +751,6 @@ - - - - - - @@ -741,6 +783,9 @@ + + + @@ -786,9 +831,15 @@ + + + + + + @@ -804,6 +855,9 @@ + + + @@ -882,12 +936,6 @@ - - - - - - @@ -950,15 +998,27 @@ + + + + + + + + + + + + @@ -980,12 +1040,6 @@ - - - - - - @@ -1006,9 +1060,18 @@ + + + + + + + + + @@ -1030,6 +1093,9 @@ + + + @@ -1048,12 +1114,6 @@ - - - - - - @@ -1104,6 +1164,9 @@ + + + @@ -1149,9 +1212,15 @@ + + + + + + @@ -1167,6 +1236,9 @@ + + + @@ -1218,12 +1290,6 @@ - - - - - - @@ -1286,15 +1352,24 @@ + + + + + + + + + @@ -1310,6 +1385,9 @@ + + + @@ -1319,12 +1397,6 @@ - - - - - - @@ -1357,21 +1429,33 @@ + + + + + + + + + + + + @@ -1384,12 +1468,6 @@ - - - - - - @@ -1422,6 +1500,9 @@ + + + @@ -1461,9 +1542,15 @@ + + + + + + @@ -1536,12 +1623,6 @@ - - - - - - @@ -1898,6 +1979,9 @@ + + + @@ -1937,9 +2021,15 @@ + + + + + + @@ -1955,6 +2045,9 @@ + + + @@ -2027,12 +2120,6 @@ - - - - - - @@ -2095,9 +2182,18 @@ + + + + + + + + + @@ -2113,6 +2209,9 @@ + + + @@ -2140,12 +2239,6 @@ - - - - - - @@ -2178,9 +2271,18 @@ + + + + + + + + + @@ -2196,6 +2298,9 @@ + + + @@ -2214,12 +2319,6 @@ - - - - - - @@ -2252,28 +2351,33 @@ + + + + - - + + + @@ -2282,6 +2386,7 @@ + @@ -2290,8 +2395,6 @@ - - @@ -2300,31 +2403,36 @@ + + + + - - + + + @@ -2336,13 +2444,12 @@ - - + @@ -2363,7 +2470,9 @@ + + @@ -2371,7 +2480,6 @@ - @@ -2382,27 +2490,27 @@ - - + + + + - - @@ -2412,24 +2520,26 @@ + + + + - - @@ -2438,10 +2548,13 @@ + + + @@ -2456,8 +2569,6 @@ - - @@ -2467,18 +2578,20 @@ + + + + - - @@ -2489,6 +2602,7 @@ + @@ -2504,12 +2618,15 @@ + + + @@ -2536,8 +2653,6 @@ - - @@ -2558,9 +2673,13 @@ + + + + @@ -2568,15 +2687,16 @@ - - + + + @@ -2584,14 +2704,13 @@ + - - @@ -2608,6 +2727,7 @@ + @@ -2623,12 +2743,15 @@ + + + @@ -2646,8 +2769,6 @@ - - @@ -2668,19 +2789,21 @@ + + + + - - @@ -2691,17 +2814,19 @@ + + + + - - @@ -2712,6 +2837,7 @@ + @@ -2725,7 +2851,9 @@ + + @@ -2750,8 +2878,6 @@ - - @@ -2856,6 +2982,7 @@ + @@ -2869,12 +2996,15 @@ + + + @@ -2899,8 +3029,6 @@ - - @@ -2921,12 +3049,16 @@ + + + + @@ -2936,8 +3068,6 @@ - - @@ -2948,20 +3078,22 @@ + + + + - - diff --git a/src/AzurePowershell.sln b/src/AzurePowershell.sln index 8b680bdf26d1..b6bafadf97b1 100644 --- a/src/AzurePowershell.sln +++ b/src/AzurePowershell.sln @@ -155,8 +155,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.StreamAnalytics", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.StreamAnalytics.Test", "ResourceManager\StreamAnalytics\Commands.StreamAnalytics.Test\Commands.StreamAnalytics.Test.csproj", "{7E6683BE-ECFF-4709-89EB-1325E9E70512}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Extensions", "Common\Azure.Common.Extensions\Common.Extensions.csproj", "{B95C489C-8CB7-4DCF-8D5F-B9AEBDBBAF89}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -355,6 +353,10 @@ Global {9FFC40CC-A341-4D0C-A25D-DC6B78EF6C94}.Debug|Any CPU.Build.0 = Debug|Any CPU {9FFC40CC-A341-4D0C-A25D-DC6B78EF6C94}.Release|Any CPU.ActiveCfg = Release|Any CPU {9FFC40CC-A341-4D0C-A25D-DC6B78EF6C94}.Release|Any CPU.Build.0 = Release|Any CPU + {080B0477-7E52-4455-90AB-23BD13D1B1CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {080B0477-7E52-4455-90AB-23BD13D1B1CE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {080B0477-7E52-4455-90AB-23BD13D1B1CE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {080B0477-7E52-4455-90AB-23BD13D1B1CE}.Release|Any CPU.Build.0 = Release|Any CPU {98B10548-DF97-4FB1-8D82-2A12945D4F21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {98B10548-DF97-4FB1-8D82-2A12945D4F21}.Debug|Any CPU.Build.0 = Debug|Any CPU {98B10548-DF97-4FB1-8D82-2A12945D4F21}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -363,10 +365,6 @@ Global {A415F75B-EB6A-49A6-934E-5BA71B83D6EB}.Debug|Any CPU.Build.0 = Debug|Any CPU {A415F75B-EB6A-49A6-934E-5BA71B83D6EB}.Release|Any CPU.ActiveCfg = Release|Any CPU {A415F75B-EB6A-49A6-934E-5BA71B83D6EB}.Release|Any CPU.Build.0 = Release|Any CPU - {080B0477-7E52-4455-90AB-23BD13D1B1CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {080B0477-7E52-4455-90AB-23BD13D1B1CE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {080B0477-7E52-4455-90AB-23BD13D1B1CE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {080B0477-7E52-4455-90AB-23BD13D1B1CE}.Release|Any CPU.Build.0 = Release|Any CPU {F49A314A-A235-47D3-A654-1EC19ACA366C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F49A314A-A235-47D3-A654-1EC19ACA366C}.Debug|Any CPU.Build.0 = Debug|Any CPU {F49A314A-A235-47D3-A654-1EC19ACA366C}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -375,10 +373,6 @@ Global {7E6683BE-ECFF-4709-89EB-1325E9E70512}.Debug|Any CPU.Build.0 = Debug|Any CPU {7E6683BE-ECFF-4709-89EB-1325E9E70512}.Release|Any CPU.ActiveCfg = Release|Any CPU {7E6683BE-ECFF-4709-89EB-1325E9E70512}.Release|Any CPU.Build.0 = Release|Any CPU - {B95C489C-8CB7-4DCF-8D5F-B9AEBDBBAF89}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B95C489C-8CB7-4DCF-8D5F-B9AEBDBBAF89}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B95C489C-8CB7-4DCF-8D5F-B9AEBDBBAF89}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B95C489C-8CB7-4DCF-8D5F-B9AEBDBBAF89}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -407,8 +401,8 @@ Global {4AE5705F-62CF-461D-B72E-DD9DCD9B3609} = {95C16AED-FD57-42A0-86C3-2CF4300A4817} {F4ABAD68-64A5-4B23-B09C-42559A7524DE} = {95C16AED-FD57-42A0-86C3-2CF4300A4817} {FDB897BD-FCB4-44A1-8D66-AC99F22EC737} = {95C16AED-FD57-42A0-86C3-2CF4300A4817} - {A415F75B-EB6A-49A6-934E-5BA71B83D6EB} = {95C16AED-FD57-42A0-86C3-2CF4300A4817} {080B0477-7E52-4455-90AB-23BD13D1B1CE} = {95C16AED-FD57-42A0-86C3-2CF4300A4817} + {A415F75B-EB6A-49A6-934E-5BA71B83D6EB} = {95C16AED-FD57-42A0-86C3-2CF4300A4817} {7E6683BE-ECFF-4709-89EB-1325E9E70512} = {95C16AED-FD57-42A0-86C3-2CF4300A4817} EndGlobalSection EndGlobal diff --git a/src/Common/Commands.Common.Storage/Commands.Common.Storage.csproj b/src/Common/Commands.Common.Storage/Commands.Common.Storage.csproj index 8c32acd701c8..89eb2b979a81 100644 --- a/src/Common/Commands.Common.Storage/Commands.Common.Storage.csproj +++ b/src/Common/Commands.Common.Storage/Commands.Common.Storage.csproj @@ -48,6 +48,26 @@ false + + False + ..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll + + + False + ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll + + + False + ..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + + + False + ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll + + + False + ..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll + ..\..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll @@ -57,6 +77,13 @@ ..\..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll + + False + ..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll + + + ..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll + False ..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll @@ -69,20 +96,16 @@ False ..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - - False - ..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll - - - False - ..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll - ..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll - + False - ..\..\packages\Microsoft.WindowsAzure.Management.Storage.3.1.0\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll + ..\..\packages\Microsoft.WindowsAzure.Management.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.dll + + + False + ..\..\packages\Microsoft.WindowsAzure.Management.Storage.5.0.0\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll False @@ -131,10 +154,6 @@ - - {b95c489c-8cb7-4dcf-8d5f-b9aebdbbaf89} - Common.Extensions - {5ee72c53-1720-4309-b54b-5fb79703195f} Commands.Common diff --git a/src/Common/Commands.Common.Storage/packages.config b/src/Common/Commands.Common.Storage/packages.config index 1b2aa2e6cb32..e4506f130cef 100644 --- a/src/Common/Commands.Common.Storage/packages.config +++ b/src/Common/Commands.Common.Storage/packages.config @@ -1,16 +1,21 @@  + + + + + + - - - + + diff --git a/src/Common/Commands.Common.Test/Commands.Common.Test.csproj b/src/Common/Commands.Common.Test/Commands.Common.Test.csproj index 052b5d184fa0..e03df699a4ab 100644 --- a/src/Common/Commands.Common.Test/Commands.Common.Test.csproj +++ b/src/Common/Commands.Common.Test/Commands.Common.Test.csproj @@ -48,14 +48,25 @@ false - + + ..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll + + + ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll + + False - ..\..\packages\Microsoft.Azure.Management.Resources.2.7.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll - True + ..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + + + ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll + + + ..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll - + False - ..\..\packages\Hydra.HttpRecorder.1.0.5417.13285-prerelease\lib\net45\Microsoft.Azure.Utilities.HttpRecorder.dll + ..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll ..\..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll @@ -87,28 +98,17 @@ ..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - - False - ..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll - - - False - ..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll - ..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll - - False - ..\..\packages\Microsoft.WindowsAzure.Management.2.1.0\lib\net40\Microsoft.WindowsAzure.Management.dll + + ..\..\packages\Microsoft.WindowsAzure.Management.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.dll - - False - ..\..\packages\Microsoft.WindowsAzure.Management.Compute.6.1.2\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll + + ..\..\packages\Microsoft.WindowsAzure.Management.Compute.8.0.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll - - False - ..\..\packages\Microsoft.WindowsAzure.Management.Storage.3.1.0\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll + + ..\..\packages\Microsoft.WindowsAzure.Management.Storage.5.0.0\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll False @@ -156,10 +156,6 @@ - - - - @@ -167,10 +163,12 @@ - - - + + + + + @@ -178,6 +176,8 @@ + + True @@ -187,10 +187,6 @@ - - {b95c489c-8cb7-4dcf-8d5f-b9aebdbbaf89} - Common.Extensions - {65c3a86a-716d-4e7d-ab67-1db00b3bf72d} Commands.Common.Storage diff --git a/src/Common/Commands.Common.Test/Common/TestingTracingInterceptor.cs b/src/Common/Commands.Common.Test/Common/TestingTracingInterceptor.cs index a8ca9cace755..a928026e562d 100644 --- a/src/Common/Commands.Common.Test/Common/TestingTracingInterceptor.cs +++ b/src/Common/Commands.Common.Test/Common/TestingTracingInterceptor.cs @@ -17,8 +17,10 @@ using System.Collections.Generic; using System.Diagnostics; using System.Net.Http; -using Microsoft.WindowsAzure.Common; -using Microsoft.WindowsAzure.Common.Internals; +using Microsoft.Azure.Common; +using Microsoft.Azure.Common.Internals; +using Hyak.Common; +using Hyak.Common.Internals; namespace Microsoft.WindowsAzure.Commands.Common.Test.Common { @@ -97,12 +99,12 @@ public static void AddToContext() { try { - CloudContext.Configuration.Tracing.RemoveTracingInterceptor(TestingTracingInterceptor.Singleton); + TracingAdapter.RemoveTracingInterceptor(TestingTracingInterceptor.Singleton); } catch { } - CloudContext.Configuration.Tracing.AddTracingInterceptor(TestingTracingInterceptor.Singleton); + TracingAdapter.AddTracingInterceptor(TestingTracingInterceptor.Singleton); } static TestingTracingInterceptor Singleton diff --git a/src/Common/Commands.Common.Test/Mocks/ClientMocks.cs b/src/Common/Commands.Common.Test/Mocks/ClientMocks.cs index 23adacee0364..8ccb064b633c 100644 --- a/src/Common/Commands.Common.Test/Mocks/ClientMocks.cs +++ b/src/Common/Commands.Common.Test/Mocks/ClientMocks.cs @@ -20,6 +20,8 @@ using System.Threading; using System.Threading.Tasks; using Moq; +using Microsoft.Azure; +using Hyak.Common; namespace Microsoft.WindowsAzure.Commands.Common.Test.Mocks { diff --git a/src/Common/Commands.Common.Test/Mocks/MockCertificateAuthenticationFactory.cs b/src/Common/Commands.Common.Test/Mocks/MockCertificateAuthenticationFactory.cs index 792e281095a5..03b03e09fa52 100644 --- a/src/Common/Commands.Common.Test/Mocks/MockCertificateAuthenticationFactory.cs +++ b/src/Common/Commands.Common.Test/Mocks/MockCertificateAuthenticationFactory.cs @@ -12,11 +12,12 @@ // limitations under the License. // ---------------------------------------------------------------------------------- +using Microsoft.Azure; +using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Extensions.Authentication; +using Microsoft.Azure.Common.Extensions.Models; using System.Security; using System.Security.Cryptography.X509Certificates; -using Microsoft.Azure.Common.Extensions.Models; -using Microsoft.Azure.Common.Extensions.Authentication; -using Microsoft.Azure.Common.Extensions; namespace Microsoft.WindowsAzure.Commands.Common.Test.Mocks { diff --git a/src/Common/Commands.Common.Test/Mocks/MockClientFactory.cs b/src/Common/Commands.Common.Test/Mocks/MockClientFactory.cs index fca693ee7621..68b6858db97f 100644 --- a/src/Common/Commands.Common.Test/Mocks/MockClientFactory.cs +++ b/src/Common/Commands.Common.Test/Mocks/MockClientFactory.cs @@ -17,11 +17,12 @@ using System.Linq; using System.Net; using System.Net.Http; -using Microsoft.Azure.Utilities.HttpRecorder; -using Microsoft.WindowsAzure.Common; +using Microsoft.Azure.Test.HttpRecorder; +using Microsoft.Azure.Common; using Microsoft.Azure.Common.Extensions.Factories; using Microsoft.Azure.Common.Extensions.Models; using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure; namespace Microsoft.WindowsAzure.Commands.Common.Test.Mocks { diff --git a/src/Common/Commands.Common.Test/Mocks/MockTokenAuthenticationFactory.cs b/src/Common/Commands.Common.Test/Mocks/MockTokenAuthenticationFactory.cs index b5925680cf8d..a6d4523c4fe9 100644 --- a/src/Common/Commands.Common.Test/Mocks/MockTokenAuthenticationFactory.cs +++ b/src/Common/Commands.Common.Test/Mocks/MockTokenAuthenticationFactory.cs @@ -12,12 +12,12 @@ // limitations under the License. // ---------------------------------------------------------------------------------- +using Microsoft.Azure; +using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Common.Extensions.Authentication; +using Microsoft.Azure.Common.Extensions.Models; using System; using System.Security; -using System.Security.Cryptography.X509Certificates; -using Microsoft.Azure.Common.Extensions.Models; -using Microsoft.Azure.Common.Extensions.Authentication; -using Microsoft.Azure.Common.Extensions; namespace Microsoft.WindowsAzure.Commands.Common.Test.Mocks { diff --git a/src/Common/Commands.Common.Test/packages.config b/src/Common/Commands.Common.Test/packages.config index 8254c0cc0a28..37c24bf2f41f 100644 --- a/src/Common/Commands.Common.Test/packages.config +++ b/src/Common/Commands.Common.Test/packages.config @@ -1,7 +1,11 @@  - - + + + + + + @@ -10,12 +14,10 @@ - - - - - + + + diff --git a/src/Common/Commands.Common/Commands.Common.csproj b/src/Common/Commands.Common/Commands.Common.csproj index 1c07ac6e9cdb..3215eca634f9 100644 --- a/src/Common/Commands.Common/Commands.Common.csproj +++ b/src/Common/Commands.Common/Commands.Common.csproj @@ -50,9 +50,25 @@ true + + False + ..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll + + + False + ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll + + + False + ..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + + + False + ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll + False - ..\..\packages\Microsoft.Azure.Management.Resources.2.7.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll + ..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll ..\..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll @@ -83,17 +99,9 @@ False ..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - - False - ..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll - - + False - ..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll - - - False - ..\..\packages\Microsoft.WindowsAzure.Management.2.1.0\lib\net40\Microsoft.WindowsAzure.Management.dll + ..\..\packages\Microsoft.WindowsAzure.Management.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.dll ..\..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll @@ -178,12 +186,6 @@ Designer - - - {b95c489c-8cb7-4dcf-8d5f-b9aebdbbaf89} - Common.Extensions - - diff --git a/src/Common/Commands.Common/GeneralUtilities.cs b/src/Common/Commands.Common/GeneralUtilities.cs index 04098501bd36..776b11817439 100644 --- a/src/Common/Commands.Common/GeneralUtilities.cs +++ b/src/Common/Commands.Common/GeneralUtilities.cs @@ -12,10 +12,10 @@ // limitations under the License. // ---------------------------------------------------------------------------------- +using Hyak.Common; using Microsoft.Azure.Common.Extensions; using Microsoft.Azure.Common.Extensions.Properties; using Microsoft.WindowsAzure.Commands.Common; -using Microsoft.WindowsAzure.Common.Internals; using System; using System.Collections.Generic; using System.Diagnostics; @@ -329,11 +329,11 @@ public static string GetLog(HttpRequestMessage request) public static string FormatString(string content) { - if (ParserHelper.IsXml(content)) + if (CloudException.IsXml(content)) { return XmlUtilities.TryFormatXml(content); } - else if (ParserHelper.IsJson(content)) + else if (CloudException.IsJson(content)) { return JsonUtilities.TryFormatJson(content); } diff --git a/src/Common/Commands.Common/RecordingTracingInterceptor.cs b/src/Common/Commands.Common/RecordingTracingInterceptor.cs index 6cd9ed9406eb..6fed19616660 100644 --- a/src/Common/Commands.Common/RecordingTracingInterceptor.cs +++ b/src/Common/Commands.Common/RecordingTracingInterceptor.cs @@ -12,6 +12,7 @@ // limitations under the License. // ---------------------------------------------------------------------------------- +using Hyak.Common; using Microsoft.WindowsAzure; using Microsoft.WindowsAzure.Commands.Utilities.Common; using System; @@ -21,7 +22,7 @@ namespace Microsoft.Azure.Common.Extensions.Models { - public class RecordingTracingInterceptor : ICloudTracingInterceptor + public class RecordingTracingInterceptor : Hyak.Common.ICloudTracingInterceptor { public RecordingTracingInterceptor() { @@ -80,14 +81,14 @@ public void Exit(string invocationId, object result) public static void AddToContext(RecordingTracingInterceptor interceptor) { RemoveFromContext(interceptor); - CloudContext.Configuration.Tracing.AddTracingInterceptor(interceptor); + TracingAdapter.AddTracingInterceptor(interceptor); } public static void RemoveFromContext(RecordingTracingInterceptor interceptor) { try { - CloudContext.Configuration.Tracing.RemoveTracingInterceptor(interceptor); + TracingAdapter.RemoveTracingInterceptor(interceptor); } catch { diff --git a/src/Common/Commands.Common/packages.config b/src/Common/Commands.Common/packages.config index 56b52b68db88..a2d042d901c1 100644 --- a/src/Common/Commands.Common/packages.config +++ b/src/Common/Commands.Common/packages.config @@ -1,7 +1,11 @@  + - + + + + @@ -10,9 +14,7 @@ - - - + \ No newline at end of file diff --git a/src/Common/Commands.Profile/Commands.Profile.csproj b/src/Common/Commands.Profile/Commands.Profile.csproj index c8dfd0f6e933..42fa311e25ad 100644 --- a/src/Common/Commands.Profile/Commands.Profile.csproj +++ b/src/Common/Commands.Profile/Commands.Profile.csproj @@ -47,6 +47,22 @@ false + + ..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll + + + ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll + + + False + ..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + + + ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll + + + ..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll + @@ -73,17 +89,8 @@ False ..\lib\Microsoft.Web.Deployment.dll - - False - ..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll - - - False - ..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll - - - False - ..\..\packages\Microsoft.WindowsAzure.Management.2.1.0\lib\net40\Microsoft.WindowsAzure.Management.dll + + ..\..\packages\Microsoft.WindowsAzure.Management.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.dll ..\..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll @@ -143,10 +150,6 @@ - - {b95c489c-8cb7-4dcf-8d5f-b9aebdbbaf89} - Common.Extensions - {5ee72c53-1720-4309-b54b-5fb79703195f} Commands.Common diff --git a/src/Common/Commands.Profile/packages.config b/src/Common/Commands.Profile/packages.config index c8c2784f5d51..bdde83a6dc79 100644 --- a/src/Common/Commands.Profile/packages.config +++ b/src/Common/Commands.Profile/packages.config @@ -1,12 +1,15 @@  + + + + + - - - + \ No newline at end of file diff --git a/src/Common/Commands.ScenarioTest/AutomationTests/AutomationTests.cs b/src/Common/Commands.ScenarioTest/AutomationTests/AutomationTests.cs index e2a688844803..12f15d9dd2c2 100644 --- a/src/Common/Commands.ScenarioTest/AutomationTests/AutomationTests.cs +++ b/src/Common/Commands.ScenarioTest/AutomationTests/AutomationTests.cs @@ -17,7 +17,7 @@ using System.Linq; using Microsoft.WindowsAzure.Commands.Test.Utilities.Common; using Microsoft.WindowsAzure.Commands.Utilities.Common; -using Microsoft.WindowsAzure.Testing; +using Microsoft.Azure.Test; using Xunit; using Microsoft.Azure.Common.Extensions; diff --git a/src/Common/Commands.ScenarioTest/Commands.ScenarioTest.csproj b/src/Common/Commands.ScenarioTest/Commands.ScenarioTest.csproj index 3963ef572626..2e72218aa9cd 100644 --- a/src/Common/Commands.ScenarioTest/Commands.ScenarioTest.csproj +++ b/src/Common/Commands.ScenarioTest/Commands.ScenarioTest.csproj @@ -38,9 +38,27 @@ pdbonly - + + ..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll + + + ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll + + False - ..\..\packages\Hydra.HttpRecorder.1.0.5417.13285-prerelease\lib\net45\Microsoft.Azure.Utilities.HttpRecorder.dll + ..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + + + ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll + + + ..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll + + + ..\..\packages\Microsoft.Azure.Test.Framework.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll + + + ..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll ..\..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll @@ -76,41 +94,25 @@ False ..\lib\Microsoft.Web.Deployment.dll - - False - ..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll - - - False - ..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll - ..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll - - False - ..\..\packages\Microsoft.WindowsAzure.Management.2.1.0\lib\net40\Microsoft.WindowsAzure.Management.dll + + ..\..\packages\Microsoft.WindowsAzure.Management.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.dll - - False - ..\..\packages\Microsoft.WindowsAzure.Management.Compute.6.1.2\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll + + ..\..\packages\Microsoft.WindowsAzure.Management.Compute.8.0.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll - - False - ..\..\packages\Microsoft.WindowsAzure.Management.Storage.3.1.0\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll + + ..\..\packages\Microsoft.WindowsAzure.Management.Storage.5.0.0\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll - ..\..\packages\Microsoft.WindowsAzure.Management.WebSites.4.0.1-prerelease\lib\net40\Microsoft.WindowsAzure.Management.WebSites.dll - True + ..\..\packages\Microsoft.WindowsAzure.Management.WebSites.4.4.0-prerelease\lib\net40\Microsoft.WindowsAzure.Management.WebSites.dll False ..\..\packages\WindowsAzure.Storage.4.0.0\lib\net40\Microsoft.WindowsAzure.Storage.dll - - False - ..\..\packages\Hydra.SpecTestSupport.1.0.5417.13285-prerelease\lib\net45\Microsoft.WindowsAzure.Testing.dll - False ..\..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll @@ -472,10 +474,6 @@ {cd5aa507-f5ef-473d-855b-84b91a1abe54} Commands - - {b95c489c-8cb7-4dcf-8d5f-b9aebdbbaf89} - Common.Extensions - {3b48a77b-5956-4a62-9081-92ba04b02b27} Commands.Common.Test diff --git a/src/Common/Commands.ScenarioTest/Common/ResourceManagerTestEnvironmentFactory.cs b/src/Common/Commands.ScenarioTest/Common/ResourceManagerTestEnvironmentFactory.cs index 84c82f3d3920..d3b793602f04 100644 --- a/src/Common/Commands.ScenarioTest/Common/ResourceManagerTestEnvironmentFactory.cs +++ b/src/Common/Commands.ScenarioTest/Common/ResourceManagerTestEnvironmentFactory.cs @@ -13,8 +13,8 @@ // limitations under the License. // +using Hyak.Common; using System; -using Microsoft.WindowsAzure.Common.Internals; namespace Microsoft.WindowsAzure.Commands.ScenarioTest.Common { @@ -57,7 +57,7 @@ protected override TestEnvironment GetTestEnvironmentFromContext() catch (ArgumentException exception) { // allow running gallery tests - Tracing.Information("Node.exe was not found on the system, please install the x86 version of node.exe to run tests, received exception {0}", exception); + TracingAdapter.Information("Node.exe was not found on the system, please install the x86 version of node.exe to run tests, received exception {0}", exception); } string galleryUri = Environment.GetEnvironmentVariable(TestCSMGalleryUri); diff --git a/src/Common/Commands.ScenarioTest/Common/ServiceManagementTestEnvironmentFactory.cs b/src/Common/Commands.ScenarioTest/Common/ServiceManagementTestEnvironmentFactory.cs index da5fe60bcfb1..6b9faa273a0e 100644 --- a/src/Common/Commands.ScenarioTest/Common/ServiceManagementTestEnvironmentFactory.cs +++ b/src/Common/Commands.ScenarioTest/Common/ServiceManagementTestEnvironmentFactory.cs @@ -21,9 +21,10 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.WindowsAzure.Commands.Utilities.Common; using Microsoft.WindowsAzure.Commands.Utilities.Common.XmlSchema; -using Microsoft.WindowsAzure.Common.Internals; using Microsoft.Azure.Common.Extensions; using Microsoft.Azure.Common.Extensions.XmlSchema; +using Hyak.Common; +using Microsoft.Azure; namespace Microsoft.WindowsAzure.Commands.ScenarioTest.Common { @@ -75,17 +76,17 @@ protected virtual TestEnvironment GetCertificateTestEnvironment() string defaultPublishSettingsFile = Path.Combine(Environment.CurrentDirectory, DefaultPublishsettingsFilename); if (File.Exists(defaultPublishSettingsFile)) { - Tracing.Information("Getting credentials from local publishsettings file: {0}", defaultPublishSettingsFile); + TracingAdapter.Information("Getting credentials from local publishsettings file: {0}", defaultPublishSettingsFile); environment = GetTestEnvironmentFromPublishSettingsFile(defaultPublishSettingsFile); } else if (!string.IsNullOrEmpty(testPublishSettingsString)) { - Tracing.Information("Getting credentials from publishsettings file in environment variable: {0}={1}", TestPublishSettingsFileKey, testPublishSettingsString); + TracingAdapter.Information("Getting credentials from publishsettings file in environment variable: {0}={1}", TestPublishSettingsFileKey, testPublishSettingsString); environment = GetTestEnvironmentFromPublishSettingsFile(testPublishSettingsString); } else if (!string.IsNullOrEmpty(testConnectionString)) { - Tracing.Information("Getting credentials from connection string in environment variable: {0}={1}", TestCertificateConnectionStringKey, testConnectionString); + TracingAdapter.Information("Getting credentials from connection string in environment variable: {0}={1}", TestCertificateConnectionStringKey, testConnectionString); environment = GetCertificateTestEnvironmentFromConnectionString(testConnectionString); } diff --git a/src/Common/Commands.ScenarioTest/Common/TestEnvironment.cs b/src/Common/Commands.ScenarioTest/Common/TestEnvironment.cs index 05e6907137eb..623a5886a387 100644 --- a/src/Common/Commands.ScenarioTest/Common/TestEnvironment.cs +++ b/src/Common/Commands.ScenarioTest/Common/TestEnvironment.cs @@ -17,6 +17,7 @@ namespace Microsoft.WindowsAzure.Commands.ScenarioTest.Common { + using Hyak.Common; using Microsoft.IdentityModel.Clients.ActiveDirectory; using System; public class TestEnvironment diff --git a/src/Common/Commands.ScenarioTest/Common/TestEnvironmentFactory.cs b/src/Common/Commands.ScenarioTest/Common/TestEnvironmentFactory.cs index a75a1e1cc978..a4cfec1b97d2 100644 --- a/src/Common/Commands.ScenarioTest/Common/TestEnvironmentFactory.cs +++ b/src/Common/Commands.ScenarioTest/Common/TestEnvironmentFactory.cs @@ -15,14 +15,16 @@ using System; using System.Collections.Generic; -using Microsoft.Azure.Utilities.HttpRecorder; -using Microsoft.WindowsAzure.Common.Internals; +using Microsoft.Azure.Test.HttpRecorder; using Newtonsoft.Json.Linq; +using System; +using Microsoft.IdentityModel.Clients.ActiveDirectory; +using Microsoft.Azure.Test.HttpRecorder; +using Hyak.Common; +using Microsoft.Azure; namespace Microsoft.WindowsAzure.Commands.ScenarioTest.Common { - using System; - using Microsoft.IdentityModel.Clients.ActiveDirectory; public abstract class TestEnvironmentFactory { /// @@ -114,12 +116,12 @@ protected virtual TestEnvironment GetOrgIdTestEnvironment(string orgIdVariable) { string password = authSettings[AADPasswordKey]; - Tracing.Information("Using AAD auth with username and password combination"); + TracingAdapter.Information("Using AAD auth with username and password combination"); token = TokenCloudCredentialsHelper.GetTokenFromBasicCredentials(user, password, authEndpoint, tenant); } else { - Tracing.Information("Using AAD auth with pop-up dialog"); + TracingAdapter.Information("Using AAD auth with pop-up dialog"); string clientId = authSettings.ContainsKey(ClientID) ? authSettings[ClientID] : ClientIdDefault; if (authSettings.ContainsKey(RawToken)) { @@ -136,7 +138,7 @@ protected virtual TestEnvironment GetOrgIdTestEnvironment(string orgIdVariable) if (HttpMockServer.Mode == HttpRecorderMode.Playback) { // playback mode but no stored credentials in mocks - Tracing.Information("Using dummy token for playback"); + TracingAdapter.Information("Using dummy token for playback"); token = Guid.NewGuid().ToString(); } diff --git a/src/Common/Commands.ScenarioTest/Common/TokenCloudCredentialsHelper.cs b/src/Common/Commands.ScenarioTest/Common/TokenCloudCredentialsHelper.cs index e3c9cc82a265..6d35bafe9d2c 100644 --- a/src/Common/Commands.ScenarioTest/Common/TokenCloudCredentialsHelper.cs +++ b/src/Common/Commands.ScenarioTest/Common/TokenCloudCredentialsHelper.cs @@ -22,7 +22,7 @@ using System.Threading; using Microsoft.IdentityModel.Clients.ActiveDirectory; using Microsoft.IdentityModel.Clients.ActiveDirectory.Internal; -using Microsoft.WindowsAzure.Common.Internals; +using Hyak.Common; namespace Microsoft.WindowsAzure.Commands.ScenarioTest.Common { @@ -169,7 +169,7 @@ private static string GetProcessResult(string path, string arguments, Func - - + + + + + + + @@ -10,13 +15,11 @@ - - - - - - + + + + diff --git a/src/Common/Commands.ScenarioTests.Common/Commands.ScenarioTests.Common.csproj b/src/Common/Commands.ScenarioTests.Common/Commands.ScenarioTests.Common.csproj index 2de84d0e510d..9822e8b9c83f 100644 --- a/src/Common/Commands.ScenarioTests.Common/Commands.ScenarioTests.Common.csproj +++ b/src/Common/Commands.ScenarioTests.Common/Commands.ScenarioTests.Common.csproj @@ -37,9 +37,27 @@ pdbonly - + + ..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll + + + ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll + + False - ..\..\packages\Hydra.HttpRecorder.1.0.5417.13285-prerelease\lib\net45\Microsoft.Azure.Utilities.HttpRecorder.dll + ..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + + + ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll + + + ..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll + + + ..\..\packages\Microsoft.Azure.Test.Framework.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll + + + ..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll False @@ -61,17 +79,8 @@ ..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - - False - ..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll - - - False - ..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll - - - False - ..\..\packages\Hydra.SpecTestSupport.1.0.5417.13285-prerelease\lib\net45\Microsoft.WindowsAzure.Testing.dll + + ..\..\packages\Microsoft.WindowsAzure.Management.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.dll ..\..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll @@ -123,10 +132,6 @@ {bc420543-c04e-4bf3-96e1-cd81b823bdd7} Commands.Test.Utilities - - {b95c489c-8cb7-4dcf-8d5f-b9aebdbbaf89} - Common.Extensions - {3b48a77b-5956-4a62-9081-92ba04b02b27} Commands.Common.Test diff --git a/src/Common/Commands.ScenarioTests.Common/Common.ps1 b/src/Common/Commands.ScenarioTests.Common/Common.ps1 index 8cfda87c9d1d..1c3cb8780edb 100644 --- a/src/Common/Commands.ScenarioTests.Common/Common.ps1 +++ b/src/Common/Commands.ScenarioTests.Common/Common.ps1 @@ -357,7 +357,7 @@ function getAssetName } } - $assetName = [Microsoft.Azure.Utilities.HttpRecorder.HttpMockServer]::GetAssetName($testName, "onesdk") + $assetName = [Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::GetAssetName($testName, "onesdk") return $assetName } \ No newline at end of file diff --git a/src/Common/Commands.ScenarioTests.Common/EnvironmentSetupHelper.cs b/src/Common/Commands.ScenarioTests.Common/EnvironmentSetupHelper.cs index 09186ab53cf9..00a1a65b9cf5 100644 --- a/src/Common/Commands.ScenarioTests.Common/EnvironmentSetupHelper.cs +++ b/src/Common/Commands.ScenarioTests.Common/EnvironmentSetupHelper.cs @@ -17,14 +17,15 @@ using System.Collections.ObjectModel; using System.Management.Automation; using System.Security.Cryptography.X509Certificates; -using Microsoft.Azure.Utilities.HttpRecorder; using Microsoft.WindowsAzure.Commands.Common; using Microsoft.Azure.Common.Extensions.Models; using Microsoft.WindowsAzure.Commands.Common.Test.Mocks; using Microsoft.WindowsAzure.Commands.Utilities.Common; -using Microsoft.WindowsAzure.Testing; using System.Diagnostics; using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure.Test; +using Microsoft.Azure.Test.HttpRecorder; +using Microsoft.Azure; namespace Microsoft.WindowsAzure.Commands.ScenarioTest { diff --git a/src/Common/Commands.ScenarioTests.Common/packages.config b/src/Common/Commands.ScenarioTests.Common/packages.config index 0b670568f39a..924f1c43ed10 100644 --- a/src/Common/Commands.ScenarioTests.Common/packages.config +++ b/src/Common/Commands.ScenarioTests.Common/packages.config @@ -1,14 +1,18 @@  - - + + + + + + + - - + \ No newline at end of file diff --git a/src/ResourceManager/Batch/Commands.Batch.Test/Accounts/RemoveBatchAccountCommandTests.cs b/src/ResourceManager/Batch/Commands.Batch.Test/Accounts/RemoveBatchAccountCommandTests.cs index 85c40610b5d9..67a45117e89e 100644 --- a/src/ResourceManager/Batch/Commands.Batch.Test/Accounts/RemoveBatchAccountCommandTests.cs +++ b/src/ResourceManager/Batch/Commands.Batch.Test/Accounts/RemoveBatchAccountCommandTests.cs @@ -44,7 +44,7 @@ public void RemoveBatchAccountTest() string accountName = "account01"; string resourceGroup = "resourceGroup"; - OperationResponse deleteResponse = new OperationResponse(); + AzureOperationResponse deleteResponse = new AzureOperationResponse(); batchClientMock.Setup(b => b.DeleteAccount(resourceGroup, accountName)).Returns(deleteResponse); cmdlet.AccountName = accountName; diff --git a/src/ResourceManager/Batch/Commands.Batch.Test/Commands.Batch.Test.csproj b/src/ResourceManager/Batch/Commands.Batch.Test/Commands.Batch.Test.csproj index 39fc0f191441..0b9a7c54d6e6 100644 --- a/src/ResourceManager/Batch/Commands.Batch.Test/Commands.Batch.Test.csproj +++ b/src/ResourceManager/Batch/Commands.Batch.Test/Commands.Batch.Test.csproj @@ -38,28 +38,38 @@ false + + ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll + + + False + ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll + - ..\..\..\packages\Microsoft.Azure.Gallery.2.2.0-preview\lib\net40\Microsoft.Azure.Gallery.dll + ..\..\..\packages\Microsoft.Azure.Gallery.2.6.0-preview\lib\net40\Microsoft.Azure.Gallery.dll - False - ..\..\..\packages\Microsoft.Azure.Management.Authorization.0.11.0-preview\lib\net40\Microsoft.Azure.Management.Authorization.dll + ..\..\..\packages\Microsoft.Azure.Management.Authorization.0.16.0-preview\lib\net40\Microsoft.Azure.Management.Authorization.dll - - False - ..\..\..\packages\Microsoft.Azure.Management.Batch.1.1.6-preview\lib\net40\Microsoft.Azure.Management.Batch.dll + + ..\..\..\packages\Microsoft.Azure.Management.Batch.1.3.0-preview\lib\net40\Microsoft.Azure.Management.Batch.dll - - False - ..\..\..\packages\Microsoft.Azure.Monitoring.2.2.0-preview\lib\net40\Microsoft.Azure.Monitoring.dll + + ..\..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll - + False - ..\..\..\packages\Microsoft.Azure.Management.Resources.2.7.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll + ..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll - + False - ..\..\..\packages\Hydra.HttpRecorder.1.0.5417.13285-prerelease\lib\net45\Microsoft.Azure.Utilities.HttpRecorder.dll + ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll False @@ -69,9 +79,8 @@ False ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll - - False - ..\..\..\packages\Hydra.SpecTestSupport.1.0.5417.13285-prerelease\lib\net45\Microsoft.WindowsAzure.Testing.dll + + ..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.dll ..\..\..\packages\Moq.4.2.1402.2112\lib\net40\Moq.dll @@ -97,14 +106,6 @@ ..\..\..\packages\xunit.1.9.2\lib\net20\xunit.dll - - False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll - - - False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll - False ..\..\..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll @@ -157,10 +158,6 @@ - - {b95c489c-8cb7-4dcf-8d5f-b9aebdbbaf89} - Common.Extensions - {3b48a77b-5956-4a62-9081-92ba04b02b27} Commands.Common.Test diff --git a/src/ResourceManager/Batch/Commands.Batch.Test/ScenarioTests/BatchController.cs b/src/ResourceManager/Batch/Commands.Batch.Test/ScenarioTests/BatchController.cs index 80d7419bd882..fb3848dee18d 100644 --- a/src/ResourceManager/Batch/Commands.Batch.Test/ScenarioTests/BatchController.cs +++ b/src/ResourceManager/Batch/Commands.Batch.Test/ScenarioTests/BatchController.cs @@ -17,10 +17,10 @@ using Microsoft.Azure.Management.Authorization; using Microsoft.Azure.Management.Batch; using Microsoft.Azure.Management.Resources; +using Microsoft.Azure.Test; using Microsoft.WindowsAzure.Commands.ScenarioTest; using Microsoft.WindowsAzure.Commands.Utilities.Common; -using Microsoft.WindowsAzure.Management.Monitoring.Events; -using Microsoft.WindowsAzure.Testing; +using Microsoft.Azure.Test; using System; using System.Linq; @@ -37,8 +37,6 @@ public class BatchController public GalleryClient GalleryClient { get; private set; } - public EventsClient EventsClient { get; private set; } - public ResourceManagementClient ResourceManagementClient { get; private set; } public BatchManagementClient BatchManagementClient { get; private set; } @@ -136,13 +134,11 @@ private void SetupManagementClients() { AuthorizationManagementClient = GetAuthorizationManagementClient(); GalleryClient = GetGalleryClient(); - EventsClient = GetEventsClient(); ResourceManagementClient = GetResourceManagementClient(); BatchManagementClient = GetBatchManagementClient(); helper.SetupManagementClients(AuthorizationManagementClient, GalleryClient, - EventsClient, ResourceManagementClient, BatchManagementClient); } @@ -157,11 +153,6 @@ private GalleryClient GetGalleryClient() return TestBase.GetServiceClient(this.csmTestFactory); } - private EventsClient GetEventsClient() - { - return TestBase.GetServiceClient(this.csmTestFactory); - } - private ResourceManagementClient GetResourceManagementClient() { return TestBase.GetServiceClient(this.csmTestFactory); diff --git a/src/ResourceManager/Batch/Commands.Batch.Test/ScenarioTests/Common.ps1 b/src/ResourceManager/Batch/Commands.Batch.Test/ScenarioTests/Common.ps1 index 73e2eb12b1f2..70f34b54ef07 100644 --- a/src/ResourceManager/Batch/Commands.Batch.Test/ScenarioTests/Common.ps1 +++ b/src/ResourceManager/Batch/Commands.Batch.Test/ScenarioTests/Common.ps1 @@ -63,7 +63,7 @@ Cleans the created Batch account #> function Clean-BatchAccount($accountName,$resourceGroup) { - if ([Microsoft.Azure.Utilities.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Utilities.HttpRecorder.HttpRecorderMode]::Playback) + if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback) { Remove-AzureBatchAccount -Name $accountName -ResourceGroupName $resourceGroup -Force } @@ -75,7 +75,7 @@ Cleans the created resource group #> function Clean-ResourceGroup($resourceGroup) { - if ([Microsoft.Azure.Utilities.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Utilities.HttpRecorder.HttpRecorderMode]::Playback) + if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback) { Remove-AzureResourceGroup -Name $resourceGroup -Force } diff --git a/src/ResourceManager/Batch/Commands.Batch.Test/packages.config b/src/ResourceManager/Batch/Commands.Batch.Test/packages.config index 36f4b333b3be..cb353aab22e0 100644 --- a/src/ResourceManager/Batch/Commands.Batch.Test/packages.config +++ b/src/ResourceManager/Batch/Commands.Batch.Test/packages.config @@ -1,19 +1,21 @@  - - - - - - - + + + + + + + + + + - - + diff --git a/src/ResourceManager/Batch/Commands.Batch/BatchClient.cs b/src/ResourceManager/Batch/Commands.Batch/BatchClient.cs index 7bd6e73ee855..3173556916de 100644 --- a/src/ResourceManager/Batch/Commands.Batch/BatchClient.cs +++ b/src/ResourceManager/Batch/Commands.Batch/BatchClient.cs @@ -12,6 +12,7 @@ // limitations under the License. // ---------------------------------------------------------------------------------- +using Hyak.Common; using Microsoft.Azure.Commands.Batch.Properties; using Microsoft.Azure.Common.Extensions; using Microsoft.Azure.Common.Extensions.Models; @@ -242,7 +243,7 @@ public virtual BatchAccountContext RegenerateKeys(string resourceGroupName, stri /// The name of the resource group the account is under. If unspecified, it will be looked up. /// The account name /// The status of delete account operation - public virtual OperationResponse DeleteAccount(string resourceGroupName, string accountName) + public virtual AzureOperationResponse DeleteAccount(string resourceGroupName, string accountName) { if (string.IsNullOrEmpty(resourceGroupName)) { diff --git a/src/ResourceManager/Batch/Commands.Batch/BatchCmdletBase.cs b/src/ResourceManager/Batch/Commands.Batch/BatchCmdletBase.cs index 74c6e56c1634..9b63bdca19a8 100644 --- a/src/ResourceManager/Batch/Commands.Batch/BatchCmdletBase.cs +++ b/src/ResourceManager/Batch/Commands.Batch/BatchCmdletBase.cs @@ -12,10 +12,10 @@ // limitations under the License. // ---------------------------------------------------------------------------------- +using Hyak.Common; using Microsoft.Azure.Common.Extensions; using Microsoft.WindowsAzure; using Microsoft.WindowsAzure.Commands.Utilities.Common; -using Microsoft.WindowsAzure.Common.Internals; using Newtonsoft.Json.Linq; using System; @@ -84,7 +84,7 @@ internal static string FindDetailedMessage(string content) { string message = null; - if (ParserHelper.IsJson(content)) + if (CloudException.IsJson(content)) { var response = JObject.Parse(content); diff --git a/src/ResourceManager/Batch/Commands.Batch/Commands.Batch.csproj b/src/ResourceManager/Batch/Commands.Batch/Commands.Batch.csproj index 049c1f1e4d3b..77a2bc161da2 100644 --- a/src/ResourceManager/Batch/Commands.Batch/Commands.Batch.csproj +++ b/src/ResourceManager/Batch/Commands.Batch/Commands.Batch.csproj @@ -41,13 +41,33 @@ false + + ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll + + + False + ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll + False - ..\..\..\packages\Microsoft.Azure.Management.Batch.1.1.6-preview\lib\net40\Microsoft.Azure.Management.Batch.dll + ..\..\..\packages\Microsoft.Azure.Management.Batch.1.3.0-preview\lib\net40\Microsoft.Azure.Management.Batch.dll False - ..\..\..\packages\Microsoft.Azure.Management.Resources.2.7.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll + ..\..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll + + + False + ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll + + + ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll False @@ -61,13 +81,9 @@ False ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - + False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll - - - False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.dll False @@ -130,10 +146,6 @@ - - {b95c489c-8cb7-4dcf-8d5f-b9aebdbbaf89} - Common.Extensions - {5ee72c53-1720-4309-b54b-5fb79703195f} Commands.Common diff --git a/src/ResourceManager/Batch/Commands.Batch/packages.config b/src/ResourceManager/Batch/Commands.Batch/packages.config index fc23e5fd4cc1..cc8fad4873ab 100644 --- a/src/ResourceManager/Batch/Commands.Batch/packages.config +++ b/src/ResourceManager/Batch/Commands.Batch/packages.config @@ -1,12 +1,16 @@  - - + + + + + + + - - + \ No newline at end of file diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/Commands.DataFactories.Test.csproj b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/Commands.DataFactories.Test.csproj index a56c340f32ee..13314fee1b14 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/Commands.DataFactories.Test.csproj +++ b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/Commands.DataFactories.Test.csproj @@ -41,27 +41,38 @@ false + + ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll + + + False + ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll + - ..\..\..\packages\Microsoft.Azure.Gallery.2.2.0-preview\lib\net40\Microsoft.Azure.Gallery.dll - True + ..\..\..\packages\Microsoft.Azure.Gallery.2.6.0-preview\lib\net40\Microsoft.Azure.Gallery.dll - ..\..\..\packages\Microsoft.Azure.Management.Authorization.0.11.0-preview\lib\net40\Microsoft.Azure.Management.Authorization.dll + ..\..\..\packages\Microsoft.Azure.Management.Authorization.0.16.0-preview\lib\net40\Microsoft.Azure.Management.Authorization.dll - ..\..\..\packages\Microsoft.Azure.Management.DataFactories.0.12.0-preview\lib\net40\Microsoft.Azure.Management.DataFactories.dll - - - ..\..\..\packages\Microsoft.Azure.Monitoring.2.2.0-preview\lib\net40\Microsoft.Azure.Monitoring.dll - True + ..\..\..\packages\Microsoft.Azure.Management.DataFactories.0.14.0-preview\lib\net40\Microsoft.Azure.Management.DataFactories.dll - ..\..\..\packages\Microsoft.Azure.Management.Resources.2.7.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll - True + ..\..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll - + False - ..\..\..\packages\Hydra.HttpRecorder.1.0.5417.13285-prerelease\lib\net45\Microsoft.Azure.Utilities.HttpRecorder.dll + ..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll + + + False + ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll ..\..\..\packages\Microsoft.DataFactories.Runtime.0.11.1-preview\lib\net45\Microsoft.DataFactories.Runtime.dll @@ -85,26 +96,16 @@ False ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - - False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll + + ..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.dll - - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll - True - - - False - ..\..\..\packages\Microsoft.WindowsAzure.Management.Storage.3.1.0\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll + + ..\..\..\packages\Microsoft.WindowsAzure.Management.Storage.5.0.0\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll False ..\..\..\packages\WindowsAzure.Storage.4.0.0\lib\net40\Microsoft.WindowsAzure.Storage.dll - - False - ..\..\..\packages\Hydra.SpecTestSupport.1.0.5417.13285-prerelease\lib\net45\Microsoft.WindowsAzure.Testing.dll - False ..\..\..\packages\Moq.4.2.1402.2112\lib\net40\Moq.dll @@ -275,10 +276,6 @@ - - {b95c489c-8cb7-4dcf-8d5f-b9aebdbbaf89} - Common.Extensions - {c1bda476-a5cc-4394-914d-48b0ec31a710} Commands.ScenarioTests.Common diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/ScenarioTests/Common.ps1 b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/ScenarioTests/Common.ps1 index bd2adaf4dd13..bf1223bb8438 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/ScenarioTests/Common.ps1 +++ b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/ScenarioTests/Common.ps1 @@ -50,7 +50,7 @@ Cleans the created data factory #> function Clean-DataFactory($rgname, $dfname) { - if ([Microsoft.Azure.Utilities.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Utilities.HttpRecorder.HttpRecorderMode]::Playback) { + if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback) { Remove-AzureDataFactory -ResourceGroupName $rgname -Name $dfname -Force } } diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/ScenarioTests/DataFactoriesScenarioTestsBase.cs b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/ScenarioTests/DataFactoriesScenarioTestsBase.cs index 55684c826064..54c1a39cfbd8 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/ScenarioTests/DataFactoriesScenarioTestsBase.cs +++ b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/ScenarioTests/DataFactoriesScenarioTestsBase.cs @@ -20,9 +20,8 @@ using Microsoft.Azure.Subscriptions; using Microsoft.WindowsAzure.Commands.ScenarioTest; using Microsoft.WindowsAzure.Commands.Utilities.Common; -using Microsoft.WindowsAzure.Management.Monitoring.Events; using Microsoft.WindowsAzure.Management.Storage; -using Microsoft.WindowsAzure.Testing; +using Microsoft.Azure.Test; namespace Microsoft.Azure.Commands.DataFactories.Test { @@ -41,14 +40,12 @@ protected void SetupManagementClients() var resourceManagementClient = GetResourceManagementClient(); var subscriptionsClient = GetSubscriptionClient(); var galleryClient = GetGalleryClient(); - var eventsClient = GetEventsClient(); var authorizationManagementClient = GetAuthorizationManagementClient(); helper.SetupManagementClients(dataPipelineManagementClient, resourceManagementClient, subscriptionsClient, galleryClient, - eventsClient, authorizationManagementClient); } @@ -93,11 +90,6 @@ protected GalleryClient GetGalleryClient() return TestBase.GetServiceClient(new CSMTestEnvironmentFactory()); } - protected EventsClient GetEventsClient() - { - return TestBase.GetServiceClient(new CSMTestEnvironmentFactory()); - } - protected AuthorizationManagementClient GetAuthorizationManagementClient() { return TestBase.GetServiceClient(new CSMTestEnvironmentFactory()); diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/UnitTests/NewDataFactoryEncryptValueTests.cs b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/UnitTests/NewDataFactoryEncryptValueTests.cs index 47a63edbd524..d1f6ce7b04c5 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/UnitTests/NewDataFactoryEncryptValueTests.cs +++ b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/UnitTests/NewDataFactoryEncryptValueTests.cs @@ -36,6 +36,7 @@ public void TestOnPremDatasourceEncryptionSQLAuth() { SecureString secureString = new SecureString(); string expectedOutput = "My encrypted string " + Guid.NewGuid(); + string linkedServiceType = "OnPremisesSqlLinkedService"; var cmdlet = new NewAzureDataFactoryEncryptValueCommand { @@ -44,17 +45,18 @@ public void TestOnPremDatasourceEncryptionSQLAuth() Value = secureString, ResourceGroupName = ResourceGroupName, DataFactoryName = DataFactoryName, - GatewayName = GatewayName + GatewayName = GatewayName, + Type = linkedServiceType }; // Arrange - this.dataFactoriesClientMock.Setup(f => f.OnPremisesEncryptString(secureString, ResourceGroupName, DataFactoryName, GatewayName, null)).Returns(expectedOutput); + this.dataFactoriesClientMock.Setup(f => f.OnPremisesEncryptString(secureString, ResourceGroupName, DataFactoryName, GatewayName, null, linkedServiceType)).Returns(expectedOutput); // Action cmdlet.ExecuteCmdlet(); // Assert - this.dataFactoriesClientMock.Verify(f => f.OnPremisesEncryptString(secureString, ResourceGroupName, DataFactoryName, GatewayName, null), Times.Once()); + this.dataFactoriesClientMock.Verify(f => f.OnPremisesEncryptString(secureString, ResourceGroupName, DataFactoryName, GatewayName, null, linkedServiceType), Times.Once()); this.commandRuntimeMock.Verify(f => f.WriteObject(expectedOutput), Times.Once()); } @@ -67,6 +69,7 @@ public void TestOnPremDatasourceEncryptionWinAuth() string winAuthUserName = "foo"; SecureString winAuthPassword = new SecureString(); PSCredential credential = new PSCredential(winAuthUserName, winAuthPassword); + string linkedServiceType = "OnPremisesFileSystemLinkedService"; var cmdlet = new NewAzureDataFactoryEncryptValueCommand { @@ -76,17 +79,18 @@ public void TestOnPremDatasourceEncryptionWinAuth() ResourceGroupName = ResourceGroupName, DataFactoryName = DataFactoryName, GatewayName = GatewayName, - Credential = credential + Credential = credential, + Type = linkedServiceType }; // Arrange - this.dataFactoriesClientMock.Setup(f => f.OnPremisesEncryptString(secureString, ResourceGroupName, DataFactoryName, GatewayName, credential)).Returns(expectedOutput); + this.dataFactoriesClientMock.Setup(f => f.OnPremisesEncryptString(secureString, ResourceGroupName, DataFactoryName, GatewayName, credential, linkedServiceType)).Returns(expectedOutput); // Action cmdlet.ExecuteCmdlet(); // Assert - this.dataFactoriesClientMock.Verify(f => f.OnPremisesEncryptString(secureString, ResourceGroupName, DataFactoryName, GatewayName, credential), Times.Once()); + this.dataFactoriesClientMock.Verify(f => f.OnPremisesEncryptString(secureString, ResourceGroupName, DataFactoryName, GatewayName, credential, linkedServiceType), Times.Once()); this.commandRuntimeMock.Verify(f => f.WriteObject(expectedOutput), Times.Once()); } } diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/UnitTests/NewDataFactoryGatewayKeyTests.cs b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/UnitTests/NewDataFactoryGatewayKeyTests.cs index b920504edd40..4e862d8e416d 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/UnitTests/NewDataFactoryGatewayKeyTests.cs +++ b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/UnitTests/NewDataFactoryGatewayKeyTests.cs @@ -24,6 +24,7 @@ using Microsoft.WindowsAzure.Commands.ScenarioTest; using Moq; using Xunit; +using Hyak.Common; namespace Microsoft.WindowsAzure.Commands.Test.Gateway diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/UnitTests/NewDataFactoryGatewayTests.cs b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/UnitTests/NewDataFactoryGatewayTests.cs index 0daf7e18e34e..4ec6da3a6577 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/UnitTests/NewDataFactoryGatewayTests.cs +++ b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/UnitTests/NewDataFactoryGatewayTests.cs @@ -23,6 +23,7 @@ using Microsoft.WindowsAzure.Commands.ScenarioTest; using Moq; using Xunit; +using Hyak.Common; namespace Microsoft.WindowsAzure.Commands.Test.Gateway { diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/packages.config b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/packages.config index ad0862583e9a..bb2cc303940c 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories.Test/packages.config +++ b/src/ResourceManager/DataFactories/Commands.DataFactories.Test/packages.config @@ -1,21 +1,23 @@  - - - - - - - + + + + + + + + + + - - - + + diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories/CloudExceptionExtensions.cs b/src/ResourceManager/DataFactories/Commands.DataFactories/CloudExceptionExtensions.cs index 1addf9260ae3..1e9354a64d3e 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories/CloudExceptionExtensions.cs +++ b/src/ResourceManager/DataFactories/Commands.DataFactories/CloudExceptionExtensions.cs @@ -18,6 +18,7 @@ using Microsoft.Azure.Commands.DataFactories.Properties; using Microsoft.WindowsAzure; +using Hyak.Common; namespace Microsoft.Azure.Commands.DataFactories { @@ -30,8 +31,8 @@ public static CloudException CreateFormattedException(this CloudException cloudE CultureInfo.InvariantCulture, Resources.FormattedCloudExceptionMessageTemplate, cloudException.Response.StatusCode, - cloudException.ErrorCode, - cloudException.ErrorMessage, + cloudException.Error.Code, + cloudException.Error.Message, cloudException.GetRequestId(), DateTime.UtcNow)); } diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories/Commands.DataFactories.csproj b/src/ResourceManager/DataFactories/Commands.DataFactories/Commands.DataFactories.csproj index e5f9759f391c..6f1cb931e64f 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories/Commands.DataFactories.csproj +++ b/src/ResourceManager/DataFactories/Commands.DataFactories/Commands.DataFactories.csproj @@ -48,14 +48,39 @@ false - - ..\..\..\packages\Microsoft.Azure.Management.DataFactories.0.12.0-preview\lib\net40\Microsoft.Azure.Management.DataFactories.dll + + ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll + + + False + ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll + + + False + ..\..\..\packages\Microsoft.Azure.Management.DataFactories.0.14.0-preview\lib\net40\Microsoft.Azure.Management.DataFactories.dll + + + False + ..\..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll ..\..\..\packages\Microsoft.DataFactories.Runtime.0.11.1-preview\lib\net45\Microsoft.DataFactories.Runtime.dll - ..\..\..\packages\Microsoft.DataTransfer.Gateway.Encryption.1.1.0-preview\lib\net45\Microsoft.DataTransfer.Gateway.Encryption.dll + ..\..\..\packages\Microsoft.DataTransfer.Gateway.Encryption.1.2.1-preview\lib\net45\Microsoft.DataTransfer.Gateway.Encryption.dll + + + False + ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll + + + ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll False @@ -69,13 +94,9 @@ False ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - + False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll - - - False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.dll False @@ -189,10 +210,6 @@ - - {b95c489c-8cb7-4dcf-8d5f-b9aebdbbaf89} - Common.Extensions - {65c3a86a-716d-4e7d-ab67-1db00b3bf72d} Commands.Common.Storage diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories/DataFactoryBaseCmdlet.cs b/src/ResourceManager/DataFactories/Commands.DataFactories/DataFactoryBaseCmdlet.cs index 163d33796f04..8c52342a64ab 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories/DataFactoryBaseCmdlet.cs +++ b/src/ResourceManager/DataFactories/Commands.DataFactories/DataFactoryBaseCmdlet.cs @@ -18,6 +18,7 @@ using Microsoft.Azure.Commands.DataFactories.Properties; using Microsoft.WindowsAzure; using Microsoft.WindowsAzure.Commands.Utilities.Common; +using Hyak.Common; namespace Microsoft.Azure.Commands.DataFactories { diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories/Encrypt/NewAzureDataFactoryEncryptValueCommand.cs b/src/ResourceManager/DataFactories/Commands.DataFactories/Encrypt/NewAzureDataFactoryEncryptValueCommand.cs index 363ef0f55439..11d812c81e29 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories/Encrypt/NewAzureDataFactoryEncryptValueCommand.cs +++ b/src/ResourceManager/DataFactories/Commands.DataFactories/Encrypt/NewAzureDataFactoryEncryptValueCommand.cs @@ -47,6 +47,11 @@ public class NewAzureDataFactoryEncryptValueCommand : DataFactoryBaseCmdlet [Parameter(ParameterSetName = ByFactoryName, Position = 4, Mandatory = false, HelpMessage = "The windows authentication credential.")] public PSCredential Credential { get; set; } + [Parameter(ParameterSetName = ByFactoryObject, Position = 4, Mandatory = false, HelpMessage = "The linked service type.")] + [Parameter(ParameterSetName = ByFactoryName, Position = 5, Mandatory = false, HelpMessage = "The linked service type.")] + [ValidateSet("OnPremisesSqlLinkedService", "OnPremisesFileSystemLinkedService", IgnoreCase = true)] + public string Type { get; set; } + [EnvironmentPermission(SecurityAction.Demand, Unrestricted = true)] public override void ExecuteCmdlet() { @@ -72,7 +77,7 @@ public override void ExecuteCmdlet() else { // On-premises encryption with Gateway - encryptedValue = DataFactoryClient.OnPremisesEncryptString(Value, ResourceGroupName, DataFactoryName, GatewayName, Credential); + encryptedValue = DataFactoryClient.OnPremisesEncryptString(Value, ResourceGroupName, DataFactoryName, GatewayName, Credential, Type); } WriteObject(encryptedValue); diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories/Gateway/NewAzureDataFactoryGatewayCommand.cs b/src/ResourceManager/DataFactories/Commands.DataFactories/Gateway/NewAzureDataFactoryGatewayCommand.cs index bac0979a10ba..c3291f14b3c4 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories/Gateway/NewAzureDataFactoryGatewayCommand.cs +++ b/src/ResourceManager/DataFactories/Commands.DataFactories/Gateway/NewAzureDataFactoryGatewayCommand.cs @@ -19,6 +19,7 @@ using Microsoft.Azure.Commands.DataFactories.Models; using Microsoft.Azure.Commands.DataFactories.Properties; using Microsoft.WindowsAzure; +using Hyak.Common; namespace Microsoft.Azure.Commands.DataFactories { diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories/Microsoft.Azure.Commands.DataFactories.dll-Help.xml b/src/ResourceManager/DataFactories/Commands.DataFactories/Microsoft.Azure.Commands.DataFactories.dll-Help.xml index 10a5165e01ca..d2f3adb57626 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories/Microsoft.Azure.Commands.DataFactories.dll-Help.xml +++ b/src/ResourceManager/DataFactories/Commands.DataFactories/Microsoft.Azure.Commands.DataFactories.dll-Help.xml @@ -2088,6 +2088,13 @@ PSCredential + + Type + + Specifies the linked service type. This cmdlet encrypts data for the linked service type that this parameter specifies. For on premises SQL linked service, type OnPremisesSqlLinkedService. For file system linked service, type OnPremisesFileSystemLinkedService. + + String + New-AzureDataFactoryEncryptValue @@ -2126,6 +2133,13 @@ PSCredential + + Type + + Specifies the linked service type. This cmdlet encrypts data for the linked service type that this parameter specifies. For on premises SQL linked service, type OnPremisesSqlLinkedService. For file system linked service, type OnPremisesFileSystemLinkedService. + + String + @@ -2201,6 +2215,18 @@ + + Type + + Specifies the linked service type. For on premises SQL linked service, type OnPremisesSqlLinkedService. For file system linked service, type OnPremisesFileSystemLinkedService. + + String + + String + + + + @@ -2277,13 +2303,35 @@ PS C:\> $Value = ConvertTo-SecureString "Data Source=ContosoServer;Initial Catalog=catelog;Integrated Security=True" -AsPlainText -Force PS C:\> $Credential = Get-Credential - PS C:\> New-AzureDataFactoryEncryptValue -DataFactoryName "WikiADF" -GatewayName "WikiGateway" -ResourceGroupName "ADF" -Value $Value -Credential $Credential + PS C:\> New-AzureDataFactoryEncryptValue -DataFactoryName "WikiADF" -GatewayName "WikiGateway" -ResourceGroupName "ADF" -Value $Value -Credential $Credential -Type OnPremisesSqlLinkedService data source=ContosoServer;initial catalog=catelog;EncryptedCredential=KAAAAAABAAAQAAAAQUU5MUVBNzY4QkFCQkI3MEUwRTMxOUNFNkM0MjRDOTVDNDk3RTcyRi8XAXyE/H+f3JydTkdg5t2g1eC/VtyF3NAD3idYnhrAphPJmO0pCaG5nH2IY48L3XJi7wabrlrGF+ieiWh1bwdgdxrW+t2jWPnLvT/ENUXtcevpx/dmTGKagH8TU9HLcoL1CAanb7Vkpga1B/uzRxBnVdsdtfvBzxG2M810tj1WzL8lFzA1mO5GbB0+ge116y0scL1vxjerjl5Muv0r0scG3lhj+IF0sXUMITFvhQwOIqweR052E6JlfJu+mTNFLCCkpw1iV+rhRhKqJF752dBuWjzI1EoyQUE17oK4OevkquuhUbfJmzj9BhGKQ+VkndAZiSw19FEGSC7JzoUe/XWEs/FJYrQCCXIeNS94J9/VzN6KPYJR1pzAYCtnhq+p8Q== The first command uses the ConvertTo-SecureString cmdlet to convert the specified string to a SecureString object, and then stores that object in the $Value variable. The second command uses the Get-Credential cmdlet to collect the windows authentication user name and password, and then stores that PSCredential object in the $Credential variable. For more information, type Get-Help Get-Credential. - The third command creates an encrypted value for the object stored in $Value and $Credential for the specified data factory, gateway, and resource group. + The third command creates an encrypted value for the object stored in $Value and $Credential for the specified data factory, gateway, resource group, and linked service type. + + + + + + + + + Example 4: Encrypt the file system host name + + + + + PS C:\> $Value = ConvertTo-SecureString "hostname" -AsPlainText -Force + PS C:\> $Credential = Get-Credential + PS C:\> New-AzureDataFactoryEncryptValue -DataFactoryName "WikiADF" -GatewayName "WikiGateway" -ResourceGroupName "ADF" -Value $Value -Credential $Credential -Type OnPremisesFileSystemLinkedService + EncryptedCredential=KAAAAAABAAAQAAAAQUU5MUVBNzY4QkFCQkI3MEUwRTMxOUNFNkM0MjRDOTVDNDk3RTcyRi8XAXyE/H+f3JydTkdg5t2g1eC/VtyF3NAD3idYnhrAphPJmO0pCaG5nH2IY48L3XJi7wabrlrGF+ieiWh1bwdgdxrW+t2jWPnLvT/ENUXtcevpx/dmTGKagH8TU9HLcoL1CAanb7Vkpga1B/uzRxBnVdsdtfvBzxG2M810tj1WzL8lFzA1mO5GbB0+ge116y0scL1vxjerjl5Muv0r0scG3lhj+IF0sXUMITFvhQwOIqweR052E6JlfJu+mTNFLCCkpw1iV+rhRhKqJF752dBuWjzI1EoyQUE17oK4OevkquuhUbfJmzj9BhGKQ+VkndAZiSw19FEGSC7JzoUe/XWEs/FJYrQCCXIeNS94J9/VzN6KPYJR1pzAYCtnhq+p8Q== + + + The first command uses the ConvertTo-SecureString cmdlet to convert the specified string to a SecureString object, and then stores that object in the $Value variable. + The second command uses the Get-Credential cmdlet to collect the windows authentication user name and password, and then stores that PSCredential object in the $Credential variable. For more information, type Get-Help Get-Credential. + The third command creates an encrypted value for the object stored in $Value and $Credential for the specified data factory, gateway, resource group, and linked service type. diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories/Models/DataFactoryClient.DataFactories.cs b/src/ResourceManager/DataFactories/Commands.DataFactories/Models/DataFactoryClient.DataFactories.cs index f4d883f2d773..232572eead28 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories/Models/DataFactoryClient.DataFactories.cs +++ b/src/ResourceManager/DataFactories/Commands.DataFactories/Models/DataFactoryClient.DataFactories.cs @@ -22,6 +22,7 @@ using Microsoft.Azure.Management.DataFactories; using Microsoft.WindowsAzure; using Microsoft.WindowsAzure.Commands.Utilities.Common; +using Hyak.Common; namespace Microsoft.Azure.Commands.DataFactories { @@ -172,7 +173,7 @@ private bool CheckDataFactoryExists(string resourceGroupName, string dataFactory public virtual HttpStatusCode DeleteDataFactory(string resourceGroupName, string dataFactoryName) { - OperationResponse response = DataPipelineManagementClient.DataFactories.Delete(resourceGroupName, + AzureOperationResponse response = DataPipelineManagementClient.DataFactories.Delete(resourceGroupName, dataFactoryName); return response.StatusCode; } diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories/Models/DataFactoryClient.Encrypt.cs b/src/ResourceManager/DataFactories/Commands.DataFactories/Models/DataFactoryClient.Encrypt.cs index c3fe9eee7174..1fa12404a28e 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories/Models/DataFactoryClient.Encrypt.cs +++ b/src/ResourceManager/DataFactories/Commands.DataFactories/Models/DataFactoryClient.Encrypt.cs @@ -33,13 +33,15 @@ public virtual string CloudEncryptString(SecureString value, string resourceGrou resourceGroupName, dataFactoryName); } - public virtual string OnPremisesEncryptString(SecureString value, string resourceGroupName, string dataFactoryName, string gatewayName, PSCredential credential) + public virtual string OnPremisesEncryptString(SecureString value, string resourceGroupName, string dataFactoryName, string gatewayName, PSCredential credential, string type) { if (value == null) { throw new ArgumentNullException("value"); } + LinkedServiceType linkedServiceType = type == null ? LinkedServiceType.OnPremisesSqlLinkedService : (LinkedServiceType) Enum.Parse(typeof(LinkedServiceType), type, true); + var response = DataPipelineManagementClient.Gateways.RetrieveConnectionInfo(resourceGroupName, dataFactoryName, gatewayName); var gatewayEncryptionInfos = new[] { @@ -54,9 +56,8 @@ public virtual string OnPremisesEncryptString(SecureString value, string resourc string userName = credential != null ? credential.UserName : null; SecureString password = credential != null ? credential.Password : null; - UserInputConnectionString connectionString = new UserInputConnectionString(value, userName, password); - var gatewayEncryptionClient = new GatewayEncryptionClient(); - return gatewayEncryptionClient.Encrypt(connectionString, gatewayEncryptionInfos); + UserInputConnectionString connectionString = new UserInputConnectionString(value, userName, password, linkedServiceType); + return GatewayEncryptionClient.Encrypt(connectionString, gatewayEncryptionInfos); } } } diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories/Models/DataFactoryClient.Hubs.cs b/src/ResourceManager/DataFactories/Commands.DataFactories/Models/DataFactoryClient.Hubs.cs index 9b5950798bcf..136f5fe6cff9 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories/Models/DataFactoryClient.Hubs.cs +++ b/src/ResourceManager/DataFactories/Commands.DataFactories/Models/DataFactoryClient.Hubs.cs @@ -21,6 +21,7 @@ using Microsoft.Azure.Management.DataFactories; using Microsoft.Azure.Management.DataFactories.Models; using Microsoft.WindowsAzure; +using Hyak.Common; namespace Microsoft.Azure.Commands.DataFactories { @@ -137,7 +138,7 @@ public virtual List ListHubs(string resourceGroupName, string dataFactory public virtual HttpStatusCode DeleteHub(string resourceGroupName, string dataFactoryName, string hubName) { - OperationResponse response = DataPipelineManagementClient.Hubs.Delete( + AzureOperationResponse response = DataPipelineManagementClient.Hubs.Delete( resourceGroupName, dataFactoryName, hubName); diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories/Models/DataFactoryClient.LinkedServices.cs b/src/ResourceManager/DataFactories/Commands.DataFactories/Models/DataFactoryClient.LinkedServices.cs index 2ad1072c0d04..39bc8403022e 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories/Models/DataFactoryClient.LinkedServices.cs +++ b/src/ResourceManager/DataFactories/Commands.DataFactories/Models/DataFactoryClient.LinkedServices.cs @@ -21,6 +21,7 @@ using Microsoft.Azure.Management.DataFactories; using Microsoft.Azure.Management.DataFactories.Models; using Microsoft.WindowsAzure; +using Hyak.Common; namespace Microsoft.Azure.Commands.DataFactories { @@ -81,7 +82,7 @@ public virtual List ListLinkedServices(string resourceGroupName public virtual HttpStatusCode DeleteLinkedService(string resourceGroupName, string dataFactoryName, string linkedServiceName) { - OperationResponse response = DataPipelineManagementClient.LinkedServices.Delete(resourceGroupName, + AzureOperationResponse response = DataPipelineManagementClient.LinkedServices.Delete(resourceGroupName, dataFactoryName, linkedServiceName); return response.StatusCode; diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories/Models/DataFactoryClient.Pipelines.cs b/src/ResourceManager/DataFactories/Commands.DataFactories/Models/DataFactoryClient.Pipelines.cs index 6edf114b396b..11ab9636fe36 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories/Models/DataFactoryClient.Pipelines.cs +++ b/src/ResourceManager/DataFactories/Commands.DataFactories/Models/DataFactoryClient.Pipelines.cs @@ -21,6 +21,7 @@ using Microsoft.Azure.Management.DataFactories; using Microsoft.Azure.Management.DataFactories.Models; using Microsoft.WindowsAzure; +using Hyak.Common; namespace Microsoft.Azure.Commands.DataFactories { @@ -47,7 +48,7 @@ public virtual Pipeline CreateOrUpdatePipeline(string resourceGroupName, string public virtual HttpStatusCode DeletePipeline(string resourceGroupName, string dataFactoryName, string pipelineName) { - OperationResponse response = DataPipelineManagementClient.Pipelines.Delete( + AzureOperationResponse response = DataPipelineManagementClient.Pipelines.Delete( resourceGroupName, dataFactoryName, pipelineName); return response.StatusCode; diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories/Models/DataFactoryClient.Tables.cs b/src/ResourceManager/DataFactories/Commands.DataFactories/Models/DataFactoryClient.Tables.cs index d50a2d1efac8..504ce3daf71e 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories/Models/DataFactoryClient.Tables.cs +++ b/src/ResourceManager/DataFactories/Commands.DataFactories/Models/DataFactoryClient.Tables.cs @@ -21,6 +21,7 @@ using Microsoft.Azure.Management.DataFactories; using Microsoft.Azure.Management.DataFactories.Models; using Microsoft.WindowsAzure; +using Hyak.Common; namespace Microsoft.Azure.Commands.DataFactories { @@ -79,7 +80,7 @@ public virtual List ListTables(string resourceGroupName, string dataFac public virtual HttpStatusCode DeleteTable(string resourceGroupName, string dataFactoryName, string tableName) { - OperationResponse response = DataPipelineManagementClient.Tables.Delete(resourceGroupName, dataFactoryName, tableName); + AzureOperationResponse response = DataPipelineManagementClient.Tables.Delete(resourceGroupName, dataFactoryName, tableName); return response.StatusCode; } diff --git a/src/ResourceManager/DataFactories/Commands.DataFactories/packages.config b/src/ResourceManager/DataFactories/Commands.DataFactories/packages.config index 404260a2d015..155a485c2aa7 100644 --- a/src/ResourceManager/DataFactories/Commands.DataFactories/packages.config +++ b/src/ResourceManager/DataFactories/Commands.DataFactories/packages.config @@ -1,13 +1,18 @@  - + + + + + + - + + - - + \ No newline at end of file diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault.Test/Commands.KeyVault.Test.csproj b/src/ResourceManager/KeyVault/Commands.KeyVault.Test/Commands.KeyVault.Test.csproj index 2371d5c7366c..9f1989140747 100644 --- a/src/ResourceManager/KeyVault/Commands.KeyVault.Test/Commands.KeyVault.Test.csproj +++ b/src/ResourceManager/KeyVault/Commands.KeyVault.Test/Commands.KeyVault.Test.csproj @@ -48,8 +48,29 @@ false - - ..\..\..\packages\Hydra.HttpRecorder.1.0.5406.28672-prerelease\lib\net45\Microsoft.Azure.Utilities.HttpRecorder.dll + + ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll + + + False + ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll + + + ..\..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll + + + False + ..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll + + + False + ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll False @@ -65,20 +86,12 @@ ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - - False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll - - - False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll - - - ..\..\..\packages\Hydra.SpecTestSupport.1.0.5406.28672-prerelease\lib\net45\Microsoft.WindowsAzure.Testing.dll + + ..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.dll - + False - ..\..\..\packages\Moq.4.2.1409.1722\lib\net40\Moq.dll + ..\..\..\packages\Moq.4.2.1402.2112\lib\net40\Moq.dll False diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault.Test/packages.config b/src/ResourceManager/KeyVault/Commands.KeyVault.Test/packages.config index eaefc95c996e..bea4bcaf95a9 100644 --- a/src/ResourceManager/KeyVault/Commands.KeyVault.Test/packages.config +++ b/src/ResourceManager/KeyVault/Commands.KeyVault.Test/packages.config @@ -1,15 +1,19 @@  - - + + + + + + + - - - + + \ No newline at end of file diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands.KeyVault.csproj b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands.KeyVault.csproj index f96838b049d0..d2496788efdb 100644 --- a/src/ResourceManager/KeyVault/Commands.KeyVault/Commands.KeyVault.csproj +++ b/src/ResourceManager/KeyVault/Commands.KeyVault/Commands.KeyVault.csproj @@ -108,9 +108,22 @@ + + ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll + + + False + ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll + False - ..\..\..\packages\Microsoft.Azure.Management.Resources.2.7.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll + ..\..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll ..\..\..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll @@ -121,6 +134,13 @@ ..\..\..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll + + False + ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll + + + ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll + False ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll @@ -129,13 +149,9 @@ False ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - + False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.dll - - - False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.0\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.dll False @@ -157,10 +173,6 @@ - - {b95c489c-8cb7-4dcf-8d5f-b9aebdbbaf89} - Common.Extensions - {5ee72c53-1720-4309-b54b-5fb79703195f} Commands.Common diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyVaultDataServiceClient.cs b/src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyVaultDataServiceClient.cs index a59940bde5d2..25fc99a3200c 100644 --- a/src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyVaultDataServiceClient.cs +++ b/src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyVaultDataServiceClient.cs @@ -12,12 +12,12 @@ // limitations under the License. // ---------------------------------------------------------------------------------- +using Hyak.Common; using Microsoft.Azure.Commands.KeyVault.Properties; using Microsoft.Azure.Commands.KeyVault.WebKey; using Microsoft.Azure.Common.Extensions; using Microsoft.Azure.Common.Extensions.Models; using Microsoft.WindowsAzure; -using Microsoft.WindowsAzure.Common.Internals; using System; using System.Collections.Generic; using System.IO; @@ -322,17 +322,17 @@ public KeyBundle RestoreKey(string vaultName, string inputBlobPath) private void SendRequestCallback(string correlationId, HttpRequestMessage request) { - if (CloudContext.Configuration.Tracing.IsEnabled) + if (TracingAdapter.IsEnabled) { - Tracing.SendRequest(correlationId, request); + TracingAdapter.SendRequest(correlationId, request); } } private void ReceiveResponseCallback(string correlationId, HttpResponseMessage response) { - if (CloudContext.Configuration.Tracing.IsEnabled) + if (TracingAdapter.IsEnabled) { - Tracing.ReceiveResponse(correlationId, response); + TracingAdapter.ReceiveResponse(correlationId, response); } } diff --git a/src/ResourceManager/KeyVault/Commands.KeyVault/packages.config b/src/ResourceManager/KeyVault/Commands.KeyVault/packages.config index 219ecbb28323..bdde83a6dc79 100644 --- a/src/ResourceManager/KeyVault/Commands.KeyVault/packages.config +++ b/src/ResourceManager/KeyVault/Commands.KeyVault/packages.config @@ -1,10 +1,15 @@  + + + + + + - - + \ No newline at end of file diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache.Test/Commands.RedisCache.Test.csproj b/src/ResourceManager/RedisCache/Commands.RedisCache.Test/Commands.RedisCache.Test.csproj index 9d97b35690d5..81c12f4c1222 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache.Test/Commands.RedisCache.Test.csproj +++ b/src/ResourceManager/RedisCache/Commands.RedisCache.Test/Commands.RedisCache.Test.csproj @@ -41,12 +41,32 @@ false + + ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll + + + False + ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll + - ..\..\..\packages\Microsoft.Azure.Management.Redis.0.12.0-preview\lib\net40\Microsoft.Azure.Management.Redis.dll + ..\..\..\packages\Microsoft.Azure.Management.Redis.0.14.0-preview\lib\net40\Microsoft.Azure.Management.Redis.dll + + + ..\..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll + + + False + ..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll - + False - ..\..\..\packages\Hydra.HttpRecorder.1.0.5417.13285-prerelease\lib\net45\Microsoft.Azure.Utilities.HttpRecorder.dll + ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll False @@ -68,17 +88,8 @@ False ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - - False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll - - - False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll - - - False - ..\..\..\packages\Hydra.SpecTestSupport.1.0.5417.13285-prerelease\lib\net45\Microsoft.WindowsAzure.Testing.dll + + ..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.dll False @@ -125,10 +136,6 @@ - - {b95c489c-8cb7-4dcf-8d5f-b9aebdbbaf89} - Common.Extensions - {c1bda476-a5cc-4394-914d-48b0ec31a710} Commands.ScenarioTests.Common diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.cs b/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.cs index f08f81cb980d..921c9151905b 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.cs +++ b/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.cs @@ -15,7 +15,7 @@ namespace Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests { using Microsoft.WindowsAzure.Commands.ScenarioTest; - using Microsoft.WindowsAzure.Testing; + using Microsoft.Azure.Test; using Xunit; public class RedisCacheTests : RedisCacheTestsBase diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTestsBase.cs b/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTestsBase.cs index c6519b8ab712..7925889e9557 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTestsBase.cs +++ b/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTestsBase.cs @@ -17,7 +17,7 @@ namespace Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests using System; using Microsoft.WindowsAzure.Commands.ScenarioTest; using Microsoft.WindowsAzure.Commands.Utilities.Common; - using Microsoft.WindowsAzure.Testing; + using Microsoft.Azure.Test; using Microsoft.Azure.Management.Redis; using Microsoft.Azure.Common.Extensions; diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache.Test/packages.config b/src/ResourceManager/RedisCache/Commands.RedisCache.Test/packages.config index df002d1bddd5..6a593376f14f 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache.Test/packages.config +++ b/src/ResourceManager/RedisCache/Commands.RedisCache.Test/packages.config @@ -1,15 +1,19 @@  - - - + + + + + + + + - - + diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache/Commands.RedisCache.csproj b/src/ResourceManager/RedisCache/Commands.RedisCache/Commands.RedisCache.csproj index 49d934539a72..e754d5f89adc 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache/Commands.RedisCache.csproj +++ b/src/ResourceManager/RedisCache/Commands.RedisCache/Commands.RedisCache.csproj @@ -46,9 +46,26 @@ false + + ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll + + + False + ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll + False - ..\..\..\packages\Microsoft.Azure.Management.Redis.0.12.0-preview\lib\net40\Microsoft.Azure.Management.Redis.dll + ..\..\..\packages\Microsoft.Azure.Management.Redis.0.14.0-preview\lib\net40\Microsoft.Azure.Management.Redis.dll + + + False + ..\..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll False @@ -70,13 +87,9 @@ False ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - + False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll - - - False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.dll False @@ -123,10 +136,6 @@ - - {b95c489c-8cb7-4dcf-8d5f-b9aebdbbaf89} - Common.Extensions - {5ee72c53-1720-4309-b54b-5fb79703195f} Commands.Common diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache/Commands/NewAzureRedisCache.cs b/src/ResourceManager/RedisCache/Commands.RedisCache/Commands/NewAzureRedisCache.cs index a12ae8c25e3e..0b2b0b6a8628 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache/Commands/NewAzureRedisCache.cs +++ b/src/ResourceManager/RedisCache/Commands.RedisCache/Commands/NewAzureRedisCache.cs @@ -21,6 +21,7 @@ namespace Microsoft.Azure.Commands.RedisCache using System.Management.Automation; using SkuStrings = Microsoft.Azure.Management.Redis.Models.SkuName; using MaxMemoryPolicyStrings = Microsoft.Azure.Management.Redis.Models.MaxMemoryPolicy; + using Hyak.Common; [Cmdlet(VerbsCommon.New, "AzureRedisCache"), OutputType(typeof(RedisCacheAttributesWithAccessKeys))] public class NewAzureRedisCache : RedisCacheCmdletBase @@ -101,11 +102,11 @@ public override void ExecuteCmdlet() } catch (CloudException ex) { - if (ex.ErrorCode == "ResourceNotFound" || ex.Message.Contains("ResourceNotFound")) + if (ex.Error.Code == "ResourceNotFound" || ex.Message.Contains("ResourceNotFound")) { // cache does not exists so go ahead and create one } - else if (ex.ErrorCode == "ResourceGroupNotFound" || ex.Message.Contains("ResourceGroupNotFound")) + else if (ex.Error.Code == "ResourceGroupNotFound" || ex.Message.Contains("ResourceGroupNotFound")) { // resource group not found, let create throw error don't throw from here } diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache/Models/RedisCacheClient.cs b/src/ResourceManager/RedisCache/Commands.RedisCache/Models/RedisCacheClient.cs index 5260bdc592be..fe0241307c05 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache/Models/RedisCacheClient.cs +++ b/src/ResourceManager/RedisCache/Commands.RedisCache/Models/RedisCacheClient.cs @@ -59,7 +59,7 @@ public RedisCreateOrUpdateResponse CreateOrUpdateCache(string resourceGroupName, return response; } - public OperationResponse DeleteCache(string resourceGroupName, string cacheName) + public AzureOperationResponse DeleteCache(string resourceGroupName, string cacheName) { return _client.Redis.Delete(resourceGroupName: resourceGroupName, name: cacheName); } @@ -86,7 +86,7 @@ public RedisListResponse ListCachesUsingNextLink(string nextLink) return _client.Redis.ListNext(nextLink: nextLink); } - public OperationResponse RegenerateAccessKeys(string resourceGroupName, string cacheName, RedisKeyType keyType) + public AzureOperationResponse RegenerateAccessKeys(string resourceGroupName, string cacheName, RedisKeyType keyType) { return _client.Redis.RegenerateKey(resourceGroupName: resourceGroupName, name: cacheName, parameters: new RedisRegenerateKeyParameters() { KeyType = keyType }); } diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache/packages.config b/src/ResourceManager/RedisCache/Commands.RedisCache/packages.config index 305c15591e8b..7020401c726a 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache/packages.config +++ b/src/ResourceManager/RedisCache/Commands.RedisCache/packages.config @@ -1,12 +1,16 @@  - + + + + + + - - + \ No newline at end of file diff --git a/src/ResourceManager/Resources/Commands.Resources.Test/Commands.Resources.Test.csproj b/src/ResourceManager/Resources/Commands.Resources.Test/Commands.Resources.Test.csproj index 960fccd5f28c..1a164308a647 100644 --- a/src/ResourceManager/Resources/Commands.Resources.Test/Commands.Resources.Test.csproj +++ b/src/ResourceManager/Resources/Commands.Resources.Test/Commands.Resources.Test.csproj @@ -1,5 +1,6 @@  + Debug @@ -15,6 +16,7 @@ ..\..\..\ true {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 944f727b true @@ -42,28 +44,36 @@ false + + ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll + + + ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll + - ..\..\..\packages\Microsoft.Azure.Gallery.2.2.0-preview\lib\net40\Microsoft.Azure.Gallery.dll + ..\..\..\packages\Microsoft.Azure.Gallery.2.6.0-preview\lib\net40\Microsoft.Azure.Gallery.dll False - ..\..\..\packages\Microsoft.Azure.Graph.RBAC.1.4.0-preview\lib\net40\Microsoft.Azure.Graph.RBAC.dll + ..\..\..\packages\Microsoft.Azure.Graph.RBAC.1.6.0-preview\lib\net40\Microsoft.Azure.Graph.RBAC.dll - False - ..\..\..\packages\Microsoft.Azure.Management.Authorization.0.11.0-preview\lib\net40\Microsoft.Azure.Management.Authorization.dll - - - False - ..\..\..\packages\Microsoft.Azure.Monitoring.2.2.0-preview\lib\net40\Microsoft.Azure.Monitoring.dll + ..\..\..\packages\Microsoft.Azure.Management.Authorization.0.16.0-preview\lib\net40\Microsoft.Azure.Management.Authorization.dll - False - ..\..\..\packages\Microsoft.Azure.Management.Resources.2.7.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll + ..\..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll - - False - ..\..\..\packages\Hydra.HttpRecorder.1.0.5417.13285-prerelease\lib\net45\Microsoft.Azure.Utilities.HttpRecorder.dll + + ..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll + + + ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll False @@ -85,21 +95,11 @@ False ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - - False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll - - - False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll - - - False - ..\..\..\packages\Microsoft.WindowsAzure.Management.Storage.3.1.0\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll + + ..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.dll - - False - ..\..\..\packages\Hydra.SpecTestSupport.1.0.5417.13285-prerelease\lib\net45\Microsoft.WindowsAzure.Testing.dll + + ..\..\..\packages\Microsoft.WindowsAzure.Management.Storage.5.0.0\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll False @@ -176,10 +176,6 @@ - - {b95c489c-8cb7-4dcf-8d5f-b9aebdbbaf89} - Common.Extensions - {c1bda476-a5cc-4394-914d-48b0ec31a710} Commands.ScenarioTests.Common @@ -382,6 +378,12 @@ PreserveNewest + + PreserveNewest + + + PreserveNewest + PreserveNewest @@ -429,6 +431,12 @@ xcopy "$(SolutionDir)Package\$(ConfigurationName)\*.*" $(TargetDir) /Y /E + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + Get-AzureStorageContainerStoredAccessPolicy + + List the specified Stored Access Policy for an azure storage container, or list all the Stored Access Policies for an azure storage container. + + + + + Get + AzureStorageContainerStoredAccessPolicy + + + + + List the specified Stored Access Policy for an azure storage container, or list all the Stored Access Policies for an azure storage container. + + + + Get-AzureStorageContainerStoredAccessPolicy + + Container + + Azure storage container name. + + String + + + Policy + + Azure Stored Access Policy. + + String + + + Context + + Azure storage context + + AzureStorageContext + + + + + + Container + + Azure storage container name. + + String + + String + + + + + + Policy + + Azure Stored Access Policy. + + String + + String + + + + + + Context + + Azure storage context + + AzureStorageContext + + AzureStorageContext + + + + + + PipelineVariable + + + + string + + string + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -------------------------- List a stored access policy in container -------------------------- + + + + PS C:\> Get-AzureStorageContainerStoredAccessPolicy -Container test -Policy testPolicy + + + + + + + + + + + -------------------------- List all the stored access policies in container -------------------------- + + + + PS C:\> Get-AzureStorageContainerStoredAccessPolicy -Container test + + + + + + + + + + + + + http://msdn.microsoft.com/en-us/library/azure/dn140257.aspx + + + + + Get-AzureStorageFile @@ -2893,85 +3058,80 @@ echo "Total $total containers" - Get-AzureStorageServiceLoggingProperty + Get-AzureStorageQueueStoredAccessPolicy - Get azure storage service logging properties. + List the specified Stored Access Policy for an azure storage queue, or list all the Stored Access Policies for an azure storage queue. Get - AzureStorageServiceLoggingProperty + AzureStorageQueueStoredAccessPolicy - Get azure storage service logging properties. + List the specified Stored Access Policy for an azure storage queue, or list all the Stored Access Policies for an azure storage queue. - Get-AzureStorageServiceLoggingProperty - - ServiceType + Get-AzureStorageQueueStoredAccessPolicy + + Queue - Azure storage service type. + Azure storage queue name. - StorageServiceType + String + + + Policy + + Azure Stored Access Policy. + + String Context - Azure storage context. + Azure storage context AzureStorageContext - - ServiceType - - Azure storage service type. - - StorageServiceType - - StorageServiceType - - - - - - Context + + Queue - Azure storage context. + Azure storage queue name. - AzureStorageContext + String - AzureStorageContext + String - - ServerTimeoutPerRequest + + Policy - Server side time out for each request. + Azure Stored Access Policy. - int32 + String - int32 + String - - ClientTimeoutPerRequest + + Context - Client side time out for each request. + Azure storage context - int32 + AzureStorageContext - int32 + AzureStorageContext @@ -3023,11 +3183,26 @@ echo "Total $total containers" - -------------------------- Get azure storage blob service logging properties. -------------------------- + -------------------------- List a stored access policy in queue -------------------------- - PS C:\> Get-AzureStorageServiceLoggingProperty -ServiceType Blob + PS C:\> Get-AzureStorageQueueStoredAccessPolicy -Queue test -Policy testPolicy + + + + + + + + + + + -------------------------- List all the stored access policies in queue -------------------------- + + + + PS C:\> Get-AzureStorageQueueStoredAccessPolicy -Queue test @@ -3041,30 +3216,30 @@ echo "Total $total containers" http://msdn.microsoft.com/en-us/library/dn806375.aspx - + - Get-AzureStorageServiceMetricsProperty + Get-AzureStorageServiceLoggingProperty - Get azure storage service metrics properties. + Get azure storage service logging properties. Get - AzureStorageServiceMetricsProperty + AzureStorageServiceLoggingProperty - Get azure storage service metrics properties. + Get azure storage service logging properties. - Get-AzureStorageServiceMetricsProperty + Get-AzureStorageServiceLoggingProperty ServiceType @@ -3072,13 +3247,6 @@ echo "Total $total containers" StorageServiceType - - MetricsType - - Metrics type. - - ServiceMetricsType - Context @@ -3101,18 +3269,176 @@ echo "Total $total containers" - - MetricsType - - Metrics type. - - ServiceMetricsType - - ServiceMetricsType - - - - + + Context + + Azure storage context. + + AzureStorageContext + + AzureStorageContext + + + + + + ServerTimeoutPerRequest + + Server side time out for each request. + + int32 + + int32 + + + + + + ClientTimeoutPerRequest + + Client side time out for each request. + + int32 + + int32 + + + + + + PipelineVariable + + + + string + + string + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -------------------------- Get azure storage blob service logging properties. -------------------------- + + + + PS C:\> Get-AzureStorageServiceLoggingProperty -ServiceType Blob + + + + + + + + + + + + + + + + + Get-AzureStorageServiceMetricsProperty + + Get azure storage service metrics properties. + + + + + Get + AzureStorageServiceMetricsProperty + + + + + Get azure storage service metrics properties. + + + + Get-AzureStorageServiceMetricsProperty + + ServiceType + + Azure storage service type. + + StorageServiceType + + + MetricsType + + Metrics type. + + ServiceMetricsType + + + Context + + Azure storage context. + + AzureStorageContext + + + + + + ServiceType + + Azure storage service type. + + StorageServiceType + + StorageServiceType + + + + + + MetricsType + + Metrics type. + + ServiceMetricsType + + ServiceMetricsType + + + + Context @@ -3730,113 +4056,278 @@ echo "Total $total containers" - New-AzureStorageBlobSASToken + Get-AzureStorageTableStoredAccessPolicy - Generate Shared Access Signature token for azure storage blob. + List the specified Stored Access Policy for an azure storage table, or list all the Stored Access Policies for an azure storage tabel. - New - AzureStorageBlobSASToken + Get + AzureStorageTableStoredAccessPolicy - Generate Shared Access Signature token for azure storage blob. + List the specified Stored Access Policy for an azure storage table, or list all the Stored Access Policies for an azure storage tabel. - New-AzureStorageBlobSASToken - - Container - - Azure storage container name. - - String - - - Blob + Get-AzureStorageTableStoredAccessPolicy + + Table - Azure storage blob name. + Azure storage table name. String - - Permission + + Policy - Permissions for a storage blob. + Azure Stored Access Policy. String - - StartTime - - The time at which the shared access signature becomes valid. - - Nullable`1[DateTime] - - - ExpiryTime - - The time at which the shared access signature becomes invalid. - - Nullable`1[DateTime] - - - FullUri - - Return the full blob uri with sas token. - - SwitchParameter - Context - Azure storage context. + Azure storage context AzureStorageContext - - New-AzureStorageBlobSASToken - - ICloudBlob - - ICloudBlob object - - ICloudBlob - - - Permission - - Permissions for a storage blob. - - String - - - StartTime - - The time at which the shared access signature becomes valid. - - Nullable`1[DateTime] - - - ExpiryTime - - The time at which the shared access signature becomes invalid. - - Nullable`1[DateTime] - - - FullUri - - Return the full blob uri with sas token. - - SwitchParameter - - - Context + + + + Table + + Azure storage table name. + + String + + String + + + + + + Policy + + Azure Stored Access Policy. + + String + + String + + + + + + Context + + Azure storage context + + AzureStorageContext + + AzureStorageContext + + + + + + PipelineVariable + + + + string + + string + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -------------------------- List a stored access policy in table -------------------------- + + + + PS C:\> Get-AzureStorageTableStoredAccessPolicy -Table test -Policy testPolicy + + + + + + + + + + + -------------------------- List all the stored access policies in table -------------------------- + + + + PS C:\> Get-AzureStorageTableStoredAccessPolicy -Table test + + + + + + + + + + + + + http://msdn.microsoft.com/en-us/library/azure/dn140257.aspx + + + + + + + + New-AzureStorageBlobSASToken + + Generate Shared Access Signature token for azure storage blob. + + + + + New + AzureStorageBlobSASToken + + + + + Generate Shared Access Signature token for azure storage blob. + + + + New-AzureStorageBlobSASToken + + Container + + Azure storage container name. + + String + + + Blob + + Azure storage blob name. + + String + + + Permission + + Permissions for a storage blob. + + String + + + StartTime + + The time at which the shared access signature becomes valid. + + Nullable`1[DateTime] + + + ExpiryTime + + The time at which the shared access signature becomes invalid. + + Nullable`1[DateTime] + + + FullUri + + Return the full blob uri with sas token. + + SwitchParameter + + + Context + + Azure storage context. + + AzureStorageContext + + + + New-AzureStorageBlobSASToken + + ICloudBlob + + ICloudBlob object + + ICloudBlob + + + Permission + + Permissions for a storage blob. + + String + + + StartTime + + The time at which the shared access signature becomes valid. + + Nullable`1[DateTime] + + + ExpiryTime + + The time at which the shared access signature becomes invalid. + + Nullable`1[DateTime] + + + FullUri + + Return the full blob uri with sas token. + + SwitchParameter + + + Context Azure storage context. @@ -4661,57 +5152,264 @@ New-AzureStorageBlobSASToken -Container cname -Blob bname -Permission rwd -Start - New-AzureStorageContext + New-AzureStorageContainerStoredAccessPolicy - Create an azure storage context using azure storage credentials. + Create Stored Access Policy for azure storage container. New - AzureStorageContext + AzureStorageContainerStoredAccessPolicy - Create an azure storage context using azure storage credentials. + Create Stored Access Policy for azure storage container. - New-AzureStorageContext - - StorageAccountName + New-AzureStorageContainerStoredAccessPolicy + + Container - Azure storage account name + Azure storage container name. String - StorageAccountKey + Policy - Azure storage account key. + Azure Stored Access Policy. String - - Protocol + + Permission - Transfer Protocol (https/http). + Permissions for a storage container. String - - Endpoint + + StartTime - Azure Storage Endpoint. + The time at which the stored access policy becomes valid. - String + Nullable`1[DateTime] - - - New-AzureStorageContext - - StorageAccountName + + ExpiryTime + + The time at which the stored access policy becomes invalid. + + Nullable`1[DateTime] + + + Context + + Azure storage context + + AzureStorageContext + + + + + + Container + + Azure storage container name. + + String + + String + + + + + + Policy + + Azure Stored Access Policy. + + String + + String + + + + + + Permission + + Permissions for a storage container. + + String + + String + + + + + + StartTime + + The time at which the stored access policy becomes valid. + + Nullable`1[DateTime] + + Nullable`1[DateTime] + + + + + + ExpiryTime + + The time at which the stored access policy becomes invalid. + + Nullable`1[DateTime] + + Nullable`1[DateTime] + + + + + + Context + + Azure storage context + + AzureStorageContext + + AzureStorageContext + + + + + + PipelineVariable + + + + string + + string + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -------------------------- Create a stored access policy in container with full permission -------------------------- + + + + PS C:\> New-AzureStorageContainerStoredAccessPolicy -Container test -Policy testPolicy -Permission audq + + + + + + + + + + + + + http://msdn.microsoft.com/en-us/library/azure/dn140257.aspx + + + + + + + + New-AzureStorageContext + + Create an azure storage context using azure storage credentials. + + + + + New + AzureStorageContext + + + + + Create an azure storage context using azure storage credentials. + + + + New-AzureStorageContext + + StorageAccountName + + Azure storage account name + + String + + + StorageAccountKey + + Azure storage account key. + + String + + + Protocol + + Transfer Protocol (https/http). + + String + + + Endpoint + + Azure Storage Endpoint. + + String + + + + New-AzureStorageContext + + StorageAccountName Azure storage account name @@ -6052,78 +6750,285 @@ $context | Get-AzureStorageBlob -Container abc - New-AzureStorageShare + New-AzureStorageQueueStoredAccessPolicy - Create a new Azure storage file share. + Create Stored Access Policy for azure storage queue. New - AzureStorageShare + AzureStorageQueueStoredAccessPolicy - Create a new Azure storage file share. + Create Stored Access Policy for azure storage queue. - New-AzureStorageShare - - Name + New-AzureStorageQueueStoredAccessPolicy + + Queue - The file share name + Azure storage queue name. String - - Context + + Policy - Azure Storage Context. You can create it by New-AzureStorageContext cmdlet. + Azure Stored Access Policy. - AzureStorageContext + String - - ServerTimeoutPerRequest + + Permission - Server side timeout value for the request. + Permissions for a storage queue. - Nullable`1[Int32] + String - ClientTimeoutPerRequest + StartTime - Client side timeout value for the request. + The time at which the stored access policy becomes valid. - Nullable`1[Int32] + Nullable`1[DateTime] - ConcurrentTaskCount - - - - Nullable`1[Int32] - - - - New-AzureStorageShare - - Name + ExpiryTime - The file share name + The time at which the stored access policy becomes invalid. - String + Nullable`1[DateTime] - + Context - Azure Storage Context. You can create it by New-AzureStorageContext cmdlet. + Azure storage context AzureStorageContext - - ServerTimeoutPerRequest + + + + + Queue + + Azure storage queue name. + + String + + String + + + + + + Policy + + Azure Stored Access Policy. + + String + + String + + + + + + Permission + + Permissions for a storage queue. + + String + + String + + + + + + StartTime + + The time at which the stored access policy becomes valid. + + Nullable`1[DateTime] + + Nullable`1[DateTime] + + + + + + ExpiryTime + + The time at which the stored access policy becomes invalid. + + Nullable`1[DateTime] + + Nullable`1[DateTime] + + + + + + Context + + Azure storage context + + AzureStorageContext + + AzureStorageContext + + + + + + PipelineVariable + + + + string + + string + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -------------------------- Create a stored access policy in queue with full permission -------------------------- + + + + PS C:\> New-AzureStorageQueueStoredAccessPolicy -Queue test -Policy testPolicy -Permission arup + + + + + + + + + + + + + http://msdn.microsoft.com/en-us/library/azure/dn140257.aspx + + + + + + + + New-AzureStorageShare + + Create a new Azure storage file share. + + + + + New + AzureStorageShare + + + + + Create a new Azure storage file share. + + + + New-AzureStorageShare + + Name + + The file share name + + String + + + Context + + Azure Storage Context. You can create it by New-AzureStorageContext cmdlet. + + AzureStorageContext + + + ServerTimeoutPerRequest + + Server side timeout value for the request. + + Nullable`1[Int32] + + + ClientTimeoutPerRequest + + Client side timeout value for the request. + + Nullable`1[Int32] + + + ConcurrentTaskCount + + + + Nullable`1[Int32] + + + + New-AzureStorageShare + + Name + + The file share name + + String + + + Context + + Azure Storage Context. You can create it by New-AzureStorageContext cmdlet. + + AzureStorageContext + + + ServerTimeoutPerRequest Server side timeout value for the request. @@ -6903,71 +7808,278 @@ $context | Get-AzureStorageBlob -Container abc - Remove-AzureStorageBlob + New-AzureStorageTableStoredAccessPolicy - Remove the specified azure storage blob. + Create Stored Access Policy for azure storage table. - Remove - AzureStorageBlob + New + AzureStorageTableStoredAccessPolicy - Remove the specified azure storage blob. + Create Stored Access Policy for azure storage table. - Remove-AzureStorageBlob - - Blob + New-AzureStorageTableStoredAccessPolicy + + Table - Blob name. + Azure storage table name. String - Container + Policy - Container name. + Azure Stored Access Policy. String - - DeleteSnapshot + + Permission - Only delete blob snapshots. + Permissions for a storage table. - SwitchParameter + String - - Force + + StartTime - Force to remove the blob and its snapshot without confirmation. + The time at which the stored access policy becomes valid. - SwitchParameter + Nullable`1[DateTime] - - PassThru + + ExpiryTime - + The time at which the stored access policy becomes invalid. - SwitchParameter + Nullable`1[DateTime] Context - Azure Storage Context. You can create it by New-AzureStorageContext cmdlet. + Azure storage context AzureStorageContext - - ServerTimeoutPerRequest - - Server side time out for each request. - + + + + + Table + + Azure storage table name. + + String + + String + + + + + + Policy + + Azure Stored Access Policy. + + String + + String + + + + + + Permission + + Permissions for a storage table. + + String + + String + + + + + + StartTime + + The time at which the stored access policy becomes valid. + + Nullable`1[DateTime] + + Nullable`1[DateTime] + + + + + + ExpiryTime + + The time at which the stored access policy becomes invalid. + + Nullable`1[DateTime] + + Nullable`1[DateTime] + + + + + + Context + + Azure storage context + + AzureStorageContext + + AzureStorageContext + + + + + + PipelineVariable + + + + string + + string + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -------------------------- Create a stored access policy in table with full permission -------------------------- + + + + PS C:\> New-AzureStorageTableStoredAccessPolicy -Table test -Policy testPolicy -Permission raud + + + + + + + + + + + + + http://msdn.microsoft.com/en-us/library/azure/dn140257.aspx + + + + + + + + Remove-AzureStorageBlob + + Remove the specified azure storage blob. + + + + + Remove + AzureStorageBlob + + + + + Remove the specified azure storage blob. + + + + Remove-AzureStorageBlob + + Blob + + Blob name. + + String + + + Container + + Container name. + + String + + + DeleteSnapshot + + Only delete blob snapshots. + + SwitchParameter + + + Force + + Force to remove the blob and its snapshot without confirmation. + + SwitchParameter + + + PassThru + + + + SwitchParameter + + + Context + + Azure Storage Context. You can create it by New-AzureStorageContext cmdlet. + + AzureStorageContext + + + ServerTimeoutPerRequest + + Server side time out for each request. + Nullable`1[Int32] @@ -7665,89 +8777,315 @@ $context | Get-AzureStorageBlob -Container abc - Remove-AzureStorageDirectory + Remove-AzureStorageContainerStoredAccessPolicy - Remove an azure storage file directory. + Remove Stored Access Policy from azure storage container. Remove - AzureStorageDirectory + AzureStorageContainerStoredAccessPolicy - Remove an azure storage file directory. + Remove Stored Access Policy from azure storage container. - Remove-AzureStorageDirectory - - ShareName + Remove-AzureStorageContainerStoredAccessPolicy + + Container - The file share name + Azure storage container name. String - - Path + + Policy - The path of the file directory to be removed + Azure Stored Access Policy. String + + Force + + Force to remove the policy without confirmation + + SwitchParameter + PassThru - + Output a bool value in order to indicate whether the specified policy is remove successfully. SwitchParameter - + Context Azure Storage Context. You can create it by New-AzureStorageContext cmdlet. AzureStorageContext - - ServerTimeoutPerRequest - - Server side timeout value for the request - - Nullable`1[Int32] - - - ClientTimeoutPerRequest - - Client side timeout value for the request - - Nullable`1[Int32] - - - ConcurrentTaskCount - - - - Nullable`1[Int32] - WhatIf - Shows what would happen if the cmdlet runs. The cmdlet is not run. + SwitchParameter Confirm - Prompts you for confirmation before running the cmdlet. + SwitchParameter - + + + + Container + + Azure storage container name. + + String + + String + + + + + + Policy + + Azure Stored Access Policy. + + String + + String + + + + + + Force + + Force to remove the policy without confirmation + + SwitchParameter + + SwitchParameter + + + + + + PassThru + + Output a bool value in order to indicate whether the specified policy is remove successfully. + + SwitchParameter + + SwitchParameter + + + + + + Context + + Azure Storage Context. You can create it by New-AzureStorageContext cmdlet. + + AzureStorageContext + + AzureStorageContext + + + + + + WhatIf + + + + SwitchParameter + + SwitchParameter + + + + + + Confirm + + + + SwitchParameter + + SwitchParameter + + + + + + PipelineVariable + + + + string + + string + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -------------------------- Remove a stored access policy from container -------------------------- + + + + PS C:\> Remove-AzureStorageContainerStoredAccessPolicy -Container test -Policy testPolicy + + + + + + + + + + + + + http://msdn.microsoft.com/en-us/library/azure/dn140257.aspx + + + + + + + + Remove-AzureStorageDirectory + + Remove an azure storage file directory. + + + + + Remove + AzureStorageDirectory + + + + + Remove an azure storage file directory. + + + + Remove-AzureStorageDirectory + + ShareName + + The file share name + + String + + + Path + + The path of the file directory to be removed + + String + + + PassThru + + + + SwitchParameter + + + Context + + Azure Storage Context. You can create it by New-AzureStorageContext cmdlet. + + AzureStorageContext + + + ServerTimeoutPerRequest + + Server side timeout value for the request + + Nullable`1[Int32] + + + ClientTimeoutPerRequest + + Client side timeout value for the request + + Nullable`1[Int32] + + + ConcurrentTaskCount + + + + Nullable`1[Int32] + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + SwitchParameter + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + SwitchParameter + + + Remove-AzureStorageDirectory Share @@ -8939,14 +10277,496 @@ $context | Get-AzureStorageBlob -Container abc - - ClientTimeoutPerRequest + + ClientTimeoutPerRequest + + Client side time out for each request. + + int32 + + int32 + + + + + + PipelineVariable + + + + string + + string + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -------------------------- Remove azure storage queue by queue name -------------------------- + + + + PS C:\> Remove-AzureStorageQueue queueabc + + + + + + + + + + + -------------------------- Remove azure storage queue using GetAzureStorageQueue -------------------------- + + + + PS C:\> Get-AzureStorageQueue queue* | Remove-AzureStorageQueue + + + + + + + + + + + + + + + + + Remove-AzureStorageQueueStoredAccessPolicy + + Remove Stored Access Policy from azure storage queue. + + + + + Remove + AzureStorageQueueStoredAccessPolicy + + + + + Remove Stored Access Policy from azure storage queue. + + + + Remove-AzureStorageQueueStoredAccessPolicy + + Queue + + Azure storage queue name. + + String + + + Policy + + Azure Stored Access Policy. + + String + + + Force + + Force to remove the policy without confirmation + + SwitchParameter + + + PassThru + + Output a bool value in order to indicate whether the specified policy is remove successfully. + + SwitchParameter + + + Context + + Azure Storage Context. You can create it by New-AzureStorageContext cmdlet. + + AzureStorageContext + + + WhatIf + + + + SwitchParameter + + + Confirm + + + + SwitchParameter + + + + + + Queue + + Azure storage queue name. + + String + + String + + + + + + Policy + + Azure Stored Access Policy. + + String + + String + + + + + + Force + + Force to remove the policy without confirmation + + SwitchParameter + + SwitchParameter + + + + + + PassThru + + Output a bool value in order to indicate whether the specified policy is remove successfully. + + SwitchParameter + + SwitchParameter + + + + + + Context + + Azure Storage Context. You can create it by New-AzureStorageContext cmdlet. + + AzureStorageContext + + AzureStorageContext + + + + + + WhatIf + + + + SwitchParameter + + SwitchParameter + + + + + + Confirm + + + + SwitchParameter + + SwitchParameter + + + + + + PipelineVariable + + + + string + + string + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -------------------------- Remove a stored access policy from queue -------------------------- + + + + PS C:\> Remove-AzureStorageQueueStoredAccessPolicy -Queue test -Policy testPolicy + + + + + + + + + + + + + http://msdn.microsoft.com/en-us/library/azure/dn140257.aspx + + + + + + + + Set-AzureStorageQueueStoredAccessPolicy + + Set Stored Access Policy for azure storage queue. + + + + + Set + AzureStorageQueueStoredAccessPolicy + + + + + Set Stored Access Policy for azure storage queue. + + + + Set-AzureStorageQueueStoredAccessPolicy + + Queue + + Azure storage queue name. + + String + + + Policy + + Azure Stored Access Policy. + + String + + + Permission + + Permissions for a storage queue. + + String + + + StartTime + + The time at which the stored access policy becomes valid. + + Nullable`1[DateTime] + + + ExpiryTime + + The time at which the stored access policy becomes invalid. + + Nullable`1[DateTime] + + + NoStartTime + + Set the StartTime to be Null. + + SwitchParameter + + + NoExpiryTime + + Set the ExpiryTime to be Null. + + SwitchParameter + + + Context + + Azure storage context + + AzureStorageContext + + + + + + Queue + + Azure storage queue name. + + String + + String + + + + + + Policy + + Azure Stored Access Policy. + + String + + String + + + + + + Permission + + Permissions for a storage queue. + + String + + String + + + + + + StartTime + + The time at which the stored access policy becomes valid. + + Nullable`1[DateTime] + + Nullable`1[DateTime] + + + + + + ExpiryTime + + The time at which the stored access policy becomes invalid. + + Nullable`1[DateTime] + + Nullable`1[DateTime] + + + + + + NoStartTime + + Set the StartTime to be Null. + + SwitchParameter + + SwitchParameter + + + + + + NoExpiryTime + + Set the ExpiryTime to be Null. + + SwitchParameter + + SwitchParameter + + + + + + Context - Client side time out for each request. + Azure storage context - int32 + AzureStorageContext - int32 + AzureStorageContext @@ -8998,26 +10818,11 @@ $context | Get-AzureStorageBlob -Container abc - -------------------------- Remove azure storage queue by queue name -------------------------- - - - - PS C:\> Remove-AzureStorageQueue queueabc - - - - - - - - - - - -------------------------- Remove azure storage queue using GetAzureStorageQueue -------------------------- + -------------------------- Set a stored access policy in queue with full permission -------------------------- - PS C:\> Get-AzureStorageQueue queue* | Remove-AzureStorageQueue + PS C:\> Set-AzureStorageQueueStoredAccessPolicy -Queue test -Policy testPolicy -Permission arup @@ -9029,6 +10834,10 @@ $context | Get-AzureStorageBlob -Container abc + + http://msdn.microsoft.com/en-us/library/azure/dn140257.aspx + + @@ -9605,19 +11414,256 @@ $context | Get-AzureStorageBlob -Container abc int32 - int32 + int32 + + + + + + ClientTimeoutPerRequest + + Client side time out for each request. + + int32 + + int32 + + + + + + PipelineVariable + + + + string + + string + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -------------------------- Remove azure storage table by table name -------------------------- + + + + PS C:\> Remove-AzureStorageTable tableabc + + + + + + + + + + + -------------------------- Remove azure storage tables using GetAzureStorageTable -------------------------- + + + + PS C:\> Get-AzureStorageTable table* | Remove-AzureStorageTable + + + + + + + + + + + + + + + + + Remove-AzureStorageTableStoredAccessPolicy + + Remove Stored Access Policy from azure storage table. + + + + + Remove + AzureStorageTableStoredAccessPolicy + + + + + Remove Stored Access Policy from azure storage table. + + + + Remove-AzureStorageTableStoredAccessPolicy + + Table + + Azure storage table name. + + String + + + Policy + + Azure Stored Access Policy. + + String + + + Force + + Force to remove the policy without confirmation + + SwitchParameter + + + PassThru + + Output a bool value in order to indicate whether the specified policy is remove successfully. + + SwitchParameter + + + Context + + Azure Storage Context. You can create it by New-AzureStorageContext cmdlet. + + AzureStorageContext + + + WhatIf + + + + SwitchParameter + + + Confirm + + + + SwitchParameter + + + + + + Table + + Azure storage table name. + + String + + String + + + + + + Policy + + Azure Stored Access Policy. + + String + + String + + + + + + Force + + Force to remove the policy without confirmation + + SwitchParameter + + SwitchParameter + + + + + + PassThru + + Output a bool value in order to indicate whether the specified policy is remove successfully. + + SwitchParameter + + SwitchParameter + + + + + + Context + + Azure Storage Context. You can create it by New-AzureStorageContext cmdlet. + + AzureStorageContext + + AzureStorageContext + + + + + + WhatIf + + + + SwitchParameter + + SwitchParameter - ClientTimeoutPerRequest + Confirm - Client side time out for each request. + - int32 + SwitchParameter - int32 + SwitchParameter @@ -9669,26 +11715,11 @@ $context | Get-AzureStorageBlob -Container abc - -------------------------- Remove azure storage table by table name -------------------------- - - - - PS C:\> Remove-AzureStorageTable tableabc - - - - - - - - - - - -------------------------- Remove azure storage tables using GetAzureStorageTable -------------------------- + -------------------------- Remove a stored access policy from table -------------------------- - PS C:\> Get-AzureStorageTable table* | Remove-AzureStorageTable + PS C:\> Remove-AzureStorageTableStoredAccessPolicy -Table test -Policy testPolicy @@ -9700,6 +11731,10 @@ $context | Get-AzureStorageBlob -Container abc + + http://msdn.microsoft.com/en-us/library/azure/dn140257.aspx + + @@ -10354,55 +12389,327 @@ Set-AzureStorageBlobContent -File filename -Container containername -Metadata $m SwitchParameter - SwitchParameter + SwitchParameter + + + + + + Context + + Azure Storage Context. You can create it by New-AzureStorageContext cmdlet. + + AzureStorageContext + + AzureStorageContext + + + + + + ServerTimeoutPerRequest + + Server side time out for each request. + + Nullable`1[Int32] + + Nullable`1[Int32] + + + + + + ClientTimeoutPerRequest + + Client side time out for each request. + + Nullable`1[Int32] + + Nullable`1[Int32] + + + + + + ConcurrentTaskCount + + + + Nullable`1[Int32] + + Nullable`1[Int32] + + + + + + PipelineVariable + + + + string + + string + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -------------------------- Set azure storage container acl by name. -------------------------- + + + + PS C:\> Set-AzureStorageContainerAcl -Container container1 -Permission off -PassThru + + + + + + + + + + + -------------------------- Set azure storage container acl using pipeline by GetAzureStorageContainer -------------------------- + + + + PS C:\> Get-AzureStorageContainer container* | Set-AzureStorageContainerAcl -Permission blob -PassThru + + + + + + + + + + + + + Get-AzureStorageContainerAcl + + + + Get-AzureStorageContainer + + + + New-AzureStorageContainer + + + + Remove-AzureStorageContainer + + + + + + + + Set-AzureStorageContainerStoredAccessPolicy + + Set Stored Access Policy for azure storage container. + + + + + Set + AzureStorageContainerStoredAccessPolicy + + + + + Set Stored Access Policy for azure storage container. + + + + Set-AzureStorageContainerStoredAccessPolicy + + Container + + Azure storage container name. + + String + + + Policy + + Azure Stored Access Policy. + + String + + + Permission + + Permissions for a storage container. + + String + + + StartTime + + The time at which the stored access policy becomes valid. + + Nullable`1[DateTime] + + + ExpiryTime + + The time at which the stored access policy becomes invalid. + + Nullable`1[DateTime] + + + NoStartTime + + Set the StartTime to be Null. + + SwitchParameter + + + NoExpiryTime + + Set the ExpiryTime to be Null. + + SwitchParameter + + + Context + + Azure storage context + + AzureStorageContext + + + + + + Container + + Azure storage container name. + + String + + String + + + + + + Policy + + Azure Stored Access Policy. + + String + + String - - Context + + Permission - Azure Storage Context. You can create it by New-AzureStorageContext cmdlet. + Permissions for a storage container. - AzureStorageContext + String - AzureStorageContext + String - ServerTimeoutPerRequest + StartTime - Server side time out for each request. + The time at which the stored access policy becomes valid. - Nullable`1[Int32] + Nullable`1[DateTime] - Nullable`1[Int32] + Nullable`1[DateTime] - ClientTimeoutPerRequest + ExpiryTime - Client side time out for each request. + The time at which the stored access policy becomes invalid. - Nullable`1[Int32] + Nullable`1[DateTime] - Nullable`1[Int32] + Nullable`1[DateTime] - - ConcurrentTaskCount + + NoStartTime + + Set the StartTime to be Null. + + SwitchParameter + + SwitchParameter + + + + + + NoExpiryTime + + Set the ExpiryTime to be Null. + + SwitchParameter + + SwitchParameter + + + + + + Context - + Azure storage context - Nullable`1[Int32] + AzureStorageContext - Nullable`1[Int32] + AzureStorageContext @@ -10454,26 +12761,11 @@ Set-AzureStorageBlobContent -File filename -Container containername -Metadata $m - -------------------------- Set azure storage container acl by name. -------------------------- - - - - PS C:\> Set-AzureStorageContainerAcl -Container container1 -Permission off -PassThru - - - - - - - - - - - -------------------------- Set azure storage container acl using pipeline by GetAzureStorageContainer -------------------------- + -------------------------- Set a stored access policy in container with full permission -------------------------- - PS C:\> Get-AzureStorageContainer container* | Set-AzureStorageContainerAcl -Permission blob -PassThru + PS C:\> Set-AzureStorageContainerStoredAccessPolicy -Container test -Policy testPolicy -Permission audq @@ -10486,19 +12778,7 @@ Set-AzureStorageBlobContent -File filename -Container containername -Metadata $m - Get-AzureStorageContainerAcl - - - - Get-AzureStorageContainer - - - - New-AzureStorageContainer - - - - Remove-AzureStorageContainer + http://msdn.microsoft.com/en-us/library/azure/dn140257.aspx @@ -11625,6 +13905,251 @@ Set-AzureStorageBlobContent -File filename -Container containername -Metadata $m + + + Set-AzureStorageTableStoredAccessPolicy + + Set Stored Access Policy for azure storage table. + + + + + Set + AzureStorageTableStoredAccessPolicy + + + + + Set Stored Access Policy for azure storage table. + + + + Set-AzureStorageTableStoredAccessPolicy + + Table + + Azure storage table name. + + String + + + Policy + + Azure Stored Access Policy. + + String + + + Permission + + Permissions for a storage table. + + String + + + StartTime + + The time at which the stored access policy becomes valid. + + Nullable`1[DateTime] + + + ExpiryTime + + The time at which the stored access policy becomes invalid. + + Nullable`1[DateTime] + + + NoStartTime + + Set the StartTime to be Null. + + SwitchParameter + + + NoExpiryTime + + Set the ExpiryTime to be Null. + + SwitchParameter + + + Context + + Azure storage context + + AzureStorageContext + + + + + + Table + + Azure storage table name. + + String + + String + + + + + + Policy + + Azure Stored Access Policy. + + String + + String + + + + + + Permission + + Permissions for a storage table. + + String + + String + + + + + + StartTime + + The time at which the stored access policy becomes valid. + + Nullable`1[DateTime] + + Nullable`1[DateTime] + + + + + + ExpiryTime + + The time at which the stored access policy becomes invalid. + + Nullable`1[DateTime] + + Nullable`1[DateTime] + + + + + + NoStartTime + + Set the StartTime to be Null. + + SwitchParameter + + SwitchParameter + + + + + + NoExpiryTime + + Set the ExpiryTime to be Null. + + SwitchParameter + + SwitchParameter + + + + + + Context + + Azure storage context + + AzureStorageContext + + AzureStorageContext + + + + + + PipelineVariable + + + + string + + string + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -------------------------- Set a stored access policy in table with full permission -------------------------- + + + + PS C:\> Set-AzureStorageTableStoredAccessPolicy -Table test -Policy testPolicy -Permission raud + + + + + + + + + + + + + http://msdn.microsoft.com/en-us/library/azure/dn140257.aspx + + + + + Start-AzureStorageBlobCopy diff --git a/src/ServiceManagement/Storage/Commands.Storage/Model/Contract/IStorageBlobManagement.cs b/src/ServiceManagement/Storage/Commands.Storage/Model/Contract/IStorageBlobManagement.cs index 8ff148bd51e9..fc6faea183a9 100644 --- a/src/ServiceManagement/Storage/Commands.Storage/Model/Contract/IStorageBlobManagement.cs +++ b/src/ServiceManagement/Storage/Commands.Storage/Model/Contract/IStorageBlobManagement.cs @@ -56,7 +56,7 @@ public interface IStorageBlobManagement : IStorageManagement /// Blob request option /// Operation context /// The container's permission - BlobContainerPermissions GetContainerPermissions(CloudBlobContainer container, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext); + BlobContainerPermissions GetContainerPermissions(CloudBlobContainer container, AccessCondition accessCondition = null, BlobRequestOptions options = null, OperationContext operationContext = null); /// /// Set container permissions @@ -66,7 +66,7 @@ public interface IStorageBlobManagement : IStorageManagement /// Access condition /// Blob request option /// Operation context - void SetContainerPermissions(CloudBlobContainer container, BlobContainerPermissions permissions, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext); + void SetContainerPermissions(CloudBlobContainer container, BlobContainerPermissions permissions, AccessCondition accessCondition = null, BlobRequestOptions options = null, OperationContext operationContext = null); /// /// Get an CloudBlobContainer instance in local diff --git a/src/ServiceManagement/Storage/Commands.Storage/Model/Contract/IStorageQueueManagement.cs b/src/ServiceManagement/Storage/Commands.Storage/Model/Contract/IStorageQueueManagement.cs index 09360d382725..230edc52520b 100644 --- a/src/ServiceManagement/Storage/Commands.Storage/Model/Contract/IStorageQueueManagement.cs +++ b/src/ServiceManagement/Storage/Commands.Storage/Model/Contract/IStorageQueueManagement.cs @@ -14,6 +14,7 @@ using System; using System.Collections.Generic; +using System.Threading.Tasks; using Microsoft.WindowsAzure.Storage; using Microsoft.WindowsAzure.Storage.Queue; using Microsoft.WindowsAzure.Storage.Queue.Protocol; @@ -83,6 +84,25 @@ IEnumerable ListQueues(string prefix, QueueListingDetails queueList /// Queue request options /// Operation context /// QueuePermissions object - QueuePermissions GetPermissions(CloudQueue queue, QueueRequestOptions options, OperationContext operationContext); + QueuePermissions GetPermissions(CloudQueue queue, QueueRequestOptions options = null, OperationContext operationContext = null); + + + /// + /// Get queue permission async + /// + /// + /// + /// + /// + Task GetPermissionsAsync(CloudQueue queue, QueueRequestOptions requestOptions = null, OperationContext operationContext = null); + + /// + /// set queue permission + /// + /// + /// + /// + /// + void SetPermissions(CloudQueue queue, QueuePermissions queuePermissions, QueueRequestOptions requestOptions = null, OperationContext operationContext = null); } } diff --git a/src/ServiceManagement/Storage/Commands.Storage/Model/Contract/IStorageTableManagement.cs b/src/ServiceManagement/Storage/Commands.Storage/Model/Contract/IStorageTableManagement.cs index d440c53efe7e..03b1a2592fe7 100644 --- a/src/ServiceManagement/Storage/Commands.Storage/Model/Contract/IStorageTableManagement.cs +++ b/src/ServiceManagement/Storage/Commands.Storage/Model/Contract/IStorageTableManagement.cs @@ -13,6 +13,7 @@ // --------------------------------------------------------------------------------- using System.Collections.Generic; +using System.Threading.Tasks; using Microsoft.WindowsAzure.Storage; using Microsoft.WindowsAzure.Storage.Table; @@ -30,7 +31,7 @@ public interface IStorageTableManagement : IStorageManagement /// Table request options /// Operation context /// An enumerable collection of tables that begin with the specified prefix - IEnumerable ListTables(string prefix, TableRequestOptions requestOptions, OperationContext operationContext); + IEnumerable ListTables(string prefix, TableRequestOptions requestOptions = null, OperationContext operationContext = null); /// /// Get a table reference @@ -46,7 +47,7 @@ public interface IStorageTableManagement : IStorageManagement /// Table request options /// Operation context /// True if table exists; otherwise, false. - bool DoesTableExist(CloudTable table, TableRequestOptions requestOptions, OperationContext operationContext); + bool DoesTableExist(CloudTable table, TableRequestOptions requestOptions = null, OperationContext operationContext = null); /// /// Cloud a azure storage table if not exists. @@ -55,7 +56,7 @@ public interface IStorageTableManagement : IStorageManagement /// Table request options /// Operation context /// True if table was created; otherwise, false. - bool CreateTableIfNotExists(CloudTable table, TableRequestOptions requestOptions, OperationContext operationContext); + bool CreateTableIfNotExists(CloudTable table, TableRequestOptions requestOptions = null, OperationContext operationContext = null); /// /// Delete the specified azure storage table @@ -63,7 +64,7 @@ public interface IStorageTableManagement : IStorageManagement /// Cloud table object /// Table request options /// Operation context - void Delete(CloudTable table, TableRequestOptions requestOptions, OperationContext operationContext); + void Delete(CloudTable table, TableRequestOptions requestOptions = null, OperationContext operationContext = null); /// /// Get table permission @@ -71,6 +72,35 @@ public interface IStorageTableManagement : IStorageManagement /// Cloud table object /// Table request options /// Operation context - TablePermissions GetTablePermissions(CloudTable table, TableRequestOptions requestOptions, OperationContext operationContext); + TablePermissions GetTablePermissions(CloudTable table, TableRequestOptions requestOptions = null, OperationContext operationContext = null); + + /// + /// Return a task that asynchronously fetch table permissions + /// + /// target table + /// request options + /// context + /// + Task GetTablePermissionsAsync(CloudTable table, TableRequestOptions requestOptions = null, OperationContext operationContext = null); + + /// + /// Set table permission + /// + /// Cloud table object + /// table permissions + /// Table request options + /// Operation context + /// + void SetTablePermissions(CloudTable table, TablePermissions tablePermissions, TableRequestOptions requestOptions = null, OperationContext operationContext = null); + + /// + /// Return a task that asynchronously set table permissions + /// + /// target table + /// permissions to set + /// request options + /// context + /// + Task SetTablePermissionsAsync(CloudTable table, TablePermissions tablePermissions, TableRequestOptions requestOptions = null, OperationContext operationContext = null); } } \ No newline at end of file diff --git a/src/ServiceManagement/Storage/Commands.Storage/Model/Contract/StorageQueueManagement.cs b/src/ServiceManagement/Storage/Commands.Storage/Model/Contract/StorageQueueManagement.cs index 4aa018ac5c5c..9b5e0e1a03f0 100644 --- a/src/ServiceManagement/Storage/Commands.Storage/Model/Contract/StorageQueueManagement.cs +++ b/src/ServiceManagement/Storage/Commands.Storage/Model/Contract/StorageQueueManagement.cs @@ -13,6 +13,7 @@ // --------------------------------------------------------------------------------- using System.Collections.Generic; +using System.Threading.Tasks; using Microsoft.WindowsAzure.Commands.Common.Storage; using Microsoft.WindowsAzure.Storage; using Microsoft.WindowsAzure.Storage.Queue; @@ -156,5 +157,29 @@ public QueuePermissions GetPermissions(CloudQueue queue, QueueRequestOptions opt { return queue.GetPermissions(options, operationContext); } + + /// + /// Get queue permission async + /// + /// + /// + /// + /// + public Task GetPermissionsAsync(CloudQueue queue, QueueRequestOptions requestOptions, OperationContext operationContext) + { + return queue.GetPermissionsAsync(requestOptions, operationContext); + } + + /// + /// set queue permission + /// + /// + /// + /// + /// + public void SetPermissions(CloudQueue queue, QueuePermissions queuePermissions, QueueRequestOptions requestOptions, OperationContext operationContext) + { + queue.SetPermissions(queuePermissions, requestOptions, operationContext); + } } } diff --git a/src/ServiceManagement/Storage/Commands.Storage/Model/Contract/StorageTableManagement.cs b/src/ServiceManagement/Storage/Commands.Storage/Model/Contract/StorageTableManagement.cs index 3098e7ff1dac..c9acc63662fc 100644 --- a/src/ServiceManagement/Storage/Commands.Storage/Model/Contract/StorageTableManagement.cs +++ b/src/ServiceManagement/Storage/Commands.Storage/Model/Contract/StorageTableManagement.cs @@ -13,6 +13,7 @@ // --------------------------------------------------------------------------------- using System.Collections.Generic; +using System.Threading.Tasks; using Microsoft.WindowsAzure.Commands.Common.Storage; using Microsoft.WindowsAzure.Storage; using Microsoft.WindowsAzure.Storage.Table; @@ -122,5 +123,44 @@ public TablePermissions GetTablePermissions(CloudTable table, TableRequestOption { return table.GetPermissions(requestOptions, operationContext); } + + /// + /// Return a task that asynchronously fetch table permissions + /// + /// target table + /// request options + /// context + /// + public Task GetTablePermissionsAsync(CloudTable table, TableRequestOptions requestOptions, OperationContext operationContext) + { + return table.GetPermissionsAsync(requestOptions, operationContext); + } + + /// + /// Set table permission + /// + /// Cloud table object + /// table permissions + /// Table request options + /// Operation context + /// + public void SetTablePermissions(CloudTable table, TablePermissions tablePermissions, TableRequestOptions requestOptions, OperationContext operationContext) + { + table.SetPermissions(tablePermissions, requestOptions, operationContext); + } + + + /// + /// Return a task that asynchronously set table permissions + /// + /// target table + /// permissions to set + /// request options + /// context + /// + public Task SetTablePermissionsAsync(CloudTable table, TablePermissions tablePermissions, TableRequestOptions requestOptions, OperationContext operationContext) + { + return table.SetPermissionsAsync(tablePermissions, requestOptions, operationContext); + } } } \ No newline at end of file diff --git a/src/ServiceManagement/Storage/Commands.Storage/Queue/Cmdlet/GetAzureStorageQueueStoredAccessPolicy.cs b/src/ServiceManagement/Storage/Commands.Storage/Queue/Cmdlet/GetAzureStorageQueueStoredAccessPolicy.cs new file mode 100644 index 000000000000..0b0fa07defc1 --- /dev/null +++ b/src/ServiceManagement/Storage/Commands.Storage/Queue/Cmdlet/GetAzureStorageQueueStoredAccessPolicy.cs @@ -0,0 +1,104 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +namespace Microsoft.WindowsAzure.Commands.Storage.Queue.Cmdlet +{ + using System; + using System.Globalization; + using System.Management.Automation; + using System.Security.Permissions; + using System.Threading.Tasks; + using Microsoft.WindowsAzure.Commands.Storage.Common; + using Microsoft.WindowsAzure.Commands.Storage.Model.Contract; + using Microsoft.WindowsAzure.Storage.Queue; + using Microsoft.WindowsAzure.Storage.Queue.Protocol; + + [Cmdlet(VerbsCommon.Get, StorageNouns.QueueStoredAccessPolicy), OutputType(typeof(SharedAccessQueuePolicy))] + public class GetAzureStorageQueueStoredAccessPolicyCommand : StorageQueueBaseCmdlet + { + [Alias("N", "Name")] + [Parameter(Position = 0, Mandatory = true, + HelpMessage = "Queue Name", + ValueFromPipeline = true, + ValueFromPipelineByPropertyName = true)] + [ValidateNotNullOrEmpty] + public string Queue { get; set; } + + [Parameter(Position = 1, + HelpMessage = "Policy Identifier", + ValueFromPipelineByPropertyName = true)] + public string Policy { get; set; } + + /// + /// Initializes a new instance of the GetAzureStorageQueueStoredAccessPolicyCommand class. + /// + public GetAzureStorageQueueStoredAccessPolicyCommand() + : this(null) + { + } + + /// + /// Initializes a new instance of the GetAzureStorageQueueStoredAccessPolicyCommand class. + /// + /// IStorageBlobManagement channel + public GetAzureStorageQueueStoredAccessPolicyCommand(IStorageQueueManagement channel) + { + Channel = channel; + } + + internal async Task GetAzureQueueStoredAccessPolicyAsync(long taskId, IStorageQueueManagement localChannel, string queueName, string policyName) + { + SharedAccessQueuePolicies shareAccessPolicies = await GetPoliciesAsync(localChannel, queueName, policyName); + + if (!String.IsNullOrEmpty(policyName)) + { + if (shareAccessPolicies.Keys.Contains(policyName)) + { + OutputStream.WriteObject(taskId, AccessPolicyHelper.ConstructPolicyOutputPSObject(shareAccessPolicies, policyName)); + } + else + { + throw new ResourceNotFoundException(String.Format(CultureInfo.CurrentCulture, Resources.PolicyNotFound, policyName)); + } + } + else + { + foreach (string key in shareAccessPolicies.Keys) + { + OutputStream.WriteObject(taskId, AccessPolicyHelper.ConstructPolicyOutputPSObject(shareAccessPolicies, key)); + } + } + } + + internal async Task GetPoliciesAsync(IStorageQueueManagement localChannel, string queueName, string policyName) + { + CloudQueue queue = localChannel.GetQueueReference(queueName); + QueuePermissions queuePermissions = await localChannel.GetPermissionsAsync(queue); + return queuePermissions.SharedAccessPolicies; + } + + /// + /// Execute command + /// + [PermissionSet(SecurityAction.Demand, Name = "FullTrust")] + public override void ExecuteCmdlet() + { + if (String.IsNullOrEmpty(Queue)) return; + Func taskGenerator = (taskId) => GetAzureQueueStoredAccessPolicyAsync(taskId, Channel, Queue, Policy); + RunTask(taskGenerator); + } + + + } +} diff --git a/src/ServiceManagement/Storage/Commands.Storage/Queue/Cmdlet/NewAzureStorageQueueStoredAccessPolicy.cs b/src/ServiceManagement/Storage/Commands.Storage/Queue/Cmdlet/NewAzureStorageQueueStoredAccessPolicy.cs new file mode 100644 index 000000000000..6a22dd1fb16e --- /dev/null +++ b/src/ServiceManagement/Storage/Commands.Storage/Queue/Cmdlet/NewAzureStorageQueueStoredAccessPolicy.cs @@ -0,0 +1,109 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +namespace Microsoft.WindowsAzure.Commands.Storage.Queue.Cmdlet +{ + using System; + using System.Globalization; + using System.Management.Automation; + using System.Security.Permissions; + using Microsoft.WindowsAzure.Commands.Storage.Common; + using Microsoft.WindowsAzure.Commands.Storage.Model.Contract; + using Microsoft.WindowsAzure.Storage.Queue; + using Microsoft.WindowsAzure.Storage.Queue.Protocol; + + [Cmdlet(VerbsCommon.New, StorageNouns.QueueStoredAccessPolicy), OutputType(typeof(String))] + public class NewAzureStorageQueueStoredAccessPolicyCommand : StorageQueueBaseCmdlet + { + [Alias("N", "Name")] + [Parameter(Position = 0, Mandatory = true, + HelpMessage = "Queue Name", + ValueFromPipeline = true, + ValueFromPipelineByPropertyName = true)] + [ValidateNotNullOrEmpty] + public string Queue { get; set; } + + [Parameter(Position = 1, Mandatory = true, + HelpMessage = "Policy Identifier. Need to be unique in the Queue")] + [ValidateNotNullOrEmpty] + public string Policy {get; set; } + + [Parameter(HelpMessage = "Permissions for a queue. Permissions can be any not-empty subset of \"arup\".")] + public string Permission { get; set; } + + [Parameter(HelpMessage = "Start Time")] + public DateTime? StartTime { get; set; } + + [Parameter(HelpMessage = "Expiry Time")] + public DateTime? ExpiryTime { get; set; } + + /// + /// Initializes a new instance of the NewAzureStorageQueueStoredAccessPolicyCommand class. + /// + public NewAzureStorageQueueStoredAccessPolicyCommand() + : this(null) + { + } + + /// + /// Initializes a new instance of the NewAzureStorageQueueStoredAccessPolicyCommand class. + /// + /// IStorageBlobManagement channel + public NewAzureStorageQueueStoredAccessPolicyCommand(IStorageQueueManagement channel) + { + Channel = channel; + EnableMultiThread = false; + } + + internal string CreateAzureQueueStoredAccessPolicy(IStorageQueueManagement localChannel, string queueName, string policyName, DateTime? startTime, DateTime? expiryTime, string permission) + { + + if (!NameUtil.IsValidStoredAccessPolicyName(policyName)) + { + throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, Resources.InvalidAccessPolicyName, policyName)); + } + + //Get existing permissions + CloudQueue queue = Channel.GetQueueReference(queueName); + QueuePermissions queuePermissions = localChannel.GetPermissions(queue); + + //Add new policy + if (queuePermissions.SharedAccessPolicies.Keys.Contains(policyName)) + { + throw new ResourceAlreadyExistException(String.Format(CultureInfo.CurrentCulture, Resources.PolicyAlreadyExists, policyName)); + } + + SharedAccessQueuePolicy policy = new SharedAccessQueuePolicy(); + AccessPolicyHelper.SetupAccessPolicy(policy, startTime, expiryTime, permission); + queuePermissions.SharedAccessPolicies.Add(policyName, policy); + + //Set permissions back to queue + localChannel.SetPermissions(queue, queuePermissions); + return policyName; + } + + /// + /// Execute command + /// + [PermissionSet(SecurityAction.Demand, Name = "FullTrust")] + public override void ExecuteCmdlet() + { + if (String.IsNullOrEmpty(Queue) || String.IsNullOrEmpty(Policy)) return; + string resultPolicy = CreateAzureQueueStoredAccessPolicy(Channel, Queue, Policy, StartTime, ExpiryTime, Permission); + WriteObject(resultPolicy); + } + + + } +} diff --git a/src/ServiceManagement/Storage/Commands.Storage/Queue/Cmdlet/RemoveAzureStorageQueueStoredAccessPolicy.cs b/src/ServiceManagement/Storage/Commands.Storage/Queue/Cmdlet/RemoveAzureStorageQueueStoredAccessPolicy.cs new file mode 100644 index 000000000000..03d4d5a8f317 --- /dev/null +++ b/src/ServiceManagement/Storage/Commands.Storage/Queue/Cmdlet/RemoveAzureStorageQueueStoredAccessPolicy.cs @@ -0,0 +1,125 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +namespace Microsoft.WindowsAzure.Commands.Storage.Queue.Cmdlet +{ + using System; + using System.Globalization; + using System.Management.Automation; + using System.Security.Permissions; + using Microsoft.WindowsAzure.Commands.Storage.Common; + using Microsoft.WindowsAzure.Commands.Storage.Model.Contract; + using Microsoft.WindowsAzure.Storage.Queue; + using Microsoft.WindowsAzure.Storage.Queue.Protocol; + + [Cmdlet(VerbsCommon.Remove, StorageNouns.QueueStoredAccessPolicy, SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.High), OutputType(typeof(Boolean))] + public class RemoveAzureStorageQueueStoredAccessPolicyCommand : StorageQueueBaseCmdlet + { + [Alias("N", "Name")] + [Parameter(Position = 0, Mandatory = true, + HelpMessage = "Queue Name", + ValueFromPipelineByPropertyName = true)] + [ValidateNotNullOrEmpty] + public string Queue { get; set; } + + [Parameter(Position = 1, Mandatory = true, + HelpMessage = "Policy Identifier", + ValueFromPipelineByPropertyName = true)] + [ValidateNotNullOrEmpty] + public string Policy { get; set; } + + [Parameter(HelpMessage = "Force to remove the policy without confirm")] + public SwitchParameter Force { get; set;} + + [Parameter(Mandatory = false, HelpMessage = "Return whether the specified policy is successfully removed")] + public SwitchParameter PassThru { get; set; } + + /// + /// Initializes a new instance of the RemoveAzureStorageQueueStoredAccessPolicyCommand class. + /// + public RemoveAzureStorageQueueStoredAccessPolicyCommand() + : this(null) + { + } + + /// + /// Initializes a new instance of the RemoveAzureStorageQueueStoredAccessPolicyCommand class. + /// + /// IStorageBlobManagement channel + public RemoveAzureStorageQueueStoredAccessPolicyCommand(IStorageQueueManagement channel) + { + Channel = channel; + EnableMultiThread = false; + } + + internal bool RemoveAzureQueueStoredAccessPolicy(IStorageQueueManagement localChannel, string queueName, string policyName) + { + bool success = false; + string result = string.Empty; + + //Get existing permissions + CloudQueue queue = Channel.GetQueueReference(queueName); + QueuePermissions queuePermissions = localChannel.GetPermissions(queue); + + //remove the specified policy + if (!queuePermissions.SharedAccessPolicies.Keys.Contains(policyName)) + { + throw new ResourceNotFoundException(String.Format(CultureInfo.CurrentCulture, Resources.PolicyNotFound, policyName)); + } + + if (this.Force || ConfirmRemove(policyName)) + { + queuePermissions.SharedAccessPolicies.Remove(policyName); + localChannel.SetPermissions(queue, queuePermissions); + success = true; + } + + return success; + } + internal virtual bool ConfirmRemove(string message) + { + return ShouldProcess(message); + } + + /// + /// Execute command + /// + [PermissionSet(SecurityAction.Demand, Name = "FullTrust")] + public override void ExecuteCmdlet() + { + if (String.IsNullOrEmpty(Queue) || String.IsNullOrEmpty(Policy)) return; + bool success = RemoveAzureQueueStoredAccessPolicy(Channel, Queue, Policy); + string result = string.Empty; + + if (success) + { + result = String.Format(CultureInfo.CurrentCulture, Resources.RemovePolicySuccessfully, Policy); + } + else + { + result = String.Format(CultureInfo.CurrentCulture, Resources.RemovePolicyCancelled, Policy); + } + + WriteVerbose(result); + + if (PassThru) + { + WriteObject(success); + } + } + + + } +} + diff --git a/src/ServiceManagement/Storage/Commands.Storage/Queue/Cmdlet/SetAzureStorageQueueStoredAccessPolicy.cs b/src/ServiceManagement/Storage/Commands.Storage/Queue/Cmdlet/SetAzureStorageQueueStoredAccessPolicy.cs new file mode 100644 index 000000000000..f58af93f227f --- /dev/null +++ b/src/ServiceManagement/Storage/Commands.Storage/Queue/Cmdlet/SetAzureStorageQueueStoredAccessPolicy.cs @@ -0,0 +1,117 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +namespace Microsoft.WindowsAzure.Commands.Storage.Queue.Cmdlet +{ + using System; + using System.Globalization; + using System.Management.Automation; + using System.Security.Permissions; + using Microsoft.WindowsAzure.Commands.Storage.Common; + using Microsoft.WindowsAzure.Commands.Storage.Model.Contract; + using Microsoft.WindowsAzure.Storage.Queue; + using Microsoft.WindowsAzure.Storage.Queue.Protocol; + + [Cmdlet(VerbsCommon.Set, StorageNouns.QueueStoredAccessPolicy), OutputType(typeof(String))] + public class SetAzureStorageQueueStoredAccessPolicyCommand : StorageQueueBaseCmdlet + { + [Alias("N", "Name")] + [Parameter(Position = 0, Mandatory = true, + HelpMessage = "Queue Name", + ValueFromPipeline = true, + ValueFromPipelineByPropertyName = true)] + [ValidateNotNullOrEmpty] + public string Queue { get; set; } + + [Parameter(Position = 1, Mandatory = true, + HelpMessage = "Policy Identifier")] + [ValidateNotNullOrEmpty] + public string Policy {get; set; } + + [Parameter(HelpMessage = "Permissions for a queue. Permissions can be any not-empty subset of \"arup\".")] + public string Permission { get; set; } + + [Parameter(HelpMessage = "Start Time")] + public DateTime? StartTime { get; set; } + + [Parameter(HelpMessage = "Expiry Time")] + public DateTime? ExpiryTime { get; set; } + + [Parameter(HelpMessage = "Set StartTime as null for the policy")] + public SwitchParameter NoStartTime { get; set; } + + [Parameter(HelpMessage = "Set ExpiryTime as null for the policy")] + public SwitchParameter NoExpiryTime { get; set; } + + /// + /// Initializes a new instance of the SetAzureStorageQueueStoredAccessPolicyCommand class. + /// + public SetAzureStorageQueueStoredAccessPolicyCommand() + : this(null) + { + } + + /// + /// Initializes a new instance of the SetAzureStorageQueueStoredAccessPolicyCommand class. + /// + /// IStorageBlobManagement channel + public SetAzureStorageQueueStoredAccessPolicyCommand(IStorageQueueManagement channel) + { + Channel = channel; + EnableMultiThread = false; + } + + internal string SetAzureQueueStoredAccessPolicy(IStorageQueueManagement localChannel, string queueName, string policyName, DateTime? startTime, DateTime? expiryTime, string permission, bool noStartTime, bool noExpiryTime) + { + //Get existing permissions + CloudQueue queue = Channel.GetQueueReference(queueName); + QueuePermissions queuePermissions = localChannel.GetPermissions(queue); + + //Set the policy with new value + if (!queuePermissions.SharedAccessPolicies.Keys.Contains(policyName)) + { + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resources.PolicyNotFound, policyName)); + } + + SharedAccessQueuePolicy policy = queuePermissions.SharedAccessPolicies[policyName]; + AccessPolicyHelper.SetupAccessPolicy(policy, startTime, expiryTime, permission, noStartTime, noExpiryTime); + queuePermissions.SharedAccessPolicies[policyName] = policy; + + //Set permission back to queue + WriteObject(AccessPolicyHelper.ConstructPolicyOutputPSObject(queuePermissions.SharedAccessPolicies, policyName)); + localChannel.SetPermissions(queue, queuePermissions); + return policyName; + } + + /// + /// Execute command + /// + [PermissionSet(SecurityAction.Demand, Name = "FullTrust")] + public override void ExecuteCmdlet() + { + if (String.IsNullOrEmpty(Queue) || String.IsNullOrEmpty(Policy)) return; + if (NoStartTime && StartTime != null) + { + throw new ArgumentException(Resources.StartTimeParameterConflict); + } + + if (NoExpiryTime && ExpiryTime != null) + { + throw new ArgumentException(Resources.ExpiryTimeParameterConflict); + } + + SetAzureQueueStoredAccessPolicy(Channel, Queue, Policy, StartTime, ExpiryTime, Permission, NoStartTime, NoExpiryTime); + } + } +} diff --git a/src/ServiceManagement/Storage/Commands.Storage/Resources.Designer.cs b/src/ServiceManagement/Storage/Commands.Storage/Resources.Designer.cs index 54664d9182dc..a25b40dc3033 100644 --- a/src/ServiceManagement/Storage/Commands.Storage/Resources.Designer.cs +++ b/src/ServiceManagement/Storage/Commands.Storage/Resources.Designer.cs @@ -492,6 +492,15 @@ internal static string ExpiryTimeGreatThanStartTime { } } + /// + /// Looks up a localized string similar to Parameter -ExpiryTime and -NoExpiryTime are mutually exclusive. + /// + internal static string ExpiryTimeParameterConflict { + get { + return ResourceManager.GetString("ExpiryTimeParameterConflict", resourceCulture); + } + } + /// /// Looks up a localized string similar to File '{0}' already exists.. /// @@ -780,6 +789,24 @@ internal static string InvalidAccessPolicy { } } + /// + /// Looks up a localized string similar to Access policy name '{0}' is invalid. Valid names should be 1 through 64 characters long.. + /// + internal static string InvalidAccessPolicyName { + get { + return ResourceManager.GetString("InvalidAccessPolicyName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Access policy type is invalid, only SharedAccessBlobPolicy, SharedAccessQueuePolicy, and SharedAccessTablePolicy are supported. + /// + internal static string InvalidAccessPolicyType { + get { + return ResourceManager.GetString("InvalidAccessPolicyType", resourceCulture); + } + } + /// /// Looks up a localized string similar to invalid parameter combination, please see the command help.. /// @@ -1023,6 +1050,24 @@ internal static string PathTooLong { } } + /// + /// Looks up a localized string similar to Policy '{0}' already exists.. + /// + internal static string PolicyAlreadyExists { + get { + return ResourceManager.GetString("PolicyAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Can not find policy '{0}'.. + /// + internal static string PolicyNotFound { + get { + return ResourceManager.GetString("PolicyNotFound", resourceCulture); + } + } + /// /// Looks up a localized string similar to Prepare to download blob.. /// @@ -1131,6 +1176,24 @@ internal static string RemoveContainerSuccessfully { } } + /// + /// Looks up a localized string similar to The remove operation of policy '{0}' has been cancelled.. + /// + internal static string RemovePolicyCancelled { + get { + return ResourceManager.GetString("RemovePolicyCancelled", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removed policy '{0}' successfully.. + /// + internal static string RemovePolicySuccessfully { + get { + return ResourceManager.GetString("RemovePolicySuccessfully", resourceCulture); + } + } + /// /// Looks up a localized string similar to The remove operation of queue '{0}' has been cancelled.. /// @@ -1284,6 +1347,15 @@ internal static string StartRemoteCall { } } + /// + /// Looks up a localized string similar to Parameter -StartTime and -NoStartTime are mutually exclusive. + /// + internal static string StartTimeParameterConflict { + get { + return ResourceManager.GetString("StartTimeParameterConflict", resourceCulture); + } + } + /// /// Looks up a localized string similar to Start to upload '{0}' to blob '{1}'.. /// diff --git a/src/ServiceManagement/Storage/Commands.Storage/Resources.resx b/src/ServiceManagement/Storage/Commands.Storage/Resources.resx index d7e24e14b87b..7ad2600af092 100644 --- a/src/ServiceManagement/Storage/Commands.Storage/Resources.resx +++ b/src/ServiceManagement/Storage/Commands.Storage/Resources.resx @@ -665,4 +665,28 @@ Failed: {2}. Valid environment names are: '{0}' and '{1}' 0 and 1 are for the correct Environment names + + Policy '{0}' already exists. + + + Can not find policy '{0}'. + + + The remove operation of policy '{0}' has been cancelled. + + + Removed policy '{0}' successfully. + + + Access policy type is invalid, only SharedAccessBlobPolicy, SharedAccessQueuePolicy, and SharedAccessTablePolicy are supported + + + Access policy name '{0}' is invalid. Valid names should be 1 through 64 characters long. + + + Parameter -ExpiryTime and -NoExpiryTime are mutually exclusive + + + Parameter -StartTime and -NoStartTime are mutually exclusive + \ No newline at end of file diff --git a/src/ServiceManagement/Storage/Commands.Storage/Table/Cmdlet/GetAzureStorageTableStoredAccessPolicy.cs b/src/ServiceManagement/Storage/Commands.Storage/Table/Cmdlet/GetAzureStorageTableStoredAccessPolicy.cs new file mode 100644 index 000000000000..52daf2df4c6a --- /dev/null +++ b/src/ServiceManagement/Storage/Commands.Storage/Table/Cmdlet/GetAzureStorageTableStoredAccessPolicy.cs @@ -0,0 +1,104 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Management.Automation; +using System.Security.Permissions; +using System.Threading.Tasks; +using Microsoft.WindowsAzure.Commands.Storage.Common; +using Microsoft.WindowsAzure.Commands.Storage.Model.Contract; +using Microsoft.WindowsAzure.Commands.Storage.Table; +using Microsoft.WindowsAzure.Storage.Table; + +namespace Microsoft.WindowsAzure.Commands.Storage.Table.Cmdlet +{ + [Cmdlet(VerbsCommon.Get, StorageNouns.TableStoredAccessPolicy), OutputType(typeof(SharedAccessTablePolicy))] + public class GetAzureStorageTableStoredAccessPolicyCommand : StorageCloudTableCmdletBase + { + [Alias("N", "Name")] + [Parameter(Position = 0, Mandatory = true, + HelpMessage = "Table Name", + ValueFromPipeline = true, + ValueFromPipelineByPropertyName = true)] + [ValidateNotNullOrEmpty] + public string Table { get; set; } + + [Parameter(Position = 1, + HelpMessage = "Policy Identifier", + ValueFromPipelineByPropertyName = true)] + public string Policy {get; set; } + + /// + /// Initializes a new instance of the GetAzureStorageTableStoredAccessPolicyCommand class. + /// + public GetAzureStorageTableStoredAccessPolicyCommand() + : this(null) + { + } + + /// + /// Initializes a new instance of the GetAzureStorageTableStoredAccessPolicyCommand class. + /// + /// IStorageTableManagement channel + public GetAzureStorageTableStoredAccessPolicyCommand(IStorageTableManagement channel) + { + Channel = channel; + } + + internal async Task GetAzureTableStoredAccessPolicyAsync(long taskId, IStorageTableManagement localChannel, string tableName, string policyName) + { + SharedAccessTablePolicies shareAccessPolicies = await GetPoliciesAsync(localChannel, tableName, policyName); + + if (!String.IsNullOrEmpty(policyName)) + { + if (shareAccessPolicies.Keys.Contains(policyName)) + { + OutputStream.WriteObject(taskId, AccessPolicyHelper.ConstructPolicyOutputPSObject(shareAccessPolicies, policyName)); + } + else + { + throw new ResourceNotFoundException(String.Format(CultureInfo.CurrentCulture, Resources.PolicyNotFound, policyName)); + } + } + else + { + foreach (string key in shareAccessPolicies.Keys) + { + OutputStream.WriteObject(taskId, AccessPolicyHelper.ConstructPolicyOutputPSObject(shareAccessPolicies, key)); + } + } + } + + internal async Task GetPoliciesAsync(IStorageTableManagement localChannel, string tableName, string policyName) + { + CloudTable table = localChannel.GetTableReference(tableName); + TablePermissions tablePermissions = await localChannel.GetTablePermissionsAsync(table); + return tablePermissions.SharedAccessPolicies; + } + + /// + /// Execute command + /// + [PermissionSet(SecurityAction.Demand, Name = "FullTrust")] + public override void ExecuteCmdlet() + { + if (String.IsNullOrEmpty(Table)) return; + Func taskGenerator = (taskId) => GetAzureTableStoredAccessPolicyAsync(taskId, Channel, Table, Policy); + RunTask(taskGenerator); + } + } +} diff --git a/src/ServiceManagement/Storage/Commands.Storage/Table/Cmdlet/NewAzureStorageTableStoredAccessPolicy.cs b/src/ServiceManagement/Storage/Commands.Storage/Table/Cmdlet/NewAzureStorageTableStoredAccessPolicy.cs new file mode 100644 index 000000000000..aebd700fde01 --- /dev/null +++ b/src/ServiceManagement/Storage/Commands.Storage/Table/Cmdlet/NewAzureStorageTableStoredAccessPolicy.cs @@ -0,0 +1,109 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using System; +using System.Globalization; +using System.Management.Automation; +using System.Security.Permissions; +using System.Threading.Tasks; +using Microsoft.WindowsAzure.Commands.Storage.Common; +using Microsoft.WindowsAzure.Commands.Storage.Model.Contract; +using Microsoft.WindowsAzure.Commands.Storage.Table; +using Microsoft.WindowsAzure.Storage.Table; + +namespace Microsoft.WindowsAzure.Commands.Storage.Table.Cmdlet +{ + [Cmdlet(VerbsCommon.New, StorageNouns.TableStoredAccessPolicy), OutputType(typeof(String))] + public class NewAzureStorageTableStoredAccessPolicyCommand : StorageCloudTableCmdletBase + { + [Alias("N", "Name")] + [Parameter(Position = 0, Mandatory = true, + HelpMessage = "Table Name", + ValueFromPipeline = true, + ValueFromPipelineByPropertyName = true)] + [ValidateNotNullOrEmpty] + public string Table { get; set; } + + [Parameter(Position = 1, Mandatory = true, + HelpMessage = "Policy Identifier. Need to be unique in the Table")] + [ValidateNotNullOrEmpty] + public string Policy {get; set;} + + [Parameter(HelpMessage = "Permissions for a table. Permissions can be any not-empty subset of \"audqr\".")] + public string Permission { get; set; } + + [Parameter(HelpMessage = "Start Time")] + public DateTime? StartTime { get; set; } + + [Parameter(HelpMessage = "Expiry Time")] + public DateTime? ExpiryTime { get; set; } + + + /// + /// Initializes a new instance of the NewAzureStorageTableStoredAccessPolicyCommand class. + /// + public NewAzureStorageTableStoredAccessPolicyCommand() + : this(null) + { + } + + /// + /// Initializes a new instance of the NewAzureStorageTableStoredAccessPolicyCommand class. + /// + /// IStorageTableManagement channel + public NewAzureStorageTableStoredAccessPolicyCommand(IStorageTableManagement channel) + { + Channel = channel; + EnableMultiThread = false; + } + + internal string CreateAzureTableStoredAccessPolicy(IStorageTableManagement localChannel, string tableName, string policyName, DateTime? startTime, DateTime? expiryTime, string permission) + { + + if (!NameUtil.IsValidStoredAccessPolicyName(policyName)) + { + throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, Resources.InvalidAccessPolicyName, policyName)); + } + + //Get existing permissions + CloudTable table = localChannel.GetTableReference(tableName); + TablePermissions tablePermissions = localChannel.GetTablePermissions(table); + + //Add new policy + if (tablePermissions.SharedAccessPolicies.Keys.Contains(policyName)) + { + throw new ResourceAlreadyExistException(String.Format(CultureInfo.CurrentCulture, Resources.PolicyAlreadyExists, policyName)); + } + + SharedAccessTablePolicy policy = new SharedAccessTablePolicy(); + AccessPolicyHelper.SetupAccessPolicy(policy, startTime, expiryTime, permission); + tablePermissions.SharedAccessPolicies.Add(policyName, policy); + + //Set permissions back to table + localChannel.SetTablePermissions(table, tablePermissions); + return policyName; + } + + /// + /// Execute command + /// + [PermissionSet(SecurityAction.Demand, Name = "FullTrust")] + public override void ExecuteCmdlet() + { + if (String.IsNullOrEmpty(Table) || String.IsNullOrEmpty(Policy)) return; + string resultPolicy = CreateAzureTableStoredAccessPolicy(Channel, Table, Policy, StartTime, ExpiryTime, Permission); + WriteObject(resultPolicy); + } + } +} diff --git a/src/ServiceManagement/Storage/Commands.Storage/Table/Cmdlet/RemoveAzureStorageTableStoredAccessPolicy.cs b/src/ServiceManagement/Storage/Commands.Storage/Table/Cmdlet/RemoveAzureStorageTableStoredAccessPolicy.cs new file mode 100644 index 000000000000..28015a704842 --- /dev/null +++ b/src/ServiceManagement/Storage/Commands.Storage/Table/Cmdlet/RemoveAzureStorageTableStoredAccessPolicy.cs @@ -0,0 +1,125 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using System; +using System.Globalization; +using System.Management.Automation; +using System.Security.Permissions; +using System.Threading.Tasks; +using Microsoft.WindowsAzure.Commands.Storage.Common; +using Microsoft.WindowsAzure.Commands.Storage.Model.Contract; +using Microsoft.WindowsAzure.Commands.Storage.Table; +using Microsoft.WindowsAzure.Storage.Table; + +namespace Microsoft.WindowsAzure.Commands.Storage.Table.Cmdlet +{ + [Cmdlet(VerbsCommon.Remove, StorageNouns.TableStoredAccessPolicy, SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.High), OutputType(typeof(Boolean))] + public class RemoveAzureStorageTableStoredAccessPolicyCommand : StorageCloudTableCmdletBase + { + [Alias("N", "Name")] + [Parameter(Position = 0, Mandatory = true, + HelpMessage = "Table Name", + ValueFromPipelineByPropertyName = true)] + [ValidateNotNullOrEmpty] + public string Table { get; set; } + + [Parameter(Position = 1, Mandatory = true, + HelpMessage = "Policy Identifier", + ValueFromPipelineByPropertyName = true)] + [ValidateNotNullOrEmpty] + public string Policy {get; set; } + + [Parameter(HelpMessage = "Force to remove the policy without confirm")] + public SwitchParameter Force { get; set; } + + [Parameter(Mandatory = false, HelpMessage = "Return whether the specified policy is successfully removed")] + public SwitchParameter PassThru { get; set; } + + /// + /// Initializes a new instance of the RemoveAzureStorageTableStoredAccessPolicyCommand class. + /// + public RemoveAzureStorageTableStoredAccessPolicyCommand() + : this(null) + { + } + + /// + /// Initializes a new instance of the RemoveAzureStorageTableStoredAccessPolicyCommand class. + /// + /// IStorageTableManagement channel + public RemoveAzureStorageTableStoredAccessPolicyCommand(IStorageTableManagement channel) + { + Channel = channel; + EnableMultiThread = false; + } + + internal virtual bool ConfirmRemove(string message) + { + return ShouldProcess(message); + } + + internal bool RemoveAzureTableStoredAccessPolicy(IStorageTableManagement localChannel, string tableName, string policyName) + { + bool success = false; + string result = string.Empty; + + //Get existing permissions + CloudTable table = localChannel.GetTableReference(tableName); + TablePermissions tablePermissions = localChannel.GetTablePermissions(table); + + //remove the specified policy + if (!tablePermissions.SharedAccessPolicies.Keys.Contains(policyName)) + { + throw new ResourceNotFoundException(String.Format(CultureInfo.CurrentCulture, Resources.PolicyNotFound, policyName)); + } + + if (this.Force || ConfirmRemove(policyName)) + { + tablePermissions.SharedAccessPolicies.Remove(policyName); + localChannel.SetTablePermissions(table, tablePermissions); + success = true; + } + + return success; + } + + /// + /// Execute command + /// + [PermissionSet(SecurityAction.Demand, Name = "FullTrust")] + public override void ExecuteCmdlet() + { + if (String.IsNullOrEmpty(Table) || String.IsNullOrEmpty(Policy)) return; + bool success = RemoveAzureTableStoredAccessPolicy(Channel, Table, Policy); + string result = string.Empty; + + if (success) + { + result = String.Format(CultureInfo.CurrentCulture, Resources.RemovePolicySuccessfully, Policy); + } + else + { + result = String.Format(CultureInfo.CurrentCulture, Resources.RemovePolicyCancelled, Policy); + } + + WriteVerbose(result); + + if (PassThru) + { + WriteObject(success); + } + } + } +} + diff --git a/src/ServiceManagement/Storage/Commands.Storage/Table/Cmdlet/SetAzureStorageTableStoredAccessPolicy.cs b/src/ServiceManagement/Storage/Commands.Storage/Table/Cmdlet/SetAzureStorageTableStoredAccessPolicy.cs new file mode 100644 index 000000000000..20b27db7efdd --- /dev/null +++ b/src/ServiceManagement/Storage/Commands.Storage/Table/Cmdlet/SetAzureStorageTableStoredAccessPolicy.cs @@ -0,0 +1,123 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using System; +using System.Globalization; +using System.Management.Automation; +using System.Security.Permissions; +using System.Threading.Tasks; +using Microsoft.WindowsAzure.Commands.Storage.Common; +using Microsoft.WindowsAzure.Commands.Storage.Model.Contract; +using Microsoft.WindowsAzure.Commands.Storage.Table; +using Microsoft.WindowsAzure.Storage.Table; + +namespace Microsoft.WindowsAzure.Commands.Storage.Table.Cmdlet +{ + [Cmdlet(VerbsCommon.Set, StorageNouns.TableStoredAccessPolicy), OutputType(typeof(String))] + public class SetAzureStorageTableStoredAccessPolicyCommand : StorageCloudTableCmdletBase + { + [Alias("N", "Name")] + [Parameter(Position = 0, Mandatory = true, + HelpMessage = "Table Name", + ValueFromPipeline = true, + ValueFromPipelineByPropertyName = true)] + [ValidateNotNullOrEmpty] + public string Table { get; set; } + + [Parameter(Position = 1, Mandatory = true, + HelpMessage = "Policy Identifier")] + [ValidateNotNullOrEmpty] + public string Policy { get; set; } + + [Parameter(HelpMessage = "Permissions for a table. Permissions can be any not-empty subset of \"audqr\".")] + public string Permission { get; set; } + + [Parameter(HelpMessage = "Start Time")] + public DateTime? StartTime { get; set; } + + [Parameter(HelpMessage = "Expirty Time")] + public DateTime? ExpiryTime { get; set; } + + [Parameter(HelpMessage = "Set StartTime as null for the policy")] + public SwitchParameter NoStartTime { get; set; } + + [Parameter(HelpMessage = "Set ExpiryTime as null for the policy")] + public SwitchParameter NoExpiryTime { get; set; } + + /// + /// Initializes a new instance of the SetAzureStorageTableStoredAccessPolicyCommand class. + /// + public SetAzureStorageTableStoredAccessPolicyCommand() + : this(null) + { + } + + /// + /// Initializes a new instance of the SetAzureStorageTableStoredAccessPolicyCommand class. + /// + /// IStorageTableManagement channel + public SetAzureStorageTableStoredAccessPolicyCommand(IStorageTableManagement channel) + { + Channel = channel; + EnableMultiThread = false; + } + + internal string SetAzureTableStoredAccessPolicy(IStorageTableManagement localChannel, string tableName, string policyName, DateTime? startTime, DateTime? expiryTime, string permission, bool noStartTime, bool noExpiryTime) + { + DateTime? startTimeToSet = startTime; + DateTime? expiryTimetoSet = expiryTime; + + //Get existing permissions + CloudTable table = localChannel.GetTableReference(Table); + TablePermissions tablePermissions = localChannel.GetTablePermissions(table); + + //Set the policy with new value + if (!tablePermissions.SharedAccessPolicies.Keys.Contains(policyName)) + { + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resources.PolicyNotFound, policyName)); + } + + SharedAccessTablePolicy policy = tablePermissions.SharedAccessPolicies[policyName]; + AccessPolicyHelper.SetupAccessPolicy(policy, startTime, expiryTime, permission, noStartTime, noExpiryTime); + tablePermissions.SharedAccessPolicies[policyName] = policy; + + //Set permission back to table + localChannel.SetTablePermissions(table, tablePermissions); + WriteObject(AccessPolicyHelper.ConstructPolicyOutputPSObject(tablePermissions.SharedAccessPolicies, policyName)); + return policyName; + } + + /// + /// Execute command + /// + [PermissionSet(SecurityAction.Demand, Name = "FullTrust")] + public override void ExecuteCmdlet() + { + if (String.IsNullOrEmpty(Table) || String.IsNullOrEmpty(Policy)) return; + if (NoStartTime && StartTime != null) + { + throw new ArgumentException(Resources.StartTimeParameterConflict); + } + + if (NoExpiryTime && ExpiryTime != null) + { + throw new ArgumentException(Resources.ExpiryTimeParameterConflict); + } + + SetAzureTableStoredAccessPolicy(Channel, Table, Policy, StartTime, ExpiryTime, Permission, NoStartTime, NoExpiryTime); + } + } +} + + diff --git a/src/ServiceManagement/Storage/Commands.Storage/packages.config b/src/ServiceManagement/Storage/Commands.Storage/packages.config index abc5215e8944..bdea9420592b 100644 --- a/src/ServiceManagement/Storage/Commands.Storage/packages.config +++ b/src/ServiceManagement/Storage/Commands.Storage/packages.config @@ -1,15 +1,20 @@  + + + + + + - - + diff --git a/src/ServiceManagement/TrafficManager/Commands.TrafficManager.Test/Commands.TrafficManager.Test.csproj b/src/ServiceManagement/TrafficManager/Commands.TrafficManager.Test/Commands.TrafficManager.Test.csproj index fc40b9b1787d..e8ab5c18c638 100644 --- a/src/ServiceManagement/TrafficManager/Commands.TrafficManager.Test/Commands.TrafficManager.Test.csproj +++ b/src/ServiceManagement/TrafficManager/Commands.TrafficManager.Test/Commands.TrafficManager.Test.csproj @@ -35,6 +35,22 @@ false + + ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll + + + False + ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll + + + ..\..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll + ..\..\..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll @@ -44,6 +60,13 @@ ..\..\..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll + + False + ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll + + + ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll + False ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll @@ -57,18 +80,11 @@ ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - - False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll + + ..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.dll - - False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll - - - False - ..\..\..\packages\Microsoft.WindowsAzure.Management.TrafficManager.0.14.0-preview\lib\net40\Microsoft.WindowsAzure.Management.TrafficManager.dll - True + + ..\..\..\packages\Microsoft.WindowsAzure.Management.TrafficManager.0.16.0-preview\lib\net40\Microsoft.WindowsAzure.Management.TrafficManager.dll False diff --git a/src/ServiceManagement/TrafficManager/Commands.TrafficManager.Test/packages.config b/src/ServiceManagement/TrafficManager/Commands.TrafficManager.Test/packages.config index 5e8c017f9629..6a1d321c8bcf 100644 --- a/src/ServiceManagement/TrafficManager/Commands.TrafficManager.Test/packages.config +++ b/src/ServiceManagement/TrafficManager/Commands.TrafficManager.Test/packages.config @@ -1,15 +1,20 @@  + + + + + + - - - + + diff --git a/src/ServiceManagement/TrafficManager/Commands.TrafficManager/Commands.TrafficManager.csproj b/src/ServiceManagement/TrafficManager/Commands.TrafficManager/Commands.TrafficManager.csproj index 6eae3bc8d116..f084b7c8e9e5 100644 --- a/src/ServiceManagement/TrafficManager/Commands.TrafficManager/Commands.TrafficManager.csproj +++ b/src/ServiceManagement/TrafficManager/Commands.TrafficManager/Commands.TrafficManager.csproj @@ -45,6 +45,23 @@ false + + ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll + + + False + ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.13.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll + + + ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll + + + False + ..\..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll + ..\..\..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll @@ -54,6 +71,13 @@ ..\..\..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll + + False + ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll + + + ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll + False ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll @@ -66,23 +90,16 @@ False ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - - False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.dll - - - False - ..\..\..\packages\Microsoft.WindowsAzure.Common.1.4.1\lib\net45\Microsoft.WindowsAzure.Common.NetFramework.dll - ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll - + False - ..\..\..\packages\Microsoft.WindowsAzure.Management.2.1.0\lib\net40\Microsoft.WindowsAzure.Management.dll + ..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.dll - - ..\..\..\packages\Microsoft.WindowsAzure.Management.TrafficManager.0.14.0-preview\lib\net40\Microsoft.WindowsAzure.Management.TrafficManager.dll + + False + ..\..\..\packages\Microsoft.WindowsAzure.Management.TrafficManager.0.16.0-preview\lib\net40\Microsoft.WindowsAzure.Management.TrafficManager.dll ..\..\..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll @@ -143,10 +160,6 @@ - - {b95c489c-8cb7-4dcf-8d5f-b9aebdbbaf89} - Common.Extensions - {5ee72c53-1720-4309-b54b-5fb79703195f} Commands.Common diff --git a/src/ServiceManagement/TrafficManager/Commands.TrafficManager/Utilities/TrafficManagerClient.cs b/src/ServiceManagement/TrafficManager/Commands.TrafficManager/Utilities/TrafficManagerClient.cs index 5c25d4a1eefd..50a60c5de37b 100644 --- a/src/ServiceManagement/TrafficManager/Commands.TrafficManager/Utilities/TrafficManagerClient.cs +++ b/src/ServiceManagement/TrafficManager/Commands.TrafficManager/Utilities/TrafficManagerClient.cs @@ -21,6 +21,8 @@ using Microsoft.WindowsAzure.Management.TrafficManager; using Microsoft.WindowsAzure.Management.TrafficManager.Models; using Microsoft.Azure.Common.Extensions; +using Microsoft.Azure; +using Hyak.Common; namespace Microsoft.WindowsAzure.Commands.TrafficManager.Utilities { @@ -73,7 +75,7 @@ public ProfileWithDefinition AssignDefinitionToProfile(string profileName, Defin public void RemoveTrafficManagerProfile(string profileName) { - OperationResponse resp = this.Client.Profiles.Delete(profileName); + AzureOperationResponse resp = this.Client.Profiles.Delete(profileName); } public ProfileWithDefinition GetTrafficManagerProfileWithDefinition(string profileName) diff --git a/src/ServiceManagement/TrafficManager/Commands.TrafficManager/packages.config b/src/ServiceManagement/TrafficManager/Commands.TrafficManager/packages.config index 11f921bdd596..79ad7aea5fe6 100644 --- a/src/ServiceManagement/TrafficManager/Commands.TrafficManager/packages.config +++ b/src/ServiceManagement/TrafficManager/Commands.TrafficManager/packages.config @@ -1,17 +1,21 @@  + + + + + + - - - - + + \ No newline at end of file