Skip to content

Commit 04091ef

Browse files
committed
Update query and apply standards.
1 parent d20ef9c commit 04091ef

1 file changed

Lines changed: 15 additions & 78 deletions

File tree

docs/sql-server/azure-arc/manage-configuration.md

Lines changed: 15 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ Run:
5050
az provider register --namespace 'Microsoft.AzureArcData'
5151
```
5252

53-
54-
55-
5653
---
5754

5855
## License types
@@ -149,16 +146,6 @@ To modify the SQL Server Configuration for a larger scope, such as a resource gr
149146
> [!TIP]
150147
> Run the script from Azure Cloud shell as it has the required Azure PowerShell modules pre-installed and you will be automatically authenticated. For details, see [Running the script using Cloud Shell](https://github.com/microsoft/sql-server-samples/tree/master/samples/manage/azure-arc-enabled-sql-server/modify-license-type#running-the-script-using-cloud-shell).
151148
152-
153-
154-
155-
156-
157-
158-
159-
160-
161-
162149
### [Azure portal](#tab/azure)
163150

164151
There are two ways to configure the SQL Server host in Azure portal.
@@ -171,9 +158,9 @@ There are two ways to configure the SQL Server host in Azure portal.
171158

172159
* Open the Arc-enabled SQL Server overview page, and select **Properties**. Under **Host configuration properties**, select the setting you need to modify:
173160

174-
* **License type**
175-
* **ESU Status**
176-
* **Automated patching**
161+
* **License type**
162+
* **ESU Status**
163+
* **Automated patching**
177164

178165
:::image type="content" source="media/billing/sql-server-instance-configuration.png" alt-text="Screenshot of Azure portal SQL Server instance configuration." lightbox="media/billing/sql-server-instance-configuration.png" :::
179166

@@ -213,49 +200,11 @@ $Settings = @{
213200
// Command stays the same as before, only settings is changed above:
214201
New-AzConnectedMachineExtension -Name "WindowsAgent.SqlServer" -ResourceGroupName {your resource group name} -MachineName {your machine name} -Location {azure region} -Publisher "Microsoft.AzureData" -Settings $Settings -ExtensionType "WindowsAgent.SqlServer"
215202
```
216-
> [!IMPORTANT]
217-
> - The update command overwrites all settings. If your extension settings have a list of excluded SQL Server instances, make sure to specify the full exclusion list with the update command.
218-
> - If you already have an older version of the Azure extension installed, make sure to upgrade it first, and then use one the modify methods to set the correct license type. For details, see [How to upgrade a machine extension](/azure/azure-arc/servers/manage-automatic-vm-extension-upgrade) for details.
219-
220-
221-
222-
223-
224-
225-
226-
227-
228-
229-
230-
231-
232-
233-
234-
235-
236-
237-
238-
239-
240-
241-
242-
243-
244-
245-
246-
247-
248-
249-
250-
251-
252-
253-
254-
255-
256-
257-
258203

204+
> [!IMPORTANT]
205+
>
206+
> * The update command overwrites all settings. If your extension settings have a list of excluded SQL Server instances, make sure to specify the full exclusion list with the update command.
207+
> * If you already have an older version of the Azure extension installed, make sure to upgrade it first, and then use one the modify methods to set the correct license type. For details, see [How to upgrade a machine extension](/azure/azure-arc/servers/manage-automatic-vm-extension-upgrade) for details.
259208
260209
### [Azure CLI](#tab/az)
261210

@@ -264,26 +213,14 @@ The following command will set the license type to "PAYG":
264213
```azurecli
265214
az connectedmachine extension update --machine-name "simple-vm" -g "<resource-group>" --name "WindowsAgent.SqlServer" --type "WindowsAgent.SqlServer" --publisher "Microsoft.AzureData" --settings '{"LicenseType":"PAYG", "SqlManagement": {"IsEnabled":true}}'    
266215
```
267-
> [!IMPORTANT]
268-
> - The update command overwrites all settings. If your extension settings have a list of excluded SQL Server instances, make sure to specify the full exclusion list with the update command.
269-
> - If you already have an older version of the Azure extension installed, make sure to upgrade it first, and then use one the modify methods to set the correct license type. For details, see [How to upgrade a machine extension](/azure/azure-arc/servers/manage-automatic-vm-extension-upgrade) for details.
270-
271-
272-
273216

217+
> [!IMPORTANT]
218+
>
219+
> * The update command overwrites all settings. If your extension settings have a list of excluded SQL Server instances, make sure to specify the full exclusion list with the update command.
220+
> * If you already have an older version of the Azure extension installed, make sure to upgrade it first, and then use one the modify methods to set the correct license type. For details, see [How to upgrade a machine extension](/azure/azure-arc/servers/manage-automatic-vm-extension-upgrade) for details.
274221
275222
---
276223

277-
278-
279-
280-
281-
282-
283-
284-
285-
286-
287224
## Query SQL Server configuration
288225

289226
You can use [Azure Resource Graph](/azure/governance/resource-graph/overview) to query the SQL Server configuration settings within a selected scope. See the following examples.
@@ -337,8 +274,6 @@ resources
337274

338275
This query identifies Azure Arc-enabled servers with SQL Server discovered on them.
339276

340-
341-
342277
```kusto
343278
resources
344279
| where type == "microsoft.hybridcompute/machines"
@@ -353,13 +288,15 @@ resources
353288
| where type == "microsoft.hybridcompute/machines"
354289
| where properties.detectedProperties.mssqldiscovered == "true"
355290
| project machineIdHasSQLServerDiscovered = id
356-
| join kind=leftouter (
291+
| join kind= leftouter (
357292
resources
358293
| where type == "microsoft.hybridcompute/machines/extensions"
359294
| where properties.type == "WindowsAgent.SqlServer"
360295
| project machineIdHasSQLServerExtensionInstalled = substring(id, 0, indexof(id, "/extensions/WindowsAgent.SqlServer")))
361296
on $left.machineIdHasSQLServerDiscovered == $right.machineIdHasSQLServerExtensionInstalled
362-
| order by machineIdHasSQLServerExtensionInstalled desc
297+
| where isempty(machineIdHasSQLServerExtensionInstalled)
298+
| project machineIdHasSQLServerDiscoveredButNotTheExtension = machineIdHasSQLServerDiscovered
299+
363300
```
364301

365302
For more examples of Azure Resource Graph Queries, see [Starter Resource Graph queries](/azure/governance/resource-graph/samples/starter).

0 commit comments

Comments
 (0)