From b3df9120dfd938d93cfa7525c262f79be06d90e1 Mon Sep 17 00:00:00 2001 From: Siddharth Chatrola Date: Mon, 21 Sep 2015 16:23:32 -0700 Subject: [PATCH 01/15] MaxMemoryPolicy should exists as deprecated parameter and throw proper exception when used --- .../ScenarioTests/RedisCacheTests.cs | 7 ++++ .../ScenarioTests/RedisCacheTests.ps1 | 16 ++++++++ .../Commands/NewAzureRedisCache.cs | 8 ++++ .../Commands/SetAzureRedisCache.cs | 12 +++++- ...oft.Azure.Commands.RedisCache.dll-Help.xml | 38 +++++++++++++++++++ .../Properties/Resources.Designer.cs | 11 +++++- .../Properties/Resources.resx | 3 ++ 7 files changed, 93 insertions(+), 2 deletions(-) diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.cs b/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.cs index 8fd5f15be630..a9e7402532d9 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.cs +++ b/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.cs @@ -47,5 +47,12 @@ public void TestSetRedisCacheBugFixTest() { RunPowerShellTest("Test-SetRedisCacheBugFixTest"); } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestMaxMemoryPolicyErrorCheck() + { + RunPowerShellTest("Test-MaxMemoryPolicyErrorCheck"); + } } } diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.ps1 b/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.ps1 index 962cf2debae9..6e33fe709888 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.ps1 +++ b/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.ps1 @@ -258,4 +258,20 @@ function Test-SetRedisCacheBugFixTest $cacheUpdated2 = Set-AzureRMRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName -RedisConfiguration @{"maxmemory-policy" = "allkeys-lru"} Assert-AreEqual "allkeys-lru" $cacheUpdated2.RedisConfiguration.Item("maxmemory-policy") Assert-True { $cacheUpdated2.EnableNonSslPort } +} + +<# +.SYNOPSIS +Tests MaxMemoryPolicy error check +#> +function Test-MaxMemoryPolicyErrorCheck +{ + # Setup + # resource group should exists + $resourceGroupName = "DummyResourceGroup" + $cacheName = "dummycache" + $location = "North Central US" + + # Updating Cache + Assert-ThrowsContains {New-AzureRMRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName -Location $location -MaxMemoryPolicy AllKeysRandom} "'MaxMemoryPolicy' is deprecated. Please use 'RedisConfiguration' to set MaxMemoryPolicy" } \ No newline at end of file diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache/Commands/NewAzureRedisCache.cs b/src/ResourceManager/RedisCache/Commands.RedisCache/Commands/NewAzureRedisCache.cs index 12dcacfa96de..22d88c24ebca 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache/Commands/NewAzureRedisCache.cs +++ b/src/ResourceManager/RedisCache/Commands.RedisCache/Commands/NewAzureRedisCache.cs @@ -50,6 +50,9 @@ public class NewAzureRedisCache : RedisCacheCmdletBase [ValidateSet(SkuStrings.Basic, SkuStrings.Standard, IgnoreCase = false)] public string Sku { get; set; } + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "MaxMemoryPolicy is deprecated. Please use RedisConfiguration instead.")] + public string MaxMemoryPolicy { get; set; } + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "A hash table which represents redis configuration properties.")] public Hashtable RedisConfiguration { get; set; } @@ -65,6 +68,11 @@ protected override void ProcessRecord() WriteWarning("The RedisVersion parameter has been deprecated. As such, it is no longer necessary to provide this parameter and any value specified is ignored."); } + if (!string.IsNullOrEmpty(MaxMemoryPolicy)) + { + throw new CloudException(Resources.MaxMemoryPolicyException); + } + string skuFamily; int skuCapacity = 1; diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache/Commands/SetAzureRedisCache.cs b/src/ResourceManager/RedisCache/Commands.RedisCache/Commands/SetAzureRedisCache.cs index a7f9dd35ddc6..e851474b2a30 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache/Commands/SetAzureRedisCache.cs +++ b/src/ResourceManager/RedisCache/Commands.RedisCache/Commands/SetAzureRedisCache.cs @@ -15,11 +15,13 @@ namespace Microsoft.Azure.Commands.RedisCache { using Microsoft.Azure.Commands.RedisCache.Models; + using Microsoft.Azure.Commands.RedisCache.Properties; using Microsoft.Azure.Management.Redis.Models; using System.Collections; using System.Management.Automation; using SkuStrings = Microsoft.Azure.Management.Redis.Models.SkuName; - + using Hyak.Common; + [Cmdlet(VerbsCommon.Set, "AzureRMRedisCache", DefaultParameterSetName = MaxMemoryParameterSetName), OutputType(typeof(RedisCacheAttributesWithAccessKeys))] public class SetAzureRedisCache : RedisCacheCmdletBase { @@ -42,6 +44,9 @@ public class SetAzureRedisCache : RedisCacheCmdletBase [ValidateSet(SkuStrings.Basic, SkuStrings.Standard, IgnoreCase = false)] public string Sku { get; set; } + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "MaxMemoryPolicy is deprecated. Please use RedisConfiguration instead.")] + public string MaxMemoryPolicy { get; set; } + [Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false, HelpMessage = "A hash table which represents redis configuration properties.")] public Hashtable RedisConfiguration { get; set; } @@ -50,6 +55,11 @@ public class SetAzureRedisCache : RedisCacheCmdletBase protected override void ProcessRecord() { + if (!string.IsNullOrEmpty(MaxMemoryPolicy)) + { + throw new CloudException(Resources.MaxMemoryPolicyException); + } + RedisGetResponse response = CacheClient.GetCache(ResourceGroupName, Name); string skuName; diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache/Microsoft.Azure.Commands.RedisCache.dll-Help.xml b/src/ResourceManager/RedisCache/Commands.RedisCache/Microsoft.Azure.Commands.RedisCache.dll-Help.xml index bf2f0f023260..3e4f7c218939 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache/Microsoft.Azure.Commands.RedisCache.dll-Help.xml +++ b/src/ResourceManager/RedisCache/Commands.RedisCache/Microsoft.Azure.Commands.RedisCache.dll-Help.xml @@ -316,6 +316,13 @@ String + + MaxMemoryPolicy + + The 'MaxMemoryPolicy' setting has been deprecated. Please use 'RedisConfiguration' setting to set MaxMemoryPolicy. e.g. -RedisConfiguration @{"maxmemory-policy" = "allkeys-lru"} + + String + RedisConfiguration @@ -408,6 +415,18 @@ Standard + + MaxMemoryPolicy + + The 'MaxMemoryPolicy' setting has been deprecated. Please use 'RedisConfiguration' setting to set MaxMemoryPolicy. e.g. -RedisConfiguration @{"maxmemory-policy" = "allkeys-lru"} + + String + + String + + + + RedisConfiguration @@ -1088,6 +1107,13 @@ String + + MaxMemoryPolicy + + The 'MaxMemoryPolicy' setting has been deprecated. Please use 'RedisConfiguration' setting to set MaxMemoryPolicy. e.g. -RedisConfiguration @{"maxmemory-policy" = "allkeys-lru"} + + String + RedisConfiguration @@ -1155,6 +1181,18 @@ + + MaxMemoryPolicy + + The 'MaxMemoryPolicy' setting has been deprecated. Please use 'RedisConfiguration' setting to set MaxMemoryPolicy. e.g. -RedisConfiguration @{"maxmemory-policy" = "allkeys-lru"} + + String + + String + + + + RedisConfiguration diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache/Properties/Resources.Designer.cs b/src/ResourceManager/RedisCache/Commands.RedisCache/Properties/Resources.Designer.cs index 504ce90ddea9..dd9cdd59e67b 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache/Properties/Resources.Designer.cs +++ b/src/ResourceManager/RedisCache/Commands.RedisCache/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34014 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -60,6 +60,15 @@ internal Resources() { } } + /// + /// Looks up a localized string similar to The 'MaxMemoryPolicy' setting has been deprecated. Please use 'RedisConfiguration' setting to set MaxMemoryPolicy. e.g. -RedisConfiguration @{"maxmemory-policy" = "allkeys-lru"}. + /// + internal static string MaxMemoryPolicyException { + get { + return ResourceManager.GetString("MaxMemoryPolicyException", resourceCulture); + } + } + /// /// Looks up a localized string similar to Redis cache with name '{0}' already exists.. /// diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache/Properties/Resources.resx b/src/ResourceManager/RedisCache/Commands.RedisCache/Properties/Resources.resx index 9535144c625c..e5ab2b9bd9d6 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache/Properties/Resources.resx +++ b/src/ResourceManager/RedisCache/Commands.RedisCache/Properties/Resources.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + The 'MaxMemoryPolicy' setting has been deprecated. Please use 'RedisConfiguration' setting to set MaxMemoryPolicy. e.g. -RedisConfiguration @{"maxmemory-policy" = "allkeys-lru"} + Redis cache with name '{0}' already exists. From 37743180f8a74af3639ab399151d7c144713e2de Mon Sep 17 00:00:00 2001 From: Siddharth Chatrola Date: Tue, 22 Sep 2015 12:40:16 -0700 Subject: [PATCH 02/15] Using ArgumentException for throwing MaxMemoryPolicyException --- .../Commands.RedisCache/Commands/NewAzureRedisCache.cs | 3 ++- .../Commands.RedisCache/Commands/SetAzureRedisCache.cs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache/Commands/NewAzureRedisCache.cs b/src/ResourceManager/RedisCache/Commands.RedisCache/Commands/NewAzureRedisCache.cs index 22d88c24ebca..171bbad04cfc 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache/Commands/NewAzureRedisCache.cs +++ b/src/ResourceManager/RedisCache/Commands.RedisCache/Commands/NewAzureRedisCache.cs @@ -22,6 +22,7 @@ namespace Microsoft.Azure.Commands.RedisCache using SkuStrings = Microsoft.Azure.Management.Redis.Models.SkuName; using Hyak.Common; using System.Collections; + using System; [Cmdlet(VerbsCommon.New, "AzureRMRedisCache"), OutputType(typeof(RedisCacheAttributesWithAccessKeys))] public class NewAzureRedisCache : RedisCacheCmdletBase @@ -70,7 +71,7 @@ protected override void ProcessRecord() if (!string.IsNullOrEmpty(MaxMemoryPolicy)) { - throw new CloudException(Resources.MaxMemoryPolicyException); + throw new ArgumentException(Resources.MaxMemoryPolicyException); } string skuFamily; diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache/Commands/SetAzureRedisCache.cs b/src/ResourceManager/RedisCache/Commands.RedisCache/Commands/SetAzureRedisCache.cs index e851474b2a30..8b41204e7326 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache/Commands/SetAzureRedisCache.cs +++ b/src/ResourceManager/RedisCache/Commands.RedisCache/Commands/SetAzureRedisCache.cs @@ -21,6 +21,7 @@ namespace Microsoft.Azure.Commands.RedisCache using System.Management.Automation; using SkuStrings = Microsoft.Azure.Management.Redis.Models.SkuName; using Hyak.Common; + using System; [Cmdlet(VerbsCommon.Set, "AzureRMRedisCache", DefaultParameterSetName = MaxMemoryParameterSetName), OutputType(typeof(RedisCacheAttributesWithAccessKeys))] public class SetAzureRedisCache : RedisCacheCmdletBase @@ -57,7 +58,7 @@ protected override void ProcessRecord() { if (!string.IsNullOrEmpty(MaxMemoryPolicy)) { - throw new CloudException(Resources.MaxMemoryPolicyException); + throw new ArgumentException(Resources.MaxMemoryPolicyException); } RedisGetResponse response = CacheClient.GetCache(ResourceGroupName, Name); From 4b923747bd510cb56a98549de8385814036228a6 Mon Sep 17 00:00:00 2001 From: Siddharth Chatrola Date: Tue, 22 Sep 2015 12:49:45 -0700 Subject: [PATCH 03/15] Fixing test message --- .../Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.ps1 b/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.ps1 index 6e33fe709888..0e4297bc2271 100644 --- a/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.ps1 +++ b/src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.ps1 @@ -273,5 +273,5 @@ function Test-MaxMemoryPolicyErrorCheck $location = "North Central US" # Updating Cache - Assert-ThrowsContains {New-AzureRMRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName -Location $location -MaxMemoryPolicy AllKeysRandom} "'MaxMemoryPolicy' is deprecated. Please use 'RedisConfiguration' to set MaxMemoryPolicy" + Assert-ThrowsContains {New-AzureRMRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName -Location $location -MaxMemoryPolicy AllKeysRandom} "The 'MaxMemoryPolicy' setting has been deprecated" } \ No newline at end of file From 33f89dfd852205aab749d9a3acbd7e62d1f7c553 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 22 Sep 2015 13:37:36 -0700 Subject: [PATCH 04/15] changes to deployment cmdlet --- .../GetAzureResourceGroupDeploymentCommand.cs | 2 +- .../RemoveAzureResourceGroupDeploymentCommand.cs | 4 ++-- .../StopAzureResourceGroupDeploymentCommand.cs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/GetAzureResourceGroupDeploymentCommand.cs b/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/GetAzureResourceGroupDeploymentCommand.cs index d402aead5b76..01a70be63565 100644 --- a/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/GetAzureResourceGroupDeploymentCommand.cs +++ b/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/GetAzureResourceGroupDeploymentCommand.cs @@ -33,7 +33,7 @@ public class GetAzureResourceGroupDeploymentCommand : ResourcesBaseCmdlet [ValidateNotNullOrEmpty] public string Name { get; set; } - [Parameter(Position = 2, Mandatory = false, ValueFromPipelineByPropertyName = false, HelpMessage = "The provisioning state of the resource group deployment.")] + [Parameter(Mandatory = false, HelpMessage = "The provisioning state of the resource group deployment.")] [ValidateNotNullOrEmpty] public string ProvisioningState { get; set; } diff --git a/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/RemoveAzureResourceGroupDeploymentCommand.cs b/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/RemoveAzureResourceGroupDeploymentCommand.cs index 35c9a5b6f237..256bf1682351 100644 --- a/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/RemoveAzureResourceGroupDeploymentCommand.cs +++ b/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/RemoveAzureResourceGroupDeploymentCommand.cs @@ -33,10 +33,10 @@ public class RemoveAzureResourceGroupDeploymentCommand : ResourcesBaseCmdlet [ValidateNotNullOrEmpty] public string Name { get; set; } - [Parameter(Position = 2, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Do not confirm the remove.")] + [Parameter(Mandatory = false, HelpMessage = "Do not confirm the remove.")] public SwitchParameter Force { get; set; } - [Parameter(Position = 3, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "True if succeed, false otherwise.")] + [Parameter(Mandatory = false, HelpMessage = "True if succeed, false otherwise.")] public SwitchParameter PassThru { get; set; } protected override void ProcessRecord() diff --git a/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/StopAzureResourceGroupDeploymentCommand.cs b/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/StopAzureResourceGroupDeploymentCommand.cs index 1fe0850f2a4c..f8189b5ef64d 100644 --- a/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/StopAzureResourceGroupDeploymentCommand.cs +++ b/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/StopAzureResourceGroupDeploymentCommand.cs @@ -33,10 +33,10 @@ public class StopAzureResourceGroupDeploymentCommand : ResourcesBaseCmdlet [ValidateNotNullOrEmpty] public string Name { get; set; } - [Parameter(Position = 2, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Do not confirm the stop.")] + [Parameter(Mandatory = false, HelpMessage = "Do not confirm the stop.")] public SwitchParameter Force { get; set; } - [Parameter(Position = 3, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "True if succeed, false otherwise.")] + [Parameter(Mandatory = false, HelpMessage = "True if succeed, false otherwise.")] public SwitchParameter PassThru { get; set; } protected override void ProcessRecord() From 64f0f7ca8fcc804a1f02cf167f240c3026e905fa Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 22 Sep 2015 13:43:03 -0700 Subject: [PATCH 05/15] changes to Get-AzureResource cmdlet --- .../Cmdlets/Implementation/GetAzureResourceCmdlet.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/GetAzureResourceCmdlet.cs b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/GetAzureResourceCmdlet.cs index b636eaa36979..ce59fec174f4 100644 --- a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/GetAzureResourceCmdlet.cs +++ b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/GetAzureResourceCmdlet.cs @@ -76,7 +76,7 @@ public sealed class GetAzureResourceCmdlet : ResourceManagerCmdletBase /// Gets or sets the resource name parameter. /// [Alias("Id")] - [Parameter(ParameterSetName = GetAzureResourceCmdlet.GetResourceByIdParameterSet, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The resource's Id.")] + [Parameter(ParameterSetName = GetAzureResourceCmdlet.GetResourceByIdParameterSet, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource's Id.")] [ValidateNotNullOrEmpty] public string ResourceId { get; set; } From b6e969e404a0884fbd42fda0867648863c5c9a5e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 22 Sep 2015 14:15:37 -0700 Subject: [PATCH 06/15] changes to resource lock cmdlets to support piping --- .../Implementation/GetAzureResourceLockCmdlet.cs | 12 ++++++------ .../Implementation/NewAzureResourceLockCmdlet.cs | 16 ++++++++-------- .../RemoveAzureResourceLockCmdlet.cs | 12 ++++++------ .../ResourceLockManagementCmdletBase.cs | 16 ++++++++-------- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/GetAzureResourceLockCmdlet.cs b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/GetAzureResourceLockCmdlet.cs index c92c0b471939..c0784a544495 100644 --- a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/GetAzureResourceLockCmdlet.cs +++ b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/GetAzureResourceLockCmdlet.cs @@ -30,12 +30,12 @@ public class GetAzureResourceLockCmdlet : ResourceLockManagementCmdletBase /// Gets or sets the extension resource name parameter. /// [Alias("ExtensionResourceName")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ScopeLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.TenantResourceLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ScopeLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.TenantResourceLevelLock, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] [ValidateNotNullOrEmpty] public string LockName { get; set; } diff --git a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/NewAzureResourceLockCmdlet.cs b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/NewAzureResourceLockCmdlet.cs index 25ffcf833038..a4e04ed25ae9 100644 --- a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/NewAzureResourceLockCmdlet.cs +++ b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/NewAzureResourceLockCmdlet.cs @@ -29,12 +29,12 @@ public class NewAzureResourceLockCmdlet : ResourceLockManagementCmdletBase /// Gets or sets the extension resource name parameter. /// [Alias("ExtensionResourceName")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ScopeLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.TenantResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ScopeLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.TenantResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] [ValidateNotNullOrEmpty] public string LockName { get; set; } @@ -42,7 +42,7 @@ public class NewAzureResourceLockCmdlet : ResourceLockManagementCmdletBase /// Gets or sets the extension resource name parameter. /// [Alias("Level")] - [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The level of the lock.")] + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The level of the lock.")] [ValidateNotNullOrEmpty] public LockLevel LockLevel { get; set; } @@ -50,7 +50,7 @@ public class NewAzureResourceLockCmdlet : ResourceLockManagementCmdletBase /// Gets or sets the extension resource name parameter. /// [Alias("Notes")] - [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = false, HelpMessage = "The notes of the lock.")] + [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The notes of the lock.")] [ValidateNotNullOrEmpty] public string LockNotes { get; set; } diff --git a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/RemoveAzureResourceLockCmdlet.cs b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/RemoveAzureResourceLockCmdlet.cs index 87e2615027e8..4ce16c135032 100644 --- a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/RemoveAzureResourceLockCmdlet.cs +++ b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/RemoveAzureResourceLockCmdlet.cs @@ -27,12 +27,12 @@ public class RemoveAzureResourceLockCmdlet : ResourceLockManagementCmdletBase /// Gets or sets the extension resource name parameter. /// [Alias("ExtensionResourceName")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ScopeLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.TenantResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ScopeLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.TenantResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the lock.")] [ValidateNotNullOrEmpty] public string LockName { get; set; } diff --git a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/ResourceLockManagementCmdletBase.cs b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/ResourceLockManagementCmdletBase.cs index 7f84ad3b9e4c..7a5e2da39c56 100644 --- a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/ResourceLockManagementCmdletBase.cs +++ b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/ResourceLockManagementCmdletBase.cs @@ -73,26 +73,26 @@ public abstract class ResourceLockManagementCmdletBase : ResourceManagerCmdletBa /// /// Gets or sets the resource name parameter. /// - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The resource name. e.g. to specify a database MyServer/MyDatabase.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The resource name. e.g. to specify a database MyServer/MyDatabase.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.TenantResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The resource name. e.g. to specify a database MyServer/MyDatabase.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource name. e.g. to specify a database MyServer/MyDatabase.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource name. e.g. to specify a database MyServer/MyDatabase.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.TenantResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource name. e.g. to specify a database MyServer/MyDatabase.")] [ValidateNotNullOrEmpty] public string ResourceName { get; set; } /// /// Gets or sets the resource type parameter. /// - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The resource type. e.g. Microsoft.Sql/Servers/Databases.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The resource type. e.g. Microsoft.Sql/Servers/Databases.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.TenantResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The resource type. e.g. Microsoft.Sql/Servers/Databases.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource type. e.g. Microsoft.Sql/Servers/Databases.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource type. e.g. Microsoft.Sql/Servers/Databases.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.TenantResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource type. e.g. Microsoft.Sql/Servers/Databases.")] [ValidateNotNullOrEmpty] public string ResourceType { get; set; } /// /// Gets or sets the resource group name parameter. /// - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The resource group name.")] - [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = false, HelpMessage = "The resource group name.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource group name.")] + [Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource group name.")] [ValidateNotNullOrEmpty] public string ResourceGroupName { get; set; } From 4e1e4751a0ab78310f7621dbae5562ea72da1a17 Mon Sep 17 00:00:00 2001 From: Rachid Cesin Gorostieta Date: Thu, 17 Sep 2015 18:02:21 -0700 Subject: [PATCH 07/15] Add Sku parameter for Set-AzureResource and New-AzureResource --- .../Cmdlets/Commands.Resources.Rest.csproj | 1 + .../Cmdlets/Entities/Resources/Resource.cs | 7 +++ .../Cmdlets/Entities/Resources/ResourceSku.cs | 55 +++++++++++++++++++ .../Implementation/NewAzureResourceCmdlet.cs | 9 +++ .../Implementation/SetAzureResourceCmdlet.cs | 13 ++++- .../ScenarioTests/ResourceTests.ps1 | 17 +++--- 6 files changed, 94 insertions(+), 8 deletions(-) create mode 100644 src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Entities/Resources/ResourceSku.cs diff --git a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Commands.Resources.Rest.csproj b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Commands.Resources.Rest.csproj index 8652d99f0341..945ebfa9d4d7 100644 --- a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Commands.Resources.Rest.csproj +++ b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Commands.Resources.Rest.csproj @@ -120,6 +120,7 @@ + diff --git a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Entities/Resources/Resource.cs b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Entities/Resources/Resource.cs index dbe87b7521d0..777e0354038a 100644 --- a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Entities/Resources/Resource.cs +++ b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Entities/Resources/Resource.cs @@ -47,6 +47,13 @@ public class Resource [JsonProperty(Required = Required.Default)] public string Type { get; set; } + /// + /// Gets or sets the resource sku. + /// + [JsonProperty(Required = Required.Default)] + public ResourceSku Sku { get; set; } + + /// /// Gets or sets the kind of the resource definition. /// diff --git a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Entities/Resources/ResourceSku.cs b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Entities/Resources/ResourceSku.cs new file mode 100644 index 000000000000..ae79227e562d --- /dev/null +++ b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Entities/Resources/ResourceSku.cs @@ -0,0 +1,55 @@ +// ---------------------------------------------------------------------------------- +// +// 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.Azure.Commands.ResourceManager.Cmdlets.Entities.Resources +{ + using Newtonsoft.Json; + + /// + /// The resource sku object. + /// + public class ResourceSku + { + /// + /// Gets or sets the sku name. + /// + [JsonProperty(Required = Required.Always)] + public string Name { get; set; } + + /// + /// Gets or sets the sku tier. + /// + [JsonProperty(Required = Required.Default)] + public string Tier { get; set; } + + /// + /// Gets or sets the sku size. + /// + [JsonProperty(Required = Required.Default)] + public string Size { get; set; } + + /// + /// Gets or sets the sku family. + /// + [JsonProperty(Required = Required.Default)] + public string Family { get; set; } + + /// + /// Gets or sets the sku capacity. + /// + [JsonProperty(Required = Required.Default)] + public int? Capacity { get; set; } + } +} + diff --git a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/NewAzureResourceCmdlet.cs b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/NewAzureResourceCmdlet.cs index 20ae91629c14..ab8ce0bf43c1 100644 --- a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/NewAzureResourceCmdlet.cs +++ b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/NewAzureResourceCmdlet.cs @@ -60,6 +60,14 @@ public sealed class NewAzureResourceCmdlet : ResourceManipulationCmdletBase [ValidateNotNullOrEmpty] public Hashtable PlanObject { get; set; } + /// + /// Gets or sets the plan object. + /// + [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "A hash table which represents sku properties.")] + [ValidateNotNullOrEmpty] + public Hashtable SkuObject { get; set; } + + /// /// Gets or sets the tags. /// @@ -174,6 +182,7 @@ private Resource GetResource() Location = this.Location, Kind = this.Kind, Plan = this.PlanObject.ToDictionary(addValueLayer: false).ToJson().FromJson(), + Sku = this.SkuObject.ToDictionary(addValueLayer: false).ToJson().FromJson(), Tags = TagsHelper.GetTagsDictionary(this.Tag), Properties = this.Properties.ToResourcePropertiesBody(), }; diff --git a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/SetAzureResourceCmdlet.cs b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/SetAzureResourceCmdlet.cs index e77d64b07c89..cdb94e6ff6dd 100644 --- a/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/SetAzureResourceCmdlet.cs +++ b/src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/SetAzureResourceCmdlet.cs @@ -53,6 +53,15 @@ public sealed class SetAzureResourceCmdlet : ResourceManipulationCmdletBase [ValidateNotNullOrEmpty] public Hashtable Plan { get; set; } + /// + /// Gets or sets the plan object. + /// + [Alias("SkuObject")] + [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "A hash table which represents sku properties.")] + [ValidateNotNullOrEmpty] + public Hashtable Sku { get; set; } + + /// /// Gets or sets the tags. /// @@ -165,6 +174,7 @@ private JToken GetResourceBody() { Kind = this.Kind, Plan = this.Plan.ToDictionary(addValueLayer: false).ToJson().FromJson(), + Sku = this.Sku.ToDictionary(addValueLayer: false).ToJson().FromJson(), Tags = TagsHelper.GetTagsDictionary(this.Tag), Properties = this.Properties.ToResourcePropertiesBody(), }.ToJToken(); @@ -176,6 +186,7 @@ private JToken GetResourceBody() { Kind = this.Kind ?? resource.Kind, Plan = this.Plan.ToDictionary(addValueLayer: false).ToJson().FromJson() ?? resource.Plan, + Sku = this.Sku.ToDictionary(addValueLayer: false).ToJson().FromJson() ?? resource.Sku, Tags = TagsHelper.GetTagsDictionary(this.Tag) ?? resource.Tags, Location = resource.Location, Properties = this.Properties == null ? resource.Properties : this.Properties.ToResourcePropertiesBody(), @@ -194,7 +205,7 @@ private JToken GetResourceBody() /// private bool ShouldUsePatchSemantics() { - return this.UsePatchSemantics || (this.Tag != null && this.Plan == null && this.Properties == null && this.Kind == null); + return this.UsePatchSemantics || ((this.Tag != null || this.Sku != null) && this.Plan == null && this.Properties == null && this.Kind == null); } /// diff --git a/src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ResourceTests.ps1 b/src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ResourceTests.ps1 index 1443513b2ef7..88612b3bb834 100644 --- a/src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ResourceTests.ps1 +++ b/src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ResourceTests.ps1 @@ -27,9 +27,9 @@ function Test-CreatesNewSimpleResource $resourceType = "Microsoft.Sql/servers" # Test - New-AzureRmResourceGroup -Name $rgname -Location $rglocation - $actual = New-AzureRmResource -Name $rname -Location $location -Tags @{Name = "testtag"; Value = "testval"} -ResourceGroupName $rgname -ResourceType $resourceType -PropertyObject @{"administratorLogin" = "adminuser"; "administratorLoginPassword" = "P@ssword1"} -ApiVersion $apiversion - $expected = Get-AzureRmResource -Name $rname -ResourceGroupName $rgname -ResourceType $resourceType -ApiVersion $apiversion + New-AzureRMResourceGroup -Name $rgname -Location $rglocation + $actual = New-AzureRMResource -Name $rname -Location $location -Tags @{Name = "testtag"; Value = "testval"} -ResourceGroupName $rgname -ResourceType $resourceType -PropertyObject @{"administratorLogin" = "adminuser"; "administratorLoginPassword" = "P@ssword1"} -SkuObject @{ Name = "A0" } -ApiVersion $apiversion + $expected = Get-AzureRMResource -Name $rname -ResourceGroupName $rgname -ResourceType $resourceType -ApiVersion $apiversion $list = Get-AzureRmResource -ResourceGroupName $rgname @@ -38,7 +38,8 @@ function Test-CreatesNewSimpleResource Assert-AreEqual $expected.ResourceGroupName $actual.ResourceGroupName Assert-AreEqual $expected.ResourceType $actual.ResourceType Assert-AreEqual 1 @($list).Count - Assert-AreEqual $expected.Name $list[0].Name + Assert-AreEqual $expected.Name $list[0].Name + Assert-AreEqual $expected.Sku $actual.Sku } <# @@ -258,12 +259,14 @@ function Test-SetAResource $resourceType = "Providers.Test/statefulResources" # Test - New-AzureRmResourceGroup -Name $rgname -Location $rglocation - $resource = New-AzureRmResource -Name $rname -Location $rglocation -Tags @{Name = "testtag"; Value = "testval"} -ResourceGroupName $rgname -ResourceType $resourceType -PropertyObject @{"key" = "value"} -ApiVersion $apiversion -Force - Set-AzureRmResource -ResourceGroupName $rgname -ResourceName $rname -ResourceType $resourceType -Properties @{"key2" = "value2"} -Force + New-AzureRMResourceGroup -Name $rgname -Location $rglocation + $resource = New-AzureRMResource -Name $rname -Location $rglocation -Tags @{Name = "testtag"; Value = "testval"} -ResourceGroupName $rgname -ResourceType $resourceType -PropertyObject @{"key" = "value"} -SkuObject @{ Name = "A0" } -ApiVersion $apiversion -Force + Set-AzureRMResource -ResourceGroupName $rgname -ResourceName $rname -ResourceType $resourceType -Properties @{"key2" = "value2"} -Force + Set-AzureRMResource -ResourceGroupName $rgname -ResourceName $rname -ResourceType $resourceType -SkuObject @{ Name = "A1" } -Force $modifiedResource = Get-AzureRmResource -ResourceGroupName $rgname -ResourceName $rname -ResourceType $resourceType # Assert Assert-AreEqual $modifiedResource.Properties.key2 "value2" + Assert-AreEqual $modifiedResource.Sku.Name "A1" } \ No newline at end of file From 5d008368c434880dd72347106d5ed0d0faeedfe2 Mon Sep 17 00:00:00 2001 From: yugangw-msft Date: Mon, 28 Sep 2015 13:56:56 -0700 Subject: [PATCH 08/15] fix all solutions to have dependency on commands.common (was lost during a bad merge) --- src/ResourceManager/Automation/Automation.sln | 6 ++++++ src/ResourceManager/AzureBackup/AzureBackup.sln | 6 ++++++ src/ResourceManager/AzureBatch/AzureBatch.sln | 12 ++++++++++++ src/ResourceManager/Compute/Compute.sln | 6 ++++++ src/ResourceManager/DataFactories/DataFactories.sln | 6 ++++++ src/ResourceManager/Dns/Dns.sln | 6 ++++++ src/ResourceManager/HDInsight/HDInsight.sln | 6 ++++++ src/ResourceManager/Insights/Insights.sln | 6 ++++++ src/ResourceManager/KeyVault/KeyVault.sln | 6 ++++++ src/ResourceManager/Network/Network.sln | 6 ++++++ .../OperationalInsights/OperationalInsights.sln | 6 ++++++ src/ResourceManager/Profile/Profile.sln | 6 ++++++ src/ResourceManager/RedisCache/RedisCache.sln | 6 ++++++ src/ResourceManager/Resources/Resources.sln | 6 ++++++ src/ResourceManager/SiteRecovery/SiteRecovery.sln | 6 ++++++ src/ResourceManager/Sql/Sql.sln | 6 ++++++ src/ResourceManager/Storage/Storage.sln | 6 ++++++ src/ResourceManager/Tags/Tags.sln | 6 ++++++ .../TrafficManager/TrafficManager.sln | 6 ++++++ .../UsageAggregates/UsageAggregates.sln | 6 ++++++ src/ResourceManager/Websites/WebSites.sln | 6 ++++++ 21 files changed, 132 insertions(+) diff --git a/src/ResourceManager/Automation/Automation.sln b/src/ResourceManager/Automation/Automation.sln index 6ead0ee365f3..9376fc4f5b00 100644 --- a/src/ResourceManager/Automation/Automation.sln +++ b/src/ResourceManager/Automation/Automation.sln @@ -14,6 +14,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\Prof EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ScenarioTests.ResourceManager.Common", "..\Common\Commands.ScenarioTests.ResourceManager.Common\Commands.ScenarioTests.ResourceManager.Common.csproj", "{3436A126-EDC9-4060-8952-9A1BE34CDD95}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -40,6 +42,10 @@ Global {3436A126-EDC9-4060-8952-9A1BE34CDD95}.Debug|Any CPU.Build.0 = Debug|Any CPU {3436A126-EDC9-4060-8952-9A1BE34CDD95}.Release|Any CPU.ActiveCfg = Release|Any CPU {3436A126-EDC9-4060-8952-9A1BE34CDD95}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/AzureBackup/AzureBackup.sln b/src/ResourceManager/AzureBackup/AzureBackup.sln index f51f6f155112..287471331331 100644 --- a/src/ResourceManager/AzureBackup/AzureBackup.sln +++ b/src/ResourceManager/AzureBackup/AzureBackup.sln @@ -14,6 +14,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ScenarioTests.Reso EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -40,6 +42,10 @@ Global {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/AzureBatch/AzureBatch.sln b/src/ResourceManager/AzureBatch/AzureBatch.sln index 9c364d137071..344a94efde20 100644 --- a/src/ResourceManager/AzureBatch/AzureBatch.sln +++ b/src/ResourceManager/AzureBatch/AzureBatch.sln @@ -18,6 +18,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Resources", "..\Re EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Resources.Rest", "..\Resources\Commands.ResourceManager\Cmdlets\Commands.Resources.Rest.csproj", "{8058D403-06E3-4BED-8924-D166CE303961}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Tags", "..\Tags\Commands.Tags\Commands.Tags.csproj", "{2493A8F7-1949-4F29-8D53-9D459046C3B8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -52,6 +56,14 @@ Global {8058D403-06E3-4BED-8924-D166CE303961}.Debug|Any CPU.Build.0 = Debug|Any CPU {8058D403-06E3-4BED-8924-D166CE303961}.Release|Any CPU.ActiveCfg = Release|Any CPU {8058D403-06E3-4BED-8924-D166CE303961}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU + {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/Compute/Compute.sln b/src/ResourceManager/Compute/Compute.sln index 11bb5e5e40b6..4675b38ccd59 100644 --- a/src/ResourceManager/Compute/Compute.sln +++ b/src/ResourceManager/Compute/Compute.sln @@ -34,6 +34,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Resources.Rest", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Storage", "..\..\Common\Storage\Commands.Storage\Commands.Storage.csproj", "{08CF7DA7-0392-4A19-B79B-E1FF67CDB81A}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ServiceManagement.Common", "..\..\ServiceManagement\Common\Commands.ServiceManagement.Common\Commands.ServiceManagement.Common.csproj", "{CFF09E81-1E31-444E-B4D4-A21E946C29E2}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -100,6 +102,10 @@ Global {08CF7DA7-0392-4A19-B79B-E1FF67CDB81A}.Debug|Any CPU.Build.0 = Debug|Any CPU {08CF7DA7-0392-4A19-B79B-E1FF67CDB81A}.Release|Any CPU.ActiveCfg = Release|Any CPU {08CF7DA7-0392-4A19-B79B-E1FF67CDB81A}.Release|Any CPU.Build.0 = Release|Any CPU + {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/DataFactories/DataFactories.sln b/src/ResourceManager/DataFactories/DataFactories.sln index 5c206b6c79a6..776515232269 100644 --- a/src/ResourceManager/DataFactories/DataFactories.sln +++ b/src/ResourceManager/DataFactories/DataFactories.sln @@ -22,6 +22,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Resources", "..\Re EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Resources.Rest", "..\Resources\Commands.ResourceManager\Cmdlets\Commands.Resources.Rest.csproj", "{8058D403-06E3-4BED-8924-D166CE303961}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Tags", "..\Tags\Commands.Tags\Commands.Tags.csproj", "{2493A8F7-1949-4F29-8D53-9D459046C3B8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -64,6 +66,10 @@ Global {8058D403-06E3-4BED-8924-D166CE303961}.Debug|Any CPU.Build.0 = Debug|Any CPU {8058D403-06E3-4BED-8924-D166CE303961}.Release|Any CPU.ActiveCfg = Release|Any CPU {8058D403-06E3-4BED-8924-D166CE303961}.Release|Any CPU.Build.0 = Release|Any CPU + {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/Dns/Dns.sln b/src/ResourceManager/Dns/Dns.sln index b9a2ce6145e8..51bb234e88d0 100644 --- a/src/ResourceManager/Dns/Dns.sln +++ b/src/ResourceManager/Dns/Dns.sln @@ -20,6 +20,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Tags", "..\Tags\Co EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Dns.Test", "Commands.Dns.Test\Commands.Dns.Test.csproj", "{133561EC-99AF-4ADC-AF41-39C4D3AD323B}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -58,6 +60,10 @@ Global {133561EC-99AF-4ADC-AF41-39C4D3AD323B}.Debug|Any CPU.Build.0 = Debug|Any CPU {133561EC-99AF-4ADC-AF41-39C4D3AD323B}.Release|Any CPU.ActiveCfg = Release|Any CPU {133561EC-99AF-4ADC-AF41-39C4D3AD323B}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/HDInsight/HDInsight.sln b/src/ResourceManager/HDInsight/HDInsight.sln index 242437eea50a..b014fe0664c9 100644 --- a/src/ResourceManager/HDInsight/HDInsight.sln +++ b/src/ResourceManager/HDInsight/HDInsight.sln @@ -20,6 +20,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ScenarioTests.Reso EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Tags", "..\Tags\Commands.Tags\Commands.Tags.csproj", "{2493A8F7-1949-4F29-8D53-9D459046C3B8}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -58,6 +60,10 @@ Global {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Debug|Any CPU.Build.0 = Debug|Any CPU {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.ActiveCfg = Release|Any CPU {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/Insights/Insights.sln b/src/ResourceManager/Insights/Insights.sln index 14804839b33f..36d29f50e21d 100644 --- a/src/ResourceManager/Insights/Insights.sln +++ b/src/ResourceManager/Insights/Insights.sln @@ -14,6 +14,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ScenarioTests.Reso EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -40,6 +42,10 @@ Global {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/KeyVault/KeyVault.sln b/src/ResourceManager/KeyVault/KeyVault.sln index 312a9f3fe52c..d0026ceedd50 100644 --- a/src/ResourceManager/KeyVault/KeyVault.sln +++ b/src/ResourceManager/KeyVault/KeyVault.sln @@ -20,6 +20,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ScenarioTests.Reso EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -58,6 +60,10 @@ Global {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/Network/Network.sln b/src/ResourceManager/Network/Network.sln index c351f2c5f7fb..828d39e9f320 100644 --- a/src/ResourceManager/Network/Network.sln +++ b/src/ResourceManager/Network/Network.sln @@ -22,6 +22,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Resources.Rest", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -64,6 +66,10 @@ Global {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/OperationalInsights/OperationalInsights.sln b/src/ResourceManager/OperationalInsights/OperationalInsights.sln index 6e6226bf7a44..627df9cc0c04 100644 --- a/src/ResourceManager/OperationalInsights/OperationalInsights.sln +++ b/src/ResourceManager/OperationalInsights/OperationalInsights.sln @@ -20,6 +20,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Resources.Rest", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Tags", "..\Tags\Commands.Tags\Commands.Tags.csproj", "{2493A8F7-1949-4F29-8D53-9D459046C3B8}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -58,6 +60,10 @@ Global {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Debug|Any CPU.Build.0 = Debug|Any CPU {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.ActiveCfg = Release|Any CPU {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/Profile/Profile.sln b/src/ResourceManager/Profile/Profile.sln index 0689f47ced3b..eeb568975b82 100644 --- a/src/ResourceManager/Profile/Profile.sln +++ b/src/ResourceManager/Profile/Profile.sln @@ -12,6 +12,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile.Test", "Co EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ScenarioTests.ResourceManager.Common", "..\Common\Commands.ScenarioTests.ResourceManager.Common\Commands.ScenarioTests.ResourceManager.Common.csproj", "{3436A126-EDC9-4060-8952-9A1BE34CDD95}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -34,6 +36,10 @@ Global {3436A126-EDC9-4060-8952-9A1BE34CDD95}.Debug|Any CPU.Build.0 = Debug|Any CPU {3436A126-EDC9-4060-8952-9A1BE34CDD95}.Release|Any CPU.ActiveCfg = Release|Any CPU {3436A126-EDC9-4060-8952-9A1BE34CDD95}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/RedisCache/RedisCache.sln b/src/ResourceManager/RedisCache/RedisCache.sln index c1a0b9ceea01..0f8569262a39 100644 --- a/src/ResourceManager/RedisCache/RedisCache.sln +++ b/src/ResourceManager/RedisCache/RedisCache.sln @@ -14,6 +14,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\Prof EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ScenarioTests.ResourceManager.Common", "..\Common\Commands.ScenarioTests.ResourceManager.Common\Commands.ScenarioTests.ResourceManager.Common.csproj", "{3436A126-EDC9-4060-8952-9A1BE34CDD95}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -40,6 +42,10 @@ Global {3436A126-EDC9-4060-8952-9A1BE34CDD95}.Debug|Any CPU.Build.0 = Debug|Any CPU {3436A126-EDC9-4060-8952-9A1BE34CDD95}.Release|Any CPU.ActiveCfg = Release|Any CPU {3436A126-EDC9-4060-8952-9A1BE34CDD95}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/Resources/Resources.sln b/src/ResourceManager/Resources/Resources.sln index 66039cf34c54..8fb07dab530d 100644 --- a/src/ResourceManager/Resources/Resources.sln +++ b/src/ResourceManager/Resources/Resources.sln @@ -18,6 +18,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ScenarioTests.Reso EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -52,6 +54,10 @@ Global {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/SiteRecovery/SiteRecovery.sln b/src/ResourceManager/SiteRecovery/SiteRecovery.sln index bfeae087f99c..2136cd6804f0 100644 --- a/src/ResourceManager/SiteRecovery/SiteRecovery.sln +++ b/src/ResourceManager/SiteRecovery/SiteRecovery.sln @@ -14,6 +14,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ScenarioTests.Reso EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -40,6 +42,10 @@ Global {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/Sql/Sql.sln b/src/ResourceManager/Sql/Sql.sln index 3219786c5e1d..8dcf5b48785b 100644 --- a/src/ResourceManager/Sql/Sql.sln +++ b/src/ResourceManager/Sql/Sql.sln @@ -30,6 +30,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Co EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Insights", "..\Insights\Commands.Insights\Commands.Insights.csproj", "{DEA446A1-84E2-46CC-B780-EB4AFDE2460E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ServiceManagement.Common", "..\..\ServiceManagement\Common\Commands.ServiceManagement.Common\Commands.ServiceManagement.Common.csproj", "{CFF09E81-1E31-444E-B4D4-A21E946C29E2}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -88,6 +90,10 @@ Global {DEA446A1-84E2-46CC-B780-EB4AFDE2460E}.Debug|Any CPU.Build.0 = Debug|Any CPU {DEA446A1-84E2-46CC-B780-EB4AFDE2460E}.Release|Any CPU.ActiveCfg = Release|Any CPU {DEA446A1-84E2-46CC-B780-EB4AFDE2460E}.Release|Any CPU.Build.0 = Release|Any CPU + {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/Storage/Storage.sln b/src/ResourceManager/Storage/Storage.sln index ae60ddee819c..7af18caf0872 100644 --- a/src/ResourceManager/Storage/Storage.sln +++ b/src/ResourceManager/Storage/Storage.sln @@ -8,6 +8,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Co EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Storage", "..\..\Common\Storage\Commands.Storage\Commands.Storage.csproj", "{08CF7DA7-0392-4A19-B79B-E1FF67CDB81A}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ServiceManagement.Common", "..\..\ServiceManagement\Common\Commands.ServiceManagement.Common\Commands.ServiceManagement.Common.csproj", "{CFF09E81-1E31-444E-B4D4-A21E946C29E2}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -26,6 +28,10 @@ Global {08CF7DA7-0392-4A19-B79B-E1FF67CDB81A}.Debug|Any CPU.Build.0 = Debug|Any CPU {08CF7DA7-0392-4A19-B79B-E1FF67CDB81A}.Release|Any CPU.ActiveCfg = Release|Any CPU {08CF7DA7-0392-4A19-B79B-E1FF67CDB81A}.Release|Any CPU.Build.0 = Release|Any CPU + {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/Tags/Tags.sln b/src/ResourceManager/Tags/Tags.sln index 9bf51fbfe0e2..d4527bd8a3d9 100644 --- a/src/ResourceManager/Tags/Tags.sln +++ b/src/ResourceManager/Tags/Tags.sln @@ -6,6 +6,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ResourceManager.Co EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Tags", "Commands.Tags\Commands.Tags.csproj", "{2493A8F7-1949-4F29-8D53-9D459046C3B8}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -20,6 +22,10 @@ Global {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Debug|Any CPU.Build.0 = Debug|Any CPU {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.ActiveCfg = Release|Any CPU {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/TrafficManager/TrafficManager.sln b/src/ResourceManager/TrafficManager/TrafficManager.sln index a54f92b7ffb0..86bd2ca81848 100644 --- a/src/ResourceManager/TrafficManager/TrafficManager.sln +++ b/src/ResourceManager/TrafficManager/TrafficManager.sln @@ -20,6 +20,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Resources", "..\Re EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Resources.Rest", "..\Resources\Commands.ResourceManager\Cmdlets\Commands.Resources.Rest.csproj", "{8058D403-06E3-4BED-8924-D166CE303961}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -58,6 +60,10 @@ Global {8058D403-06E3-4BED-8924-D166CE303961}.Debug|Any CPU.Build.0 = Debug|Any CPU {8058D403-06E3-4BED-8924-D166CE303961}.Release|Any CPU.ActiveCfg = Release|Any CPU {8058D403-06E3-4BED-8924-D166CE303961}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/UsageAggregates/UsageAggregates.sln b/src/ResourceManager/UsageAggregates/UsageAggregates.sln index e55a5c9266bb..1f0626abd5e7 100644 --- a/src/ResourceManager/UsageAggregates/UsageAggregates.sln +++ b/src/ResourceManager/UsageAggregates/UsageAggregates.sln @@ -14,6 +14,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ScenarioTests.Reso EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -40,6 +42,10 @@ Global {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU {142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManager/Websites/WebSites.sln b/src/ResourceManager/Websites/WebSites.sln index 62ffa02e0f9a..e9c3057d83e7 100644 --- a/src/ResourceManager/Websites/WebSites.sln +++ b/src/ResourceManager/Websites/WebSites.sln @@ -20,6 +20,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ScenarioTests.Reso EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Tags", "..\Tags\Commands.Tags\Commands.Tags.csproj", "{2493A8F7-1949-4F29-8D53-9D459046C3B8}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -58,6 +60,10 @@ Global {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Debug|Any CPU.Build.0 = Debug|Any CPU {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.ActiveCfg = Release|Any CPU {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.Build.0 = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 89c3b281ec550060d48e00f642199c40658eafc7 Mon Sep 17 00:00:00 2001 From: Hovsep Mkrtchyan Date: Mon, 28 Sep 2015 16:00:20 -0700 Subject: [PATCH 09/15] Fixed uninstaller and added Admin role validation --- tools/AzureRM/AzureRM.psd1 | Bin 5292 -> 5292 bytes tools/AzureRM/AzureRM.psm1 | 31 ++++++++++++++++++++++++------- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/tools/AzureRM/AzureRM.psd1 b/tools/AzureRM/AzureRM.psd1 index 740ba03a61cb8ba16ae80a1af562b6b9f4414921..51fd7597bf010825fde5a6fcfb47a6c68d775ac5 100644 GIT binary patch delta 18 ZcmZ3ZxkhtC4HKi$WJ5Ob%~O~pgaA8>1z-RG delta 16 XcmZ3ZxkhtC4bx;NW{J&Hm?VS%G*bmU diff --git a/tools/AzureRM/AzureRM.psm1 b/tools/AzureRM/AzureRM.psm1 index 0f61bd8f478b..f28ba6e28a7a 100644 --- a/tools/AzureRM/AzureRM.psm1 +++ b/tools/AzureRM/AzureRM.psm1 @@ -1,9 +1,6 @@ -#Requires -RunAsAdministrator - $AzureRMProfileVersion = "0.9.8"; $AzureRMModules = @{ - "Azure.Storage" = "0.9.8"; "AzureRM.ApiManagement" = "0.9.8"; "AzureRM.Automation" = "0.9.8"; "AzureRM.Backup" = "0.9.8"; @@ -16,7 +13,6 @@ $AzureRMModules = @{ "AzureRM.KeyVault" = "0.9.8"; "AzureRM.Network" = "0.9.8"; "AzureRM.OperationalInsights" = "0.9.8"; - "AzureRM.Profile" = "0.9.8"; "AzureRM.RedisCache" = "0.9.8"; "AzureRM.Resources" = "0.9.8"; "AzureRM.SiteRecovery" = "0.9.8"; @@ -29,6 +25,19 @@ $AzureRMModules = @{ "AzureRM.Websites" = "0.9.8" } +function Validate-AdminRights([string]$Scope) +{ + if ($Scope -ne "CurrentUser") + { + $user = [Security.Principal.WindowsIdentity]::GetCurrent(); + $isAdmin = (New-Object Security.Principal.WindowsPrincipal $user).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator) + if($isAdmin -eq $false) + { + throw "Administrator rights are required to install Microsoft Azure modules" + } + } +} + function Import-ModuleWithVersionCheck([string]$Name,[string]$MinimumVersion,[string]$Repository,[string]$Scope) { $minVer = $MinimumVersion @@ -77,6 +86,8 @@ function Update-AzureRM $Scope = "AllUsers" } + Validate-AdminRights $Scope + Write-Output "Installing AzureRM modules." Import-ModuleWithVersionCheck "AzureRM.Profile" $AzureRMProfileVersion $Repository $Scope @@ -103,18 +114,24 @@ function Uninstall-AzureRM [string] $Repository) + Validate-AdminRights "AllUsers" + Write-Output "Uninstalling AzureRM modules." $AzureRMModules.Keys | ForEach { $moduleName = $_ if ((Get-InstalledModule | where {$_.Name -eq $moduleName}) -ne $null) { - Uninstall-Module -Name $_ -ErrorAction Stop + $minVer = $AzureRMModules[$_] + $maxVer = "$($minVer.Split(".")[0]).9999.0" + Uninstall-Module -Name $_ -MinimumVersion $minVer -MaximumVersion $maxVer -ErrorAction Stop Write-Output "$moduleName uninstalled..." } } - if ((Get-InstalledModule | where {"AzureRM.Profile" -eq $moduleName}) -ne $null) { - Uninstall-Module -Name "AzureRM.Profile" -ErrorAction Stop + if ((Get-InstalledModule | where {$_.Name -eq "AzureRM.Profile"}) -ne $null) { + $minVer = $AzureRMProfileVersion + $maxVer = "$($minVer.Split(".")[0]).9999.0" + Uninstall-Module -Name "AzureRM.Profile" -MinimumVersion $minVer -MaximumVersion $maxVer -ErrorAction Stop Write-Output "AzureRM.Profile uninstalled..." } } From 95fc632e652a30bec556ea4673600e31311d7572 Mon Sep 17 00:00:00 2001 From: yugangw-msft Date: Mon, 28 Sep 2015 16:14:01 -0700 Subject: [PATCH 10/15] Add AzureStorage to scope of build.proj --- build.proj | 13 +++++++++---- tools/PublishModules.ps1 | 13 ++++++++++--- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/build.proj b/build.proj index f5445033cff9..b3aecfbbdfda 100644 --- a/build.proj +++ b/build.proj @@ -18,7 +18,12 @@ /p:CodeSign=True;DelaySign=True Test the code sign workflow locally. - + + /p:Scope + 'Azure': service management + 'AzureStorage': storage data plane cmdlets + 'Subfolder under src\ResourceManager': An individual cmdlet module + By default, it builds all --> @@ -41,7 +46,8 @@ - + @@ -292,8 +298,7 @@ - - + diff --git a/tools/PublishModules.ps1 b/tools/PublishModules.ps1 index bd21b1daf213..9f8ba4ac00c8 100644 --- a/tools/PublishModules.ps1 +++ b/tools/PublishModules.ps1 @@ -38,7 +38,7 @@ if ([string]::IsNullOrEmpty($repositoryLocation)) if ([string]::IsNullOrEmpty($scope)) { Write-Verbose "Default scope to all" - $scope = 'all' + $scope = 'All' } Write-Host "Publishing $scope package(s)" @@ -53,13 +53,20 @@ if ($repo -ne $null) { Register-PSRepository -Name $repoName -SourceLocation $repositoryLocation -PublishLocation $repositoryLocation/package -InstallationPolicy Trusted } -if (($scope -eq 'all') -or ($scope -eq 'servicemanagement')) { +if (($scope -eq 'All') -or ($scope -eq 'ServiceManagement')) { $modulePath = "$packageFolder\$buildConfig\ServiceManagement\Azure" # Publish Azure module Write-Host "Publishing Azure module from $modulePath" Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName } +if (($scope -eq 'All') -or ($scope -eq 'AzureStorage')) { + $modulePath = "$packageFolder\$buildConfig\ServiceManagement\Azure\Azure.Storage" + # Publish AzureStorage module + Write-Host "Publishing AzureStorage module from $modulePath" + Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName +} + if ($scope -eq 'AzureRM') { # Publish AzureRM module $modulePath = "$PSScriptRoot\AzureRM" @@ -70,7 +77,7 @@ if ($scope -eq 'AzureRM') { $resourceManagerRootFolder = "$packageFolder\$buildConfig\ResourceManager\AzureResourceManager" $resourceManagerModules = Get-ChildItem -Path $resourceManagerRootFolder -Directory -if ($scope -eq 'all') { +if ($scope -eq 'All') { # Publish AzureRM modules foreach ($module in $resourceManagerModules) { $modulePath = $module.FullName From 99cfeb9c33cf709b1a3348e421e39bdd529f80f8 Mon Sep 17 00:00:00 2001 From: Hovsep Mkrtchyan Date: Mon, 28 Sep 2015 16:19:30 -0700 Subject: [PATCH 11/15] Fixed test targets for Post-checkin job. --- AzurePowershell.Test.targets | 74 ++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/AzurePowershell.Test.targets b/AzurePowershell.Test.targets index bac576918008..b46fec4759f4 100644 --- a/AzurePowershell.Test.targets +++ b/AzurePowershell.Test.targets @@ -50,45 +50,45 @@ Command="MSTest.exe /testcontainer:$(_testAssembly) /testsettings:$(_testSettings) /category:$(_testFilter) /resultsfile:$(_testResult)" ContinueOnError="false" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Date: Mon, 28 Sep 2015 16:47:33 -0700 Subject: [PATCH 12/15] fix docs --- build.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.proj b/build.proj index b3aecfbbdfda..7adf0fe1da60 100644 --- a/build.proj +++ b/build.proj @@ -20,7 +20,7 @@ Test the code sign workflow locally. /p:Scope - 'Azure': service management + 'ServiceManagement': service management 'AzureStorage': storage data plane cmdlets 'Subfolder under src\ResourceManager': An individual cmdlet module By default, it builds all From 7b444e0fd87be01ec0b52e6a2737b35b667d448d Mon Sep 17 00:00:00 2001 From: yugangw-msft Date: Mon, 28 Sep 2015 17:07:43 -0700 Subject: [PATCH 13/15] ensure build profile first and fix couple of scope bugs --- AzurePowershell.Test.targets | 4 ++-- build.proj | 16 +++++++++------- tools/PublishModules.ps1 | 19 +++++++++++++------ 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/AzurePowershell.Test.targets b/AzurePowershell.Test.targets index bac576918008..40bca8e9dbf5 100644 --- a/AzurePowershell.Test.targets +++ b/AzurePowershell.Test.targets @@ -62,7 +62,7 @@ - + @@ -85,7 +85,7 @@ - + diff --git a/build.proj b/build.proj index b3aecfbbdfda..932de006aaf2 100644 --- a/build.proj +++ b/build.proj @@ -42,12 +42,14 @@ $(PublishDirectory)\TestResults true http://psget/PSGallery/api/v2/ + all - - + + + Condition=" '$(Scope)' == 'ServiceManagement' or '$(Scope)' == 'AzureStorage' "/> @@ -83,7 +85,7 @@ Targets="Clean" Properties="Configuration=$(Configuration);Platform=Any CPU" ContinueOnError="false" - Condition=" '$(Scope)' == '' "/> + Condition=" '$(Scope)' == 'all' "/> @@ -165,17 +167,17 @@ Targets="Build" Properties="Configuration=$(Configuration);Platform=Any CPU" ContinueOnError="false" - Condition=" '$(Scope)' == '' "/> + Condition=" '$(Scope)' == 'all' "/> + Condition=" '$(Scope)' == 'all' "/> + Condition=" '$(CodeSign)' == 'true' and '$(Scope)' == 'all'" /> diff --git a/tools/PublishModules.ps1 b/tools/PublishModules.ps1 index 9f8ba4ac00c8..09256d9274a8 100644 --- a/tools/PublishModules.ps1 +++ b/tools/PublishModules.ps1 @@ -77,13 +77,20 @@ if ($scope -eq 'AzureRM') { $resourceManagerRootFolder = "$packageFolder\$buildConfig\ResourceManager\AzureResourceManager" $resourceManagerModules = Get-ChildItem -Path $resourceManagerRootFolder -Directory -if ($scope -eq 'All') { - # Publish AzureRM modules +if ($scope -eq 'All') { + # Publish AzureRM.Profile first + Write-Host "Publishing profile module" + Publish-Module -Path "$resourceManagerRootFolder\AzureRM.Profile" -NuGetApiKey $apiKey -Repository $repoName + Write-Host "Published profile module" + foreach ($module in $resourceManagerModules) { - $modulePath = $module.FullName - Write-Host "Publishing $module module from $modulePath" - Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName - Write-Host "Published $module module" + # Make sure to filter out AzureRM.Profile + if ($module -ne "AzureRM.Profile") { + $modulePath = $module.FullName + Write-Host "Publishing $module module from $modulePath" + Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName + Write-Host "Published $module module" + } } } else { $modulePath = Join-Path $resourceManagerRootFolder "AzureRM.$scope" From feab3b35e96a996e2e0acb99b62e4253bf555c76 Mon Sep 17 00:00:00 2001 From: yugangw-msft Date: Mon, 28 Sep 2015 18:10:47 -0700 Subject: [PATCH 14/15] misc updates to get psget module published correctly --- AzurePowershell.Test.targets | 2 +- build.proj | 2 +- .../ApiManagement/ApiManagement.sln | 8 ++++++- tools/PublishModules.ps1 | 22 +++++++++++-------- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/AzurePowershell.Test.targets b/AzurePowershell.Test.targets index 40bca8e9dbf5..9fa5c6c3e5cc 100644 --- a/AzurePowershell.Test.targets +++ b/AzurePowershell.Test.targets @@ -85,7 +85,7 @@ - + diff --git a/build.proj b/build.proj index 932de006aaf2..68e20738be95 100644 --- a/build.proj +++ b/build.proj @@ -297,7 +297,7 @@ - + diff --git a/src/ResourceManager/ApiManagement/ApiManagement.sln b/src/ResourceManager/ApiManagement/ApiManagement.sln index 509ae32588a3..733aa0b7732b 100644 --- a/src/ResourceManager/ApiManagement/ApiManagement.sln +++ b/src/ResourceManager/ApiManagement/ApiManagement.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2013 -VisualStudioVersion = 12.0.31101.0 +VisualStudioVersion = 12.0.40629.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{95C16AED-FD57-42A0-86C3-2CF4300A4817}" EndProject @@ -32,6 +32,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Co EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ServiceManagement.Common", "..\..\ServiceManagement\Common\Commands.ServiceManagement.Common\Commands.ServiceManagement.Common.csproj", "{CFF09E81-1E31-444E-B4D4-A21E946C29E2}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Tags", "..\Tags\Commands.Tags\Commands.Tags.csproj", "{2493A8F7-1949-4F29-8D53-9D459046C3B8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -94,6 +96,10 @@ Global {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Debug|Any CPU.Build.0 = Debug|Any CPU {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Release|Any CPU.ActiveCfg = Release|Any CPU {CFF09E81-1E31-444E-B4D4-A21E946C29E2}.Release|Any CPU.Build.0 = Release|Any CPU + {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2493A8F7-1949-4F29-8D53-9D459046C3B8}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/tools/PublishModules.ps1 b/tools/PublishModules.ps1 index 09256d9274a8..7406de70a8f3 100644 --- a/tools/PublishModules.ps1 +++ b/tools/PublishModules.ps1 @@ -53,10 +53,19 @@ if ($repo -ne $null) { Register-PSRepository -Name $repoName -SourceLocation $repositoryLocation -PublishLocation $repositoryLocation/package -InstallationPolicy Trusted } +$resourceManagerRootFolder = "$packageFolder\$buildConfig\ResourceManager\AzureResourceManager" + +if ($scope -eq 'All') { + # Publish AzureRM.Profile first which is the common dependency + Write-Host "Publishing profile module" + Publish-Module -Path "$resourceManagerRootFolder\AzureRM.Profile" -NuGetApiKey $apiKey -Repository $repoName + Write-Host "Published profile module" +} + if (($scope -eq 'All') -or ($scope -eq 'ServiceManagement')) { $modulePath = "$packageFolder\$buildConfig\ServiceManagement\Azure" # Publish Azure module - Write-Host "Publishing Azure module from $modulePath" + Write-Host "Publishing ServiceManagement(aka Azure) module from $modulePath" Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName } @@ -75,17 +84,12 @@ if ($scope -eq 'AzureRM') { Write-Host "Published Azure module" } -$resourceManagerRootFolder = "$packageFolder\$buildConfig\ResourceManager\AzureResourceManager" $resourceManagerModules = Get-ChildItem -Path $resourceManagerRootFolder -Directory if ($scope -eq 'All') { - # Publish AzureRM.Profile first - Write-Host "Publishing profile module" - Publish-Module -Path "$resourceManagerRootFolder\AzureRM.Profile" -NuGetApiKey $apiKey -Repository $repoName - Write-Host "Published profile module" - foreach ($module in $resourceManagerModules) { - # Make sure to filter out AzureRM.Profile - if ($module -ne "AzureRM.Profile") { + # filter out AzureRM.Profile which always gets published first + # And "Azure.Storage" which is built out as test dependencies + if (($module.Name -ne "AzureRM.Profile") -and ($module.Name -ne "Azure.Storage")) { $modulePath = $module.FullName Write-Host "Publishing $module module from $modulePath" Publish-Module -Path $modulePath -NuGetApiKey $apiKey -Repository $repoName From f2ca380bea08e5e51410e4038557a813231ea3ff Mon Sep 17 00:00:00 2001 From: Yugang Wang Date: Tue, 29 Sep 2015 09:37:54 -0700 Subject: [PATCH 15/15] replace a tab with spaces --- tools/PublishModules.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/PublishModules.ps1 b/tools/PublishModules.ps1 index 7406de70a8f3..ed09c5844e34 100644 --- a/tools/PublishModules.ps1 +++ b/tools/PublishModules.ps1 @@ -88,7 +88,7 @@ $resourceManagerModules = Get-ChildItem -Path $resourceManagerRootFolder -Direct if ($scope -eq 'All') { foreach ($module in $resourceManagerModules) { # filter out AzureRM.Profile which always gets published first - # And "Azure.Storage" which is built out as test dependencies + # And "Azure.Storage" which is built out as test dependencies if (($module.Name -ne "AzureRM.Profile") -and ($module.Name -ne "Azure.Storage")) { $modulePath = $module.FullName Write-Host "Publishing $module module from $modulePath"