diff --git a/src/Common/Commands.Common.Test/Commands.Common.Test.csproj b/src/Common/Commands.Common.Test/Commands.Common.Test.csproj index 72de007a39a1..5fe80c7be50e 100644 --- a/src/Common/Commands.Common.Test/Commands.Common.Test.csproj +++ b/src/Common/Commands.Common.Test/Commands.Common.Test.csproj @@ -49,17 +49,17 @@ - ..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll + ..\..\packages\Hyak.Common.1.0.2\lib\net45\Hyak.Common.dll - ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll + ..\..\packages\Microsoft.Azure.Common.2.0.3\lib\net45\Microsoft.Azure.Common.dll False ..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll - ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll + ..\..\packages\Microsoft.Azure.Common.2.0.3\lib\net45\Microsoft.Azure.Common.NetFramework.dll ..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll @@ -107,7 +107,7 @@ False - ..\..\packages\Microsoft.WindowsAzure.Management.Compute.9.0.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll + ..\..\packages\Microsoft.WindowsAzure.Management.Compute.9.2.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll ..\..\packages\Microsoft.WindowsAzure.Management.Storage.5.0.0\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll diff --git a/src/Common/Commands.Common.Test/packages.config b/src/Common/Commands.Common.Test/packages.config index 017a7b8159e3..d9e821cd01ec 100644 --- a/src/Common/Commands.Common.Test/packages.config +++ b/src/Common/Commands.Common.Test/packages.config @@ -1,7 +1,7 @@  - - + + @@ -16,7 +16,7 @@ - + diff --git a/src/Common/Commands.Common/ServiceManagementTypes.cs b/src/Common/Commands.Common/ServiceManagementTypes.cs index b2aeb7aaa4b4..ad646843a7a7 100644 --- a/src/Common/Commands.Common/ServiceManagementTypes.cs +++ b/src/Common/Commands.Common/ServiceManagementTypes.cs @@ -1959,6 +1959,19 @@ public string State base.SetValue("State", value); } } + + [DataMember(Name = "ForceUpdate", EmitDefaultValue = false, Order = 7)] + public bool? ForceUpdate + { + get + { + return base.GetValue("ForceUpdate"); + } + set + { + base.SetValue("ForceUpdate", value); + } + } } [CollectionDataContract(Name = "ResourceExtensionReferences", Namespace = Constants.ServiceManagementNS)] diff --git a/src/Common/Commands.ScenarioTest/Commands.ScenarioTest.csproj b/src/Common/Commands.ScenarioTest/Commands.ScenarioTest.csproj index 7580a909c892..a1cb098ee46f 100644 --- a/src/Common/Commands.ScenarioTest/Commands.ScenarioTest.csproj +++ b/src/Common/Commands.ScenarioTest/Commands.ScenarioTest.csproj @@ -39,17 +39,17 @@ - ..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll + ..\..\packages\Hyak.Common.1.0.2\lib\net45\Hyak.Common.dll - ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll + ..\..\packages\Microsoft.Azure.Common.2.0.3\lib\net45\Microsoft.Azure.Common.dll False ..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll - ..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll + ..\..\packages\Microsoft.Azure.Common.2.0.3\lib\net45\Microsoft.Azure.Common.NetFramework.dll ..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll @@ -101,9 +101,8 @@ False ..\..\packages\Microsoft.WindowsAzure.Management.4.0.1\lib\net40\Microsoft.WindowsAzure.Management.dll - - False - ..\..\packages\Microsoft.WindowsAzure.Management.Compute.9.0.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll + + ..\..\packages\Microsoft.WindowsAzure.Management.Compute.9.2.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll ..\..\packages\Microsoft.WindowsAzure.Management.Storage.5.0.0\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll diff --git a/src/Common/Commands.ScenarioTest/packages.config b/src/Common/Commands.ScenarioTest/packages.config index d301118ab974..1c0e30743aed 100644 --- a/src/Common/Commands.ScenarioTest/packages.config +++ b/src/Common/Commands.ScenarioTest/packages.config @@ -1,7 +1,7 @@  - - + + @@ -17,7 +17,7 @@ - + diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Extensions.Test/Commands.ServiceManagement.Extensions.Test.csproj b/src/ServiceManagement/Compute/Commands.ServiceManagement.Extensions.Test/Commands.ServiceManagement.Extensions.Test.csproj index 7e801c7579b8..9e837ca9dda6 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Extensions.Test/Commands.ServiceManagement.Extensions.Test.csproj +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Extensions.Test/Commands.ServiceManagement.Extensions.Test.csproj @@ -76,9 +76,8 @@ False ..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.1\lib\net40\Microsoft.WindowsAzure.Management.dll - - False - ..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.9.0.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll + + ..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.9.2.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll False diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/Commands.ServiceManagement.PlatformImageRepository.csproj b/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/Commands.ServiceManagement.PlatformImageRepository.csproj index 15f23db23c94..9debb13f46d8 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/Commands.ServiceManagement.PlatformImageRepository.csproj +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/Commands.ServiceManagement.PlatformImageRepository.csproj @@ -60,17 +60,17 @@ ..\..\..\packages\AutoMapper.3.1.1\lib\net40\AutoMapper.Net4.dll - ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll + ..\..\..\packages\Hyak.Common.1.0.2\lib\net45\Hyak.Common.dll - ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll + ..\..\..\packages\Microsoft.Azure.Common.2.0.3\lib\net45\Microsoft.Azure.Common.dll False ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll - ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.Azure.Common.2.0.3\lib\net45\Microsoft.Azure.Common.NetFramework.dll False @@ -112,7 +112,7 @@ ..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.1\lib\net40\Microsoft.WindowsAzure.Management.dll - ..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.9.0.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll + ..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.9.2.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll False diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/packages.config b/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/packages.config index 7d44e82372d2..eae6ce5fd37a 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/packages.config +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.PlatformImageRepository/packages.config @@ -1,8 +1,8 @@  - - + + @@ -16,7 +16,7 @@ - + diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/Commands.ServiceManagement.Preview.csproj b/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/Commands.ServiceManagement.Preview.csproj index 44294d00057c..ea0bf9e6ffab 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/Commands.ServiceManagement.Preview.csproj +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/Commands.ServiceManagement.Preview.csproj @@ -60,17 +60,17 @@ ..\..\..\packages\AutoMapper.3.1.1\lib\net40\AutoMapper.Net4.dll - ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll + ..\..\..\packages\Hyak.Common.1.0.2\lib\net45\Hyak.Common.dll - ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll + ..\..\..\packages\Microsoft.Azure.Common.2.0.3\lib\net45\Microsoft.Azure.Common.dll False ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll - ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.Azure.Common.2.0.3\lib\net45\Microsoft.Azure.Common.NetFramework.dll False @@ -112,7 +112,7 @@ ..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.1\lib\net40\Microsoft.WindowsAzure.Management.dll - ..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.9.0.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll + ..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.9.2.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll False diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/packages.config b/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/packages.config index 52c05c11e685..25de44bff656 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/packages.config +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/packages.config @@ -1,8 +1,8 @@  - - + + @@ -16,7 +16,7 @@ - + diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/Commands.ServiceManagement.Test.csproj b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/Commands.ServiceManagement.Test.csproj index 2d2f7b7010f9..176347f5c1ab 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/Commands.ServiceManagement.Test.csproj +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/Commands.ServiceManagement.Test.csproj @@ -54,16 +54,16 @@ ..\..\..\packages\AutoMapper.3.1.1\lib\net40\AutoMapper.Net4.dll - ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll + ..\..\..\packages\Hyak.Common.1.0.2\lib\net45\Hyak.Common.dll - ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll + ..\..\..\packages\Microsoft.Azure.Common.2.0.3\lib\net45\Microsoft.Azure.Common.dll ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll - ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.Azure.Common.2.0.3\lib\net45\Microsoft.Azure.Common.NetFramework.dll ..\..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll @@ -105,7 +105,7 @@ ..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.1\lib\net40\Microsoft.WindowsAzure.Management.dll - ..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.9.0.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll + ..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.9.2.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll ..\..\..\packages\Microsoft.WindowsAzure.Management.Network.6.0.0\lib\net40\Microsoft.WindowsAzure.Management.Network.dll @@ -439,6 +439,8 @@ + + diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ExtensionTests/AzureVMAccessExtensionTests.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ExtensionTests/AzureVMAccessExtensionTests.cs index f426f256652c..96324282de56 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ExtensionTests/AzureVMAccessExtensionTests.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ExtensionTests/AzureVMAccessExtensionTests.cs @@ -81,10 +81,11 @@ public void CreateVMAccessExtensionTest() { try { - //Deploy a new IaaS VM with Extension using Add-AzureVMExtension + // Deploy a new IaaS VM with Extension using Add-AzureVMExtension Console.WriteLine("Create a new VM with VM access extension."); var vm = CreateIaaSVMObject(vmName); - vm = vmPowershellCmdlets.SetAzureVMAccessExtension(vm, vmAccessUserName, vmAccessPassword, version, null,false); + vm = vmPowershellCmdlets.SetAzureVMAccessExtension( + vm, vmAccessUserName, vmAccessPassword, version, null, false, true); vmPowershellCmdlets.NewAzureVM(serviceName, new[] { vm }, locationName, true); Console.WriteLine("Created a new VM {0} with VM access extension. Service Name : {1}", vmName, serviceName); @@ -92,10 +93,10 @@ public void CreateVMAccessExtensionTest() ValidateVMAccessExtension(vmName, serviceName, true); Utilities.GetAzureVMAndWaitForReady(serviceName, vmName, 30000, 300000); - //Verify that the extension actually work + // Verify that the extension actually work VerifyRDPExtension(vmName, serviceName); - //Disbale extesnion + // Disbale extesnion DisableExtension(vmName, serviceName); ValidateVMAccessExtension(vmName, serviceName, false); pass = true; @@ -114,13 +115,14 @@ public void UpdateVMAccessExtensionTest() { try { - //Deploy a new IaaS VM with Extension using Add-AzureVMExtension + // Deploy a new IaaS VM with Extension using Add-AzureVMExtension var vm = CreateIaaSVMObject(vmName); vmPowershellCmdlets.NewAzureVM(serviceName, new[] { vm }, locationName); vm = GetAzureVM(vmName, serviceName); - //Set extension without version - vm = vmPowershellCmdlets.SetAzureVMAccessExtension(vm, vmAccessUserName, vmAccessPassword, null, null, false); + // Set extension without version + vm = vmPowershellCmdlets.SetAzureVMAccessExtension( + vm, vmAccessUserName, vmAccessPassword, null, null, false, true); vmPowershellCmdlets.UpdateAzureVM(vmName, serviceName, vm); ValidateVMAccessExtension(vmName, serviceName, true); @@ -143,14 +145,15 @@ public void AddRoleVMAccessExtensionTest() { try { - //Create an deployment + // Create an deployment var vm1 = CreateIaaSVMObject(vmName); vmPowershellCmdlets.NewAzureVM(serviceName, new[] { vm1 }, locationName); - //Add a role with extension enabled. + // Add a role with extension enabled. string vmName2 = Utilities.GetUniqueShortName(vmNamePrefix); var vm2 = CreateIaaSVMObject(vmName2); - vm2 = vmPowershellCmdlets.SetAzureVMAccessExtension(vm2, vmAccessUserName,vmAccessPassword, version, referenceName,false); + vm2 = vmPowershellCmdlets.SetAzureVMAccessExtension( + vm2, vmAccessUserName,vmAccessPassword, version, referenceName, false, true); vmPowershellCmdlets.NewAzureVM(serviceName, new[] { vm2 }); ValidateVMAccessExtension(vmName2, serviceName, true); @@ -169,15 +172,16 @@ public void UpdateRoleVMAccessExtensionTest() { try { - //Create an deployment and add 2 roles + // Create an deployment and add 2 roles var vm1 = CreateIaaSVMObject(vmName); string vmName2 = Utilities.GetUniqueShortName(vmNamePrefix); var vm2 = CreateIaaSVMObject(vmName2); vmPowershellCmdlets.NewAzureVM(serviceName, new[] { vm1, vm2 }, locationName); - //Set VM Access extension to the VM + // Set VM Access extension to the VM var vmroleContext = vmPowershellCmdlets.GetAzureVM(vmName2, serviceName); - vmPowershellCmdlets.SetAzureVMAccessExtension(vm2, vmAccessUserName, vmAccessPassword, version, referenceName, false); + vmPowershellCmdlets.SetAzureVMAccessExtension( + vm2, vmAccessUserName, vmAccessPassword, version, referenceName, false, true); vmPowershellCmdlets.UpdateAzureVM(vmName2, serviceName, vm2); var result = vmPowershellCmdlets.GetAzureVM(vmName2, serviceName); @@ -286,7 +290,7 @@ private void DisableExtension(string vmName, string serviceName) { var vm = GetAzureVM(vmName, serviceName); Console.WriteLine("Disabling the VM Access extesnion for the vm {0}",vmName); - vm = vmPowershellCmdlets.SetAzureVMAccessExtension(vm,disable:true); + vm = vmPowershellCmdlets.SetAzureVMAccessExtension(vm, disable:true, forceUpdate:true); vmPowershellCmdlets.UpdateAzureVM(vmName, serviceName, vm); Console.WriteLine("Disabled VM Access extesnion for the vm {0}", vmName); } diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ExtensionTests/CustomScriptExtensionTests.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ExtensionTests/CustomScriptExtensionTests.cs index 1dbcd32e6afa..b0acd93336c9 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ExtensionTests/CustomScriptExtensionTests.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ExtensionTests/CustomScriptExtensionTests.cs @@ -41,7 +41,6 @@ public class CustomScriptExtesnionTests: ServiceManagementTest private string runFileName = "test2.ps2"; private string[] fileNames = {"test1.ps1","test2.ps1"}; private string endpointSuffix = ""; - //private VirtualMachineCustomScriptExtensionContext inputParameters; [TestInitialize] public void TestIntialization() @@ -169,7 +168,9 @@ public void NewAzureVMWithEmptyCustomScriptConfigurationTest() { vmName = Utilities.GetUniqueShortName(vmNamePrefix); var vm = Utilities.CreateIaaSVMObject(vmName, InstanceSize.Small, imageName, true, username, password); - vm = vmPowershellCmdlets.SetAzureVMExtension(vm, customScriptExtension.ExtensionName, customScriptExtension.Publisher, customScriptExtension.Version); + vm = vmPowershellCmdlets.SetAzureVMExtension(vm, + customScriptExtension.ExtensionName, customScriptExtension.Publisher, customScriptExtension.Version, + forceUpdate: true); vmPowershellCmdlets.NewAzureVM(serviceName, new[] { vm }, locationName); var vmExtension = vmPowershellCmdlets.GetAzureVMCustomScriptExtension(Utilities.GetAzureVM(vmName, serviceName)); @@ -222,22 +223,33 @@ private PersistentVM SetCustomScripExtesnionToVM(SetAzureVMCustomScriptExtension { case SetAzureVMCustomScriptExtensionCmdletParmaterSetType.SetCustomScriptExtensionByUrisParamSetName: Console.WriteLine("Calling Set-AzureVMCustomScriptExtension cmdlet using SetCustomScriptExtensionByUrisParamSetName parameter set including all parameters."); - return vmPowershellCmdlets.SetAzureVMCustomScriptExtension(vm, fileURI, true, runFileName, referenceName, customScriptExtension.Version); + return vmPowershellCmdlets.SetAzureVMCustomScriptExtension( + vm, fileURI, true, runFileName, referenceName, customScriptExtension.Version, null, true); + case SetAzureVMCustomScriptExtensionCmdletParmaterSetType.SetCustomScriptExtensionByUrisParamSetNameWithOutDefaultParameters: Console.WriteLine("Calling Set-AzureVMCustomScriptExtension cmdlet using SetCustomScriptExtensionByUrisParamSetName parameter set without optional parameters"); - return vmPowershellCmdlets.SetAzureVMCustomScriptExtension(vm, fileURI,true,runFileName); + return vmPowershellCmdlets.SetAzureVMCustomScriptExtension( + vm, fileURI, true, runFileName, null, null, null, true); + case SetAzureVMCustomScriptExtensionCmdletParmaterSetType.DisableCustomScriptExtensionParamSetName: Console.WriteLine("Calling Set-AzureVMCustomScriptExtension cmdlet using DisableCustomScriptExtensionParamSetName parameter set including all parameters."); - return vmPowershellCmdlets.SetAzureVMCustomScriptExtension(vm, true, referenceName, customScriptExtension.Version); + return vmPowershellCmdlets.SetAzureVMCustomScriptExtension( + vm, true, referenceName, customScriptExtension.Version, true); + case SetAzureVMCustomScriptExtensionCmdletParmaterSetType.DisableCustomScriptExtensionParamSetNameWithOutDefaultParameters: Console.WriteLine("Calling Set-AzureVMCustomScriptExtension cmdlet using DisableCustomScriptExtensionParamSetName parameter set without optional parameters"); - return vmPowershellCmdlets.SetAzureVMCustomScriptExtension(vm,true); + return vmPowershellCmdlets.SetAzureVMCustomScriptExtension(vm, true, null, null, true); + case SetAzureVMCustomScriptExtensionCmdletParmaterSetType.SetCustomScriptExtensionByContainerBlobsParamSetName: Console.WriteLine("Calling Set-AzureVMCustomScriptExtension cmdlet using SetCustomScriptExtensionByContainerBlobsParamSetName parameter set including all parameters."); - return vmPowershellCmdlets.SetAzureVMCustomScriptExtension(vm,fileNames, runFileName, storageAccountKey.StorageAccountName, endpointSuffix, containerName, storageAccountKey.Primary, referenceName, customScriptExtension.Version); + return vmPowershellCmdlets.SetAzureVMCustomScriptExtension( + vm, fileNames, runFileName, storageAccountKey.StorageAccountName, endpointSuffix, + containerName, storageAccountKey.Primary, referenceName, customScriptExtension.Version, null, true); + case SetAzureVMCustomScriptExtensionCmdletParmaterSetType.SetCustomScriptExtensionByContainerBlobsParamSetNameWithOutDefaultParameters: Console.WriteLine("Calling Set-AzureVMCustomScriptExtension cmdlet using SetCustomScriptExtensionByContainerBlobsParamSetName parameter set without optional parameters"); - return vmPowershellCmdlets.SetAzureVMCustomScriptExtension(vm,fileNames, runFileName,containerName: containerName); + return vmPowershellCmdlets.SetAzureVMCustomScriptExtension(vm, fileNames, runFileName, containerName: containerName); + default: break; } diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/GenericIaaSExtensionTests.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/GenericIaaSExtensionTests.cs index 9915405849b8..fbe3e7bb2aee 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/GenericIaaSExtensionTests.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/GenericIaaSExtensionTests.cs @@ -84,24 +84,32 @@ public void AzureVMExtensionTest() { try { - //Get the available VM Extension + // Get the available VM Extension var availableExtensions = vmPowershellCmdlets.GetAzureVMAvailableExtension(); vmAccessExtension = availableExtensions.First(extension => extension.ExtensionName.Equals(VmAccessAgentExtensionName)); if (availableExtensions.Count > 0) { - //Deploy a new IaaS VM with Extension using Add-AzureVMExtension + // Deploy a new IaaS VM with Extension using Add-AzureVMExtension Console.WriteLine("Create a new VM with VM access extension."); var vm = CreateIaaSVMObject(vmName); - vm = vmPowershellCmdlets.SetAzureVMExtension(vm, vmAccessExtension.ExtensionName, vmAccessExtension.Publisher, version, referenceName, publicConfigPath: publicConfigPath, privateConfigPath:privateConfigPath, disable: false); + vm = vmPowershellCmdlets.SetAzureVMExtension(vm, + vmAccessExtension.ExtensionName, + vmAccessExtension.Publisher, + version, + referenceName, + publicConfigPath: publicConfigPath, + privateConfigPath:privateConfigPath, + disable: false, + forceUpdate: true); vmPowershellCmdlets.NewAzureVM(serviceName, new[] {vm}, locationName); Console.WriteLine("Created a new VM {0} with VM access extension. Service Name : {1}",vmName,serviceName); ValidateVMAccessExtension(vmName, serviceName, true); - //Verify that the extension actually work + // Verify that the extension actually work VerifyRDPExtension(vmName, serviceName); - //Disbale extesnion + // Disbale extesnion DisableExtension(vmName, serviceName); ValidateVMAccessExtension(vmName, serviceName, false); @@ -125,13 +133,13 @@ public void UpdateVMWithExtensionTest() { try { - var availableExtensions = vmPowershellCmdlets.GetAzureVMAvailableExtension(); + var availableExtensions = vmPowershellCmdlets.GetAzureVMAvailableExtension(); + if (availableExtensions.Count > 0) { - vmAccessExtension = availableExtensions.First(extension => extension.ExtensionName.Equals(VmAccessAgentExtensionName)); - //Deploy a new IaaS VM with Extension using Add-AzureVMExtension + // Deploy a new IaaS VM with Extension using Add-AzureVMExtension var vm = CreateIaaSVMObject(vmName); vmPowershellCmdlets.NewAzureVM(serviceName, new[] { vm }, locationName); @@ -140,19 +148,20 @@ public void UpdateVMWithExtensionTest() vm = vmPowershellCmdlets.SetAzureVMExtension(vm, vmAccessExtension.ExtensionName, vmAccessExtension.Publisher, - vmAccessExtension.Version, + version, referenceName, publicConfiguration, privateConfiguration, "pubkey1", - "prikey1"); + "prikey1", + forceUpdate: true); vmPowershellCmdlets.UpdateAzureVM(vmName, serviceName, vm); var updatedVM = vmPowershellCmdlets.GetAzureVM(vmName, serviceName); var updatedExt = updatedVM.VM.ResourceExtensionReferences.First( e => e.Name == vmAccessExtension.ExtensionName && e.Publisher == vmAccessExtension.Publisher && - e.Version == vmAccessExtension.Version); + e.Version == version); Assert.IsTrue(updatedExt.ResourceExtensionParameterValues.Any(r => r.Type == "Public" && r.Key == "pubkey1")); ValidateVMAccessExtension(vmName, serviceName, true); @@ -182,16 +191,23 @@ public void AddRoleWithExtensionTest() { var availableExtensions = vmPowershellCmdlets.GetAzureVMAvailableExtension(); vmAccessExtension = availableExtensions.First(extension => extension.ExtensionName.Equals(VmAccessAgentExtensionName)); + //Create an deployment - var vm1 = CreateIaaSVMObject(vmName); vmPowershellCmdlets.NewAzureVM(serviceName, new[] { vm1 }, locationName); - //Add a role with extension enabled. + //Add a role with extension enabled. string referenceName = Utilities.GetUniqueShortName(referenceNamePrefix); string vmName2 = Utilities.GetUniqueShortName(vmNamePrefix); var vm2 = CreateIaaSVMObject(vmName2); - vm2 = vmPowershellCmdlets.SetAzureVMExtension(vm2, vmAccessExtension.ExtensionName, vmAccessExtension.Publisher, version, referenceName, publicConfiguration, privateConfiguration, disable: false); + vm2 = vmPowershellCmdlets.SetAzureVMExtension(vm2, + vmAccessExtension.ExtensionName, + vmAccessExtension.Publisher, + version, referenceName, + publicConfiguration, + privateConfiguration, + disable: false, + forceUpdate: true); vmPowershellCmdlets.NewAzureVM(serviceName, new[] { vm2 }); ValidateVMAccessExtension(vmName2, serviceName, true); @@ -221,7 +237,15 @@ public void UpdateRoleWithExtensionTest() vmPowershellCmdlets.NewAzureVM(serviceName, new[] { vm1, vm2 }, locationName); vm2 = GetAzureVM(vmName2, serviceName); - vm2 = vmPowershellCmdlets.SetAzureVMExtension(vm2, vmAccessExtension.ExtensionName, vmAccessExtension.Publisher, vmAccessExtension.Version, referenceName, publicConfiguration, privateConfiguration, disable: false); + vm2 = vmPowershellCmdlets.SetAzureVMExtension(vm2, + vmAccessExtension.ExtensionName, + vmAccessExtension.Publisher, + version, + referenceName, + publicConfiguration, + privateConfiguration, + disable: false, + forceUpdate: true); vmPowershellCmdlets.UpdateAzureVM(vmName2, serviceName, vm2); ValidateVMAccessExtension(vmName2, serviceName, true); @@ -261,20 +285,8 @@ public void ValidateAvailableExtesnion(VirtualMachineExtensionImageContext exten Assert.IsFalse(string.IsNullOrEmpty(extension.Publisher)); Assert.IsFalse(string.IsNullOrEmpty(extension.Version)); - // Intentionally commented as the cmdlet prod cmdlet doesnt have these properties and dogfood returns errors - // now - //Assert.IsTrue(extension.ReplicationCompleted); - //Assert.IsTrue(Utilities.validateHttpUri(extension.PrivacyUri.ToString())); - //Assert.IsTrue(Utilities.validateHttpUri(extension.PrivacyUri.ToString())); - //Assert.IsTrue(Utilities.validateHttpUri(extension.Eula.ToString())); - switch (extension.ExtensionName) { - //case "BGInfo": - // { - // Assert.IsTrue(extension.ReplicationCompleted); - // break; - // } case "DiagnosticsAgent": { Assert.IsFalse(string.IsNullOrEmpty(extension.PublicConfigurationSchema)); @@ -284,7 +296,6 @@ public void ValidateAvailableExtesnion(VirtualMachineExtensionImageContext exten { Assert.IsFalse(string.IsNullOrEmpty(extension.PublicConfigurationSchema)); Assert.IsFalse(string.IsNullOrEmpty(extension.PrivateConfigurationSchema)); - //Assert.IsFalse(string.IsNullOrEmpty(extension.SampleConfig)); break; } } @@ -349,7 +360,13 @@ private void DisableExtension(string vmName, string serviceName) { var vm = GetAzureVM(vmName, serviceName); Console.WriteLine("Disabling the VM Access extesnion for the vm {0}", vmName); - vm = vmPowershellCmdlets.SetAzureVMExtension(vm, vmAccessExtension.ExtensionName, vmAccessExtension.Publisher, version, referenceName, disable: true); + vm = vmPowershellCmdlets.SetAzureVMExtension(vm, + vmAccessExtension.ExtensionName, + vmAccessExtension.Publisher, + version, + referenceName, + disable: true, + forceUpdate: true); vmPowershellCmdlets.UpdateAzureVM(vmName, serviceName, vm); Console.WriteLine("Disabled VM Access extesnion for the vm {0}", vmName); } diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/IaasCmdletInfo/Extesnions/CustomScript/SetAzureVMCustomScriptExtensionCmdletInfo.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/IaasCmdletInfo/Extesnions/CustomScript/SetAzureVMCustomScriptExtensionCmdletInfo.cs index 439209a90182..af52ed0e792e 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/IaasCmdletInfo/Extesnions/CustomScript/SetAzureVMCustomScriptExtensionCmdletInfo.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/IaasCmdletInfo/Extesnions/CustomScript/SetAzureVMCustomScriptExtensionCmdletInfo.cs @@ -20,7 +20,7 @@ namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Test.FunctionalTests public class SetAzureVMCustomScriptExtensionCmdletInfo:CmdletsInfo { - private SetAzureVMCustomScriptExtensionCmdletInfo(PersistentVM vm, string referenceName, string version) + private SetAzureVMCustomScriptExtensionCmdletInfo(PersistentVM vm, string referenceName, string version, bool forceUpdate) { cmdletName = Utilities.SetAzureVMCustomScriptExtensionCmdletName; cmdletParams.Add(new CmdletParam("VM", vm)); @@ -32,10 +32,14 @@ private SetAzureVMCustomScriptExtensionCmdletInfo(PersistentVM vm, string refere { cmdletParams.Add(new CmdletParam("ReferenceName", referenceName)); } + if (forceUpdate) + { + cmdletParams.Add(new CmdletParam("ForceUpdate")); + } } - private SetAzureVMCustomScriptExtensionCmdletInfo(PersistentVM vm, string run, string argument, string referenceName, string version) - :this(vm, referenceName, version) + private SetAzureVMCustomScriptExtensionCmdletInfo(PersistentVM vm, string run, string argument, string referenceName, string version, bool forceUpdate) + : this(vm, referenceName, version, forceUpdate) { if (!string.IsNullOrEmpty(run)) { @@ -47,9 +51,9 @@ private SetAzureVMCustomScriptExtensionCmdletInfo(PersistentVM vm, string run, s } } - //SetCustomScriptExtensionByUrisParamSetName - public SetAzureVMCustomScriptExtensionCmdletInfo(PersistentVM vm, string referenceName, string version, string[] fileUri, string run, string argument) - :this(vm,run,argument,referenceName,version) + // SetCustomScriptExtensionByUrisParamSetName + public SetAzureVMCustomScriptExtensionCmdletInfo(PersistentVM vm, string referenceName, string version, string[] fileUri, string run, string argument, bool forceUpdate) + :this(vm, run, argument, referenceName, version, forceUpdate) { if (fileUri != null) { @@ -57,9 +61,9 @@ public SetAzureVMCustomScriptExtensionCmdletInfo(PersistentVM vm, string referen } } - //DisableCustomScriptExtensionParamSetName - public SetAzureVMCustomScriptExtensionCmdletInfo(PersistentVM vm, string referenceName, string version, bool disable) - : this(vm, referenceName, version) + // DisableCustomScriptExtensionParamSetName + public SetAzureVMCustomScriptExtensionCmdletInfo(PersistentVM vm, string referenceName, string version, bool disable, bool forceUpdate) + : this(vm, referenceName, version, forceUpdate) { if (disable) { @@ -67,10 +71,10 @@ public SetAzureVMCustomScriptExtensionCmdletInfo(PersistentVM vm, string referen } } - //SetCustomScriptExtensionByContainerBlobsParamSetName + // SetCustomScriptExtensionByContainerBlobsParamSetName public SetAzureVMCustomScriptExtensionCmdletInfo(PersistentVM vm, string[] fileName, string storageAccountName, string storageEndpointSuffix, string containerName, - string storageAccountKey, string run, string argument, string referenceName, string version) - : this(vm, run, argument, referenceName, version) + string storageAccountKey, string run, string argument, string referenceName, string version, bool forceUpdate) + : this(vm, run, argument, referenceName, version, forceUpdate) { if (fileName.Length > 0) { diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/IaasCmdletInfo/Extesnions/VMAccess/SetAzureVMAccessExtensionCmdletInfo.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/IaasCmdletInfo/Extesnions/VMAccess/SetAzureVMAccessExtensionCmdletInfo.cs index 4ebcfc8bd6cc..bc5853a4d763 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/IaasCmdletInfo/Extesnions/VMAccess/SetAzureVMAccessExtensionCmdletInfo.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/IaasCmdletInfo/Extesnions/VMAccess/SetAzureVMAccessExtensionCmdletInfo.cs @@ -20,7 +20,14 @@ namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Test.FunctionalTests { public class SetAzureVMAccessExtensionCmdletInfo:CmdletsInfo { - public SetAzureVMAccessExtensionCmdletInfo(IPersistentVM vm, string userName, string password, string version, string referenceName,bool disable) + public SetAzureVMAccessExtensionCmdletInfo( + IPersistentVM vm, + string userName, + string password, + string version, + string referenceName, + bool disable, + bool forceUpdate) { this.cmdletName = Utilities.SetAzureVMAccessExtensionCmdletName; cmdletParams.Add(new CmdletParam("VM", vm)); @@ -42,7 +49,11 @@ public SetAzureVMAccessExtensionCmdletInfo(IPersistentVM vm, string userName, st } if (disable) { - cmdletParams.Add(new CmdletParam("Disable", disable)); + cmdletParams.Add(new CmdletParam("Disable")); + } + if (forceUpdate) + { + cmdletParams.Add(new CmdletParam("ForceUpdate")); } } } diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/IaasCmdletInfo/Generic/SetAzureVMExtensionCmdletInfo.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/IaasCmdletInfo/Generic/SetAzureVMExtensionCmdletInfo.cs index 611fa38ff6b9..588f5609446e 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/IaasCmdletInfo/Generic/SetAzureVMExtensionCmdletInfo.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/IaasCmdletInfo/Generic/SetAzureVMExtensionCmdletInfo.cs @@ -21,7 +21,7 @@ public class SetAzureVMExtensionCmdletInfo: CmdletsInfo { public SetAzureVMExtensionCmdletInfo(IPersistentVM vm, string extensionName, string publisher, string version, string referenceName = null, string publicConfiguration = null, string privateConfiguration = null, string publicConfigKey = null, string privateConfigKey = null, - string publicConfigPath = null,string privateConfigPath = null, bool disable = false) + string publicConfigPath = null,string privateConfigPath = null, bool disable = false, bool forceUpdate = false) { cmdletName = Utilities.SetAzureVMExtensionCmdletName; cmdletParams.Add(new CmdletParam("VM", vm)); @@ -61,6 +61,10 @@ public SetAzureVMExtensionCmdletInfo(IPersistentVM vm, string extensionName, str { cmdletParams.Add(new CmdletParam("PrivateConfigKey", privateConfigKey)); } + if (forceUpdate) + { + cmdletParams.Add(new CmdletParam("ForceUpdate")); + } } } } diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementCmdletTestHelper.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementCmdletTestHelper.cs index d5bb969f147f..b30103fa4517 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementCmdletTestHelper.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementCmdletTestHelper.cs @@ -1956,16 +1956,30 @@ public SM.PersistentVM RemoveAzureVMBGInfoExtension(SM.IPersistentVM vm, string #endregion AzureVM BGInfo Extension #region Generic VM Extension cmdlets - public SM.PersistentVM SetAzureVMExtension(SM.IPersistentVM vm, string extensionName, string publisher, string version, string referenceName = null, - string publicConfiguration = null, string privateConfiguration = null, string publicConfigKey = null, string privateConfigKey = null, string publicConfigPath = null, string privateConfigPath = null, bool disable = false) + public SM.PersistentVM SetAzureVMExtension(SM.IPersistentVM vm, + string extensionName, string publisher, + string version, string referenceName = null, + string publicConfiguration = null, string privateConfiguration = null, + string publicConfigKey = null, string privateConfigKey = null, + string publicConfigPath = null, string privateConfigPath = null, + bool disable = false, bool forceUpdate = false) { - return RunPSCmdletAndReturnFirst(new SetAzureVMExtensionCmdletInfo(vm, extensionName, publisher, version, referenceName, - publicConfiguration, privateConfiguration, publicConfigKey, privateConfigKey, publicConfigPath, privateConfigPath, disable)); + return RunPSCmdletAndReturnFirst(new SetAzureVMExtensionCmdletInfo(vm, + extensionName, publisher, + version, referenceName, + publicConfiguration, privateConfiguration, + publicConfigKey, privateConfigKey, + publicConfigPath, privateConfigPath, + disable, forceUpdate)); } - public SM.PersistentVM RemoveAzureVMExtension(SM.PersistentVM vm, string extensionName, string publisher, string referenceName=null, bool removeAll=false) + public SM.PersistentVM RemoveAzureVMExtension(SM.PersistentVM vm, + string extensionName, string publisher, + string referenceName = null, bool removeAll = false) { - return RunPSCmdletAndReturnFirst(new RemoveAzureVMExtensionCmdletInfo(vm, extensionName, publisher, referenceName, removeAll)); + return RunPSCmdletAndReturnFirst(new RemoveAzureVMExtensionCmdletInfo(vm, + extensionName, publisher, + referenceName, removeAll)); } public Collection GetAzureVMExtension(SM.PersistentVM vm, string extensionName = null, string publisher = null, string version = null, string referenceName = null) @@ -1973,7 +1987,7 @@ public Collection GetAzureVMExtension(SM.Persist return RunPSCmdletAndReturnAll(new GetAzureVMExtensionCmdletInfo(vm, extensionName, publisher, version, referenceName)); } - //ListAllVersionsParamSetName -> ExtensionName,Publisher,AllVersions + // ListAllVersionsParamSetName -> ExtensionName,Publisher,AllVersions public Collection GetAzureVMAvailableExtension(string extensionName, string publisher, bool allVersions) { return RunPSCmdletAndReturnAll(new GetAzureVMAvailableExtensionCmdletInfo(extensionName, publisher, allVersions)); @@ -1999,9 +2013,17 @@ public Collection GetAzureVMAccessExtensio return RunPSCmdletAndReturnAll(new GetAzureVMAccessExtensionCmdletInfo(vm, userName, password, version, referenceName)); } - public SM.PersistentVM SetAzureVMAccessExtension(SM.IPersistentVM vm, string userName= null, string password=null, string version = null, string referenceName =null,bool disable = false) + public SM.PersistentVM SetAzureVMAccessExtension( + SM.IPersistentVM vm, + string userName= null, + string password=null, + string version = null, + string referenceName =null, + bool disable = false, + bool forceUpdate = false) { - return RunPSCmdletAndReturnFirst(new SetAzureVMAccessExtensionCmdletInfo( vm, userName, password, version, referenceName, disable)); + return RunPSCmdletAndReturnFirst(new SetAzureVMAccessExtensionCmdletInfo( + vm, userName, password, version, referenceName, disable, forceUpdate)); } public SM.PersistentVM RemoveAzureVMAccessExtension(SM.IPersistentVM vm) @@ -2012,24 +2034,50 @@ public SM.PersistentVM RemoveAzureVMAccessExtension(SM.IPersistentVM vm) #endregion AzureVMAccessExtension cmdlets #region AzureVMCustomScriptExtensionCmdlets - //SetCustomScriptExtensionByUrisParamSetName - internal SM.PersistentVM SetAzureVMCustomScriptExtension(SM.PersistentVM vm, string[] fileUri, bool sseSaSKeys, string run = null, string referenceName = null, string version = null, string argument = null) - { - return RunPSCmdletAndReturnFirst(new SetAzureVMCustomScriptExtensionCmdletInfo(vm, referenceName, version,fileUri,run, argument )); - } - - //DisableCustomScriptExtensionParamSetName - internal SM.PersistentVM SetAzureVMCustomScriptExtension(SM.PersistentVM vm, bool disable, string referenceName = null, string version = null) - { - return RunPSCmdletAndReturnFirst(new SetAzureVMCustomScriptExtensionCmdletInfo(vm,referenceName,version,disable)); - } - - //SetCustomScriptExtensionByContainerBlobsParamSetName - internal SM.PersistentVM SetAzureVMCustomScriptExtension(SM.PersistentVM vm, string[] fileName, string run = null, string storageAccountName = null, string StorageEndpointSuffix = null, string containerName = null, - string StorageAccountKey = null, string referenceName = null, string version = null,string argument = null) - { - return RunPSCmdletAndReturnFirst(new SetAzureVMCustomScriptExtensionCmdletInfo(vm, fileName, storageAccountName, StorageEndpointSuffix, containerName, - StorageAccountKey, run, argument,referenceName, version)); + // SetCustomScriptExtensionByUrisParamSetName + internal SM.PersistentVM SetAzureVMCustomScriptExtension( + SM.PersistentVM vm, + string[] fileUri, + bool sseSaSKeys, + string run = null, + string referenceName = null, + string version = null, + string argument = null, + bool forceUpdate = false) + { + return RunPSCmdletAndReturnFirst(new SetAzureVMCustomScriptExtensionCmdletInfo( + vm, referenceName, version, fileUri, run, argument, forceUpdate)); + } + + // DisableCustomScriptExtensionParamSetName + internal SM.PersistentVM SetAzureVMCustomScriptExtension( + SM.PersistentVM vm, + bool disable, + string referenceName = null, + string version = null, + bool forceUpdate = false) + { + return RunPSCmdletAndReturnFirst(new SetAzureVMCustomScriptExtensionCmdletInfo( + vm, referenceName, version, disable, forceUpdate)); + } + + // SetCustomScriptExtensionByContainerBlobsParamSetName + internal SM.PersistentVM SetAzureVMCustomScriptExtension( + SM.PersistentVM vm, + string[] fileName, + string run = null, + string storageAccountName = null, + string StorageEndpointSuffix = null, + string containerName = null, + string StorageAccountKey = null, + string referenceName = null, + string version = null, + string argument = null, + bool forceUpdate = false) + { + return RunPSCmdletAndReturnFirst(new SetAzureVMCustomScriptExtensionCmdletInfo( + vm, fileName, storageAccountName, StorageEndpointSuffix, containerName, + StorageAccountKey, run, argument, referenceName, version, forceUpdate)); } internal VirtualMachineCustomScriptExtensionContext GetAzureVMCustomScriptExtension(SM.IPersistentVM vm) diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/Resources/PrivateConfig.json b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/Resources/PrivateConfig.json new file mode 100644 index 000000000000..e3ef7a99e08d --- /dev/null +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/Resources/PrivateConfig.json @@ -0,0 +1,3 @@ +{ + "PrivateConfig": { "Password": "p@ssw0rd" } +} \ No newline at end of file diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/Resources/PublicConfig.json b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/Resources/PublicConfig.json new file mode 100644 index 000000000000..ddf751356fa0 --- /dev/null +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/Resources/PublicConfig.json @@ -0,0 +1,3 @@ +{ + "PublicConfig": { "UserName": "dileep" } +} \ No newline at end of file diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/packages.config b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/packages.config index 920cfaa438d7..59760fd0a5e7 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/packages.config +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement.Test/packages.config @@ -1,8 +1,8 @@  - - + + @@ -16,7 +16,7 @@ - + diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/Commands.ServiceManagement.csproj b/src/ServiceManagement/Compute/Commands.ServiceManagement/Commands.ServiceManagement.csproj index 7ec538ea5623..a3caf7f8487c 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement/Commands.ServiceManagement.csproj +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/Commands.ServiceManagement.csproj @@ -62,17 +62,17 @@ ..\..\..\packages\AutoMapper.3.1.1\lib\net40\AutoMapper.Net4.dll - ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll + ..\..\..\packages\Hyak.Common.1.0.2\lib\net45\Hyak.Common.dll - ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll + ..\..\..\packages\Microsoft.Azure.Common.2.0.3\lib\net45\Microsoft.Azure.Common.dll False ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll - ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.Azure.Common.2.0.3\lib\net45\Microsoft.Azure.Common.NetFramework.dll False @@ -114,7 +114,7 @@ ..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.1\lib\net40\Microsoft.WindowsAzure.Management.dll - ..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.9.0.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll + ..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.9.2.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll False diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/Common/SetAzureVMExtension.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/Common/SetAzureVMExtension.cs index bed707a519b4..9c2689c9fde8 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/Common/SetAzureVMExtension.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/Common/SetAzureVMExtension.cs @@ -240,6 +240,12 @@ public class SetAzureVMExtensionCommand : VirtualMachineExtensionCmdletBase HelpMessage = "The Private Configuration's Reference Key.")] public override string PrivateConfigKey { get; set; } + [Parameter( + Mandatory = false, + Position = 11, + HelpMessage = "Re-apply a configuration to an extension when the configuration has not been updated.")] + public override SwitchParameter ForceUpdate { get; set; } + internal void ExecuteCommand() { ValidateParameters(); diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/Common/VirtualMachineExtensionCmdletBase.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/Common/VirtualMachineExtensionCmdletBase.cs index 1b139bd0242f..89d460b954a2 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/Common/VirtualMachineExtensionCmdletBase.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/Common/VirtualMachineExtensionCmdletBase.cs @@ -79,6 +79,7 @@ public virtual string Publisher public virtual string PrivateConfigPath { get; set; } public virtual SwitchParameter Disable { get; set; } public virtual SwitchParameter Uninstall { get; set; } + public virtual SwitchParameter ForceUpdate { get; set; } static VirtualMachineExtensionCmdletBase() { @@ -243,6 +244,11 @@ protected ResourceExtensionReference NewResourceExtension() }); } + if (this.ForceUpdate.IsPresent) + { + extensionRef.ForceUpdate = true; + } + return extensionRef; } diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/Common/VirtualMachineExtensionImageContext.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/Common/VirtualMachineExtensionImageContext.cs index 1e24cf3c20c5..79b2c16dd798 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/Common/VirtualMachineExtensionImageContext.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/Common/VirtualMachineExtensionImageContext.cs @@ -37,5 +37,6 @@ public class VirtualMachineExtensionImageContext : ManagementOperationContext public string SupportedOS { get; set; } public DateTime? PublishedDate { get; set; } public string CompanyName { get; set; } + public string Regions { get; set; } } } diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/CustomScript/SetAzureVMCustomScriptExtension.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/CustomScript/SetAzureVMCustomScriptExtension.cs index c39ca7ba484b..dfc9dc655840 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/CustomScript/SetAzureVMCustomScriptExtension.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/CustomScript/SetAzureVMCustomScriptExtension.cs @@ -158,6 +158,12 @@ public class SetAzureVMCustomScriptExtensionCommand : VirtualMachineCustomScript [ValidateNotNullOrEmpty] public override string Argument { get; set; } + [Parameter( + Mandatory = false, + Position = 9, + HelpMessage = "Re-apply a configuration to an extension when the configuration has not been updated.")] + public override SwitchParameter ForceUpdate { get; set; } + protected override void ProcessRecord() { base.ProcessRecord(); diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/VMAccess/SetAzureVMAccessExtension.cs b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/VMAccess/SetAzureVMAccessExtension.cs index c34fa787d355..a61c14765c7d 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/VMAccess/SetAzureVMAccessExtension.cs +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/VMAccess/SetAzureVMAccessExtension.cs @@ -97,6 +97,12 @@ public class SetAzureVMAccessExtensionCommand : VirtualMachineAccessExtensionCmd [ValidateNotNullOrEmpty] public override string Version { get; set; } + [Parameter( + Mandatory = false, + Position = 5, + HelpMessage = "Re-apply a configuration to an extension when the configuration has not been updated.")] + public override SwitchParameter ForceUpdate { get; set; } + internal void ExecuteCommand() { ValidateParameters(); diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/Microsoft.WindowsAzure.Commands.ServiceManagement.dll-Help.xml b/src/ServiceManagement/Compute/Commands.ServiceManagement/Microsoft.WindowsAzure.Commands.ServiceManagement.dll-Help.xml index 409f7107d0b0..2a0724566733 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement/Microsoft.WindowsAzure.Commands.ServiceManagement.dll-Help.xml +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/Microsoft.WindowsAzure.Commands.ServiceManagement.dll-Help.xml @@ -27141,6 +27141,12 @@ PS C:\> Set-AzureServiceAntimalwareExtension -ServiceName "ContosoServic String + + ForceUpdate + + Re-apply a configuration to an extension when the configuration has not been updated. + + VM @@ -27174,6 +27180,12 @@ PS C:\> Set-AzureServiceAntimalwareExtension -ServiceName "ContosoServic String + + ForceUpdate + + Re-apply a configuration to an extension when the configuration has not been updated. + + VM @@ -27207,6 +27219,12 @@ PS C:\> Set-AzureServiceAntimalwareExtension -ServiceName "ContosoServic String + + ForceUpdate + + Re-apply a configuration to an extension when the configuration has not been updated. + + VM @@ -27303,6 +27321,18 @@ PS C:\> Set-AzureServiceAntimalwareExtension -ServiceName "ContosoServic + + ForceUpdate + + Re-apply a configuration to an extension when the configuration has not been updated. + + SwitchParameter + + SwitchParameter + + + + PipelineVariable @@ -27678,6 +27708,12 @@ PS C:\> Set-AzureServiceAntimalwareExtension -ServiceName "ContosoServic String + + ForceUpdate + + Re-apply a configuration to an extension when the configuration has not been updated. + + VM @@ -27711,6 +27747,12 @@ PS C:\> Set-AzureServiceAntimalwareExtension -ServiceName "ContosoServic SwitchParameter + + ForceUpdate + + Re-apply a configuration to an extension when the configuration has not been updated. + + VM @@ -27744,6 +27786,12 @@ PS C:\> Set-AzureServiceAntimalwareExtension -ServiceName "ContosoServic SwitchParameter + + ForceUpdate + + Re-apply a configuration to an extension when the configuration has not been updated. + + VM @@ -27791,6 +27839,12 @@ PS C:\> Set-AzureServiceAntimalwareExtension -ServiceName "ContosoServic String + + ForceUpdate + + Re-apply a configuration to an extension when the configuration has not been updated. + + VM @@ -27959,6 +28013,18 @@ PS C:\> Set-AzureServiceAntimalwareExtension -ServiceName "ContosoServic + + ForceUpdate + + Re-apply a configuration to an extension when the configuration has not been updated. + + SwitchParameter + + SwitchParameter + + + + PipelineVariable @@ -28752,6 +28818,12 @@ OperationStatus : OK SwitchParameter + + ForceUpdate + + Re-apply a configuration to an extension when the configuration has not been updated. + + VM @@ -28820,6 +28892,12 @@ OperationStatus : OK SwitchParameter + + ForceUpdate + + Re-apply a configuration to an extension when the configuration has not been updated. + + VM @@ -28867,6 +28945,12 @@ OperationStatus : OK SwitchParameter + + ForceUpdate + + Re-apply a configuration to an extension when the configuration has not been updated. + + VM @@ -28914,6 +28998,12 @@ OperationStatus : OK SwitchParameter + + ForceUpdate + + Re-apply a configuration to an extension when the configuration has not been updated. + + VM @@ -29058,6 +29148,18 @@ OperationStatus : OK + + ForceUpdate + + Re-apply a configuration to an extension when the configuration has not been updated. + + SwitchParameter + + SwitchParameter + + + + PipelineVariable diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/Microsoft.WindowsAzure.Commands.ServiceManagement.format.ps1xml b/src/ServiceManagement/Compute/Commands.ServiceManagement/Microsoft.WindowsAzure.Commands.ServiceManagement.format.ps1xml index 677a5117b11d..c73f3a41f75a 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement/Microsoft.WindowsAzure.Commands.ServiceManagement.format.ps1xml +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/Microsoft.WindowsAzure.Commands.ServiceManagement.format.ps1xml @@ -129,10 +129,30 @@ PublishedDate - + CompanyName + + + + if ($_.Regions -ne $null) + { + if ($_.Regions.Length -gt 0) + { + $_.Regions; + } + else + { + 'All regions'; + } + } + else + { + $_.Regions; + } + + diff --git a/src/ServiceManagement/Compute/Commands.ServiceManagement/packages.config b/src/ServiceManagement/Compute/Commands.ServiceManagement/packages.config index 52c05c11e685..25de44bff656 100644 --- a/src/ServiceManagement/Compute/Commands.ServiceManagement/packages.config +++ b/src/ServiceManagement/Compute/Commands.ServiceManagement/packages.config @@ -1,8 +1,8 @@  - - + + @@ -16,7 +16,7 @@ - + diff --git a/src/ServiceManagement/Services/Commands.Test.Utilities/Commands.Test.Utilities.csproj b/src/ServiceManagement/Services/Commands.Test.Utilities/Commands.Test.Utilities.csproj index 4ffe069a3a48..51ba17200a9d 100644 --- a/src/ServiceManagement/Services/Commands.Test.Utilities/Commands.Test.Utilities.csproj +++ b/src/ServiceManagement/Services/Commands.Test.Utilities/Commands.Test.Utilities.csproj @@ -43,17 +43,17 @@ - ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll + ..\..\..\packages\Hyak.Common.1.0.2\lib\net45\Hyak.Common.dll - ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll + ..\..\..\packages\Microsoft.Azure.Common.2.0.3\lib\net45\Microsoft.Azure.Common.dll False ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll - ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.Azure.Common.2.0.3\lib\net45\Microsoft.Azure.Common.NetFramework.dll ..\..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll @@ -82,9 +82,8 @@ False ..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.1\lib\net40\Microsoft.WindowsAzure.Management.dll - - False - ..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.9.0.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll + + ..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.9.2.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll ..\..\..\packages\Microsoft.WindowsAzure.Management.Storage.5.0.0\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll diff --git a/src/ServiceManagement/Services/Commands.Test.Utilities/packages.config b/src/ServiceManagement/Services/Commands.Test.Utilities/packages.config index 81fd92f2687b..3648b82f1d69 100644 --- a/src/ServiceManagement/Services/Commands.Test.Utilities/packages.config +++ b/src/ServiceManagement/Services/Commands.Test.Utilities/packages.config @@ -1,7 +1,7 @@  - - + + @@ -11,7 +11,7 @@ - + diff --git a/src/ServiceManagement/Services/Commands.Test/Commands.Test.csproj b/src/ServiceManagement/Services/Commands.Test/Commands.Test.csproj index 5b25ca7f8afd..1f23db236728 100644 --- a/src/ServiceManagement/Services/Commands.Test/Commands.Test.csproj +++ b/src/ServiceManagement/Services/Commands.Test/Commands.Test.csproj @@ -48,17 +48,17 @@ - ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll + ..\..\..\packages\Hyak.Common.1.0.2\lib\net45\Hyak.Common.dll - ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll + ..\..\..\packages\Microsoft.Azure.Common.2.0.3\lib\net45\Microsoft.Azure.Common.dll False ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll - ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.Azure.Common.2.0.3\lib\net45\Microsoft.Azure.Common.NetFramework.dll ..\..\..\packages\Microsoft.Azure.Management.Resources.2.12.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll @@ -106,9 +106,8 @@ False ..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.1\lib\net40\Microsoft.WindowsAzure.Management.dll - - False - ..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.9.0.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll + + ..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.9.2.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll ..\..\..\packages\Microsoft.WindowsAzure.Management.ExpressRoute.0.18.0-preview\lib\net40\Microsoft.WindowsAzure.Management.ExpressRoute.dll diff --git a/src/ServiceManagement/Services/Commands.Test/packages.config b/src/ServiceManagement/Services/Commands.Test/packages.config index 8202f9e7214a..55b67e568fa7 100644 --- a/src/ServiceManagement/Services/Commands.Test/packages.config +++ b/src/ServiceManagement/Services/Commands.Test/packages.config @@ -1,7 +1,7 @@  - - + + @@ -15,7 +15,7 @@ - + diff --git a/src/ServiceManagement/Services/Commands.Utilities/Commands.Utilities.csproj b/src/ServiceManagement/Services/Commands.Utilities/Commands.Utilities.csproj index 3143af5c2ec6..54d7a9b714b8 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/Commands.Utilities.csproj +++ b/src/ServiceManagement/Services/Commands.Utilities/Commands.Utilities.csproj @@ -57,17 +57,17 @@ ..\..\..\packages\AutoMapper.3.1.1\lib\net40\AutoMapper.Net4.dll - ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll + ..\..\..\packages\Hyak.Common.1.0.2\lib\net45\Hyak.Common.dll - ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll + ..\..\..\packages\Microsoft.Azure.Common.2.0.3\lib\net45\Microsoft.Azure.Common.dll False ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll - ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.Azure.Common.2.0.3\lib\net45\Microsoft.Azure.Common.NetFramework.dll False @@ -118,9 +118,8 @@ False ..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.1\lib\net40\Microsoft.WindowsAzure.Management.dll - - False - ..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.9.0.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll + + ..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.9.2.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll False diff --git a/src/ServiceManagement/Services/Commands.Utilities/packages.config b/src/ServiceManagement/Services/Commands.Utilities/packages.config index 728874e25f3a..25c912fcec4c 100644 --- a/src/ServiceManagement/Services/Commands.Utilities/packages.config +++ b/src/ServiceManagement/Services/Commands.Utilities/packages.config @@ -1,8 +1,8 @@  - - + + @@ -16,7 +16,7 @@ - + diff --git a/src/ServiceManagement/Services/Commands/Commands.csproj b/src/ServiceManagement/Services/Commands/Commands.csproj index b745dd31d91c..4893df21d970 100644 --- a/src/ServiceManagement/Services/Commands/Commands.csproj +++ b/src/ServiceManagement/Services/Commands/Commands.csproj @@ -55,17 +55,17 @@ ..\..\..\packages\AutoMapper.3.1.1\lib\net40\AutoMapper.dll - ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll + ..\..\..\packages\Hyak.Common.1.0.2\lib\net45\Hyak.Common.dll - ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.dll + ..\..\..\packages\Microsoft.Azure.Common.2.0.3\lib\net45\Microsoft.Azure.Common.dll False ..\..\..\packages\Microsoft.Azure.Common.Extensions.0.14.0-preview\lib\net45\Microsoft.Azure.Common.Extensions.dll - ..\..\..\packages\Microsoft.Azure.Common.2.0.1\lib\net45\Microsoft.Azure.Common.NetFramework.dll + ..\..\..\packages\Microsoft.Azure.Common.2.0.3\lib\net45\Microsoft.Azure.Common.NetFramework.dll False @@ -116,9 +116,8 @@ False ..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.1\lib\net40\Microsoft.WindowsAzure.Management.dll - - False - ..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.9.0.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll + + ..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.9.2.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll False diff --git a/src/ServiceManagement/Services/Commands/packages.config b/src/ServiceManagement/Services/Commands/packages.config index 90675ca4f136..f1ae3dff898b 100644 --- a/src/ServiceManagement/Services/Commands/packages.config +++ b/src/ServiceManagement/Services/Commands/packages.config @@ -1,7 +1,7 @@  - - + + @@ -15,7 +15,7 @@ - +