Add host level script to disable ESU,. Automatic Updates, and BPA#1363
Add host level script to disable ESU,. Automatic Updates, and BPA#1363uc-msft merged 4 commits intomicrosoft:masterfrom
Conversation
| @@ -0,0 +1,128 @@ | |||
| $subscriptionId = "" | |||
There was a problem hiding this comment.
@charmainewkchan should script be parameterized, as individual value checks are present already on top of script.
something like :
param (
[string]$subscriptionId,
[string]$resourceGroupName,
[bool]$whatIf = $false
)
There was a problem hiding this comment.
and RGName could be Parameter(Mandatory=$false) too..
|
|
||
| $query = @" | ||
| Resources | ||
| | where type == 'microsoft.azurearcdata/sqlserverinstances' |
There was a problem hiding this comment.
I think this ARG query initially i added to find SqlInstances, and from the instances, basically get the HybridComputeResource Id but at that time it was supposed to be a single script for both instance level and host level settings change.
Now since it is only host level, can it be changed to query just hybrid compute machine ( from Sasha's script)
@charmainewkchan https://github.com/microsoft/sql-server-samples/blob/master/samples/manage/azure-arc-enabled-sql-server/modify-license-type/modify-license-type.ps1#177
There was a problem hiding this comment.
I left it like this so we only change machines with SQL Server Instances, because we don't have to patch if they don't have our extension.
This script will prompt for the subscription ID and resource group where the user would like to disable ESU, Automatic Updates, and BPA on the Compute Machine - Azure Arc. This script will check for SQL Server Instances in this resource group and run through all the host machines of those instances. It will only send a PATCH request if the machine is connected and if the extension has reported a Healthy status within 24 hours.
You can dry run this script as well.
Command:
.\Patch-ComputeMachineDisableFeatures.ps1 -subscriptionId {subscription ID} -resourceGroupName {resource group} -whatif $false