Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set-AzVMSqlServerExtension changes of default extension version and autoupgrademinorversion #20506

Merged
merged 1 commit into from
Dec 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ public void TestSqlIaaSAKVExtension()

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestSqlIaaSExtensionWith2016Image()
public void TestSqlIaaSExtensionWith2017Image()
{
TestRunner.RunTestScript("Test-SetAzureRmVMSqlServerExtensionWith2016Image");
TestRunner.RunTestScript("Test-SetAzureRmVMSqlServerExtensionWith2017Image");
}
}
}
144 changes: 80 additions & 64 deletions src/Compute/Compute.Test/ScenarioTests/SqlIaaSExtensionTests.ps1

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

This file was deleted.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public class SetAzureSqlServerExtensionCommand : VirtualMachineExtensionBaseCmdl
public override void ExecuteCmdlet()
{
base.ExecuteCmdlet();

bool autoUpgradeMinorVersion = true;

VirtualMachine vm = ComputeClient.ComputeManagementClient.VirtualMachines.Get(this.ResourceGroupName, this.VMName);
if (vm != null && vm.Resources != null)
Expand All @@ -113,6 +113,7 @@ public override void ExecuteCmdlet()
{
this.Name = extension.Name;
this.Version = extension.TypeHandlerVersion;
autoUpgradeMinorVersion = extension.AutoUpgradeMinorVersion ?? autoUpgradeMinorVersion;
}

this.Location = vm.Location;
Expand All @@ -124,6 +125,7 @@ public override void ExecuteCmdlet()
Publisher = VirtualMachineSqlServerExtensionContext.ExtensionPublishedNamespace,
VirtualMachineExtensionType = VirtualMachineSqlServerExtensionContext.ExtensionPublishedType,
TypeHandlerVersion = string.IsNullOrEmpty(this.Version) ? VirtualMachineSqlServerExtensionContext.ExtensionDefaultVersion : this.Version,
AutoUpgradeMinorVersion = autoUpgradeMinorVersion,
Settings = this.GetPublicConfiguration(),
ProtectedSettings = this.GetPrivateConfiguration(),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class VirtualMachineSqlServerExtensionContext : PSVirtualMachineExtension
/// <summary>
/// SQLVM Extension's default version
/// </summary>
public const string ExtensionDefaultVersion = "1.2";
public const string ExtensionDefaultVersion = "2.0";

/// <summary>
/// Auto-patching settings
Expand Down