How to Retrieve SQL Server Instance Details from SQL IaaS Agent Extension Using Azure CLI

FERNANDO ARTERO SERRANO 0 Reputation points
2024-07-26T12:15:01.9433333+00:00

Hello Azure Community,

I am working with SQL Virtual Machines in Azure and using the SQL Server IaaS Agent Extension to manage my SQL Server instances. In the Azure portal, under the "SQL Virtual Machine" service, I can view detailed SQL Server instance information by clicking the "SQL configuration: Click here to view SQL extension configuration" button. This provides a JSON report similar to the following:

{
    "RpPluginReport": {
        "InstalledSqlSkusAndInstances": [
            {
                "Instance": "STD02",
                "Sku": "Enterprise"
            }
        ],
        "IsSqlManagement": false,
        "LastUpdatedTimeUtc": "/Date(1721814009515)/",
        "LeastPrivilegeModeSettings": false,
        "OSVersion": "WS2022",
        "SqlInstance": "STD02",
        "SqlManagementType": "OK",
        "SqlSku": "Enterprise",
        "SqlVersion": "SQL2022",
        "TargetSqlInstances": "STD02"
    },
    "ProvisioningState": "Succeeded"
}

I would like to retrieve this same information using Azure CLI commands. I have tried using the following command to get details about the SQL Server IaaS extension:

az vm extension show --resource-group rg-7699-xf-prod-std-paris-001 --vm-name FITTOR10SQCP060 --name SqlIaasExtension --subscription m34-p0ll4-m4gn4-35t-8768070cbf28 --output json

However, this command does not provide the detailed SQL Server instance information.

Is there a way to obtain this specific information about the SQL Server instance using Azure CLI commands? Any guidance or suggestions on how to achieve this would be greatly appreciated.

Thank you for your help!

Best regards,

Fernando A.

SQL Server on Azure Virtual Machines
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,365 questions
0 comments No comments
{count} votes