Skip to content

Commit 48c591e

Browse files
authored
Upgrading extension commands (#20506)
1 parent 08c9663 commit 48c591e

File tree

8 files changed

+12944
-9284
lines changed

8 files changed

+12944
-9284
lines changed

src/Compute/Compute.Test/ScenarioTests/SqlIaaSExtensionTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ public void TestSqlIaaSAKVExtension()
4040

4141
[Fact]
4242
[Trait(Category.AcceptanceType, Category.CheckIn)]
43-
public void TestSqlIaaSExtensionWith2016Image()
43+
public void TestSqlIaaSExtensionWith2017Image()
4444
{
45-
TestRunner.RunTestScript("Test-SetAzureRmVMSqlServerExtensionWith2016Image");
45+
TestRunner.RunTestScript("Test-SetAzureRmVMSqlServerExtensionWith2017Image");
4646
}
4747
}
4848
}

src/Compute/Compute.Test/ScenarioTests/SqlIaaSExtensionTests.ps1

Lines changed: 80 additions & 64 deletions
Large diffs are not rendered by default.

src/Compute/Compute.Test/SessionRecords/Microsoft.Azure.Commands.Compute.Test.ScenarioTests.SqlIaaSExtensionTests/TestSqlIaaSAKVExtension.json

Lines changed: 3642 additions & 1933 deletions
Large diffs are not rendered by default.

src/Compute/Compute.Test/SessionRecords/Microsoft.Azure.Commands.Compute.Test.ScenarioTests.SqlIaaSExtensionTests/TestSqlIaaSExtension.json

Lines changed: 2781 additions & 2564 deletions
Large diffs are not rendered by default.

src/Compute/Compute.Test/SessionRecords/Microsoft.Azure.Commands.Compute.Test.ScenarioTests.SqlIaaSExtensionTests/TestSqlIaaSExtensionWith2016Image.json

Lines changed: 0 additions & 4719 deletions
This file was deleted.

src/Compute/Compute.Test/SessionRecords/Microsoft.Azure.Commands.Compute.Test.ScenarioTests.SqlIaaSExtensionTests/TestSqlIaaSExtensionWith2017Image.json

Lines changed: 6435 additions & 0 deletions
Large diffs are not rendered by default.

src/Compute/Compute/Extension/SqlServer/SetAzureVMSqlServerExtensionCommand.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public class SetAzureSqlServerExtensionCommand : VirtualMachineExtensionBaseCmdl
103103
public override void ExecuteCmdlet()
104104
{
105105
base.ExecuteCmdlet();
106-
106+
bool autoUpgradeMinorVersion = true;
107107

108108
VirtualMachine vm = ComputeClient.ComputeManagementClient.VirtualMachines.Get(this.ResourceGroupName, this.VMName);
109109
if (vm != null && vm.Resources != null)
@@ -113,6 +113,7 @@ public override void ExecuteCmdlet()
113113
{
114114
this.Name = extension.Name;
115115
this.Version = extension.TypeHandlerVersion;
116+
autoUpgradeMinorVersion = extension.AutoUpgradeMinorVersion ?? autoUpgradeMinorVersion;
116117
}
117118

118119
this.Location = vm.Location;
@@ -124,6 +125,7 @@ public override void ExecuteCmdlet()
124125
Publisher = VirtualMachineSqlServerExtensionContext.ExtensionPublishedNamespace,
125126
VirtualMachineExtensionType = VirtualMachineSqlServerExtensionContext.ExtensionPublishedType,
126127
TypeHandlerVersion = string.IsNullOrEmpty(this.Version) ? VirtualMachineSqlServerExtensionContext.ExtensionDefaultVersion : this.Version,
128+
AutoUpgradeMinorVersion = autoUpgradeMinorVersion,
127129
Settings = this.GetPublicConfiguration(),
128130
ProtectedSettings = this.GetPrivateConfiguration(),
129131
};

src/Compute/Compute/Extension/SqlServer/VirtualMachineSqlServerExtensionContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class VirtualMachineSqlServerExtensionContext : PSVirtualMachineExtension
3939
/// <summary>
4040
/// SQLVM Extension's default version
4141
/// </summary>
42-
public const string ExtensionDefaultVersion = "1.2";
42+
public const string ExtensionDefaultVersion = "2.0";
4343

4444
/// <summary>
4545
/// Auto-patching settings

0 commit comments

Comments
 (0)