azure-rest-api-specs icon indicating copy to clipboard operation
azure-rest-api-specs copied to clipboard

Virtual Machine Scale Set VMs - List API does not return tags for "Orchestration mode: Flexible" Scale Sets

Open bgola-signalfx opened this issue 1 year ago • 0 comments

The https://learn.microsoft.com/en-us/rest/api/compute/virtual-machine-scale-set-vms/list API does not return tags for VMs when the flexible orchestration mode is used. For the uniform mode tags are returned properly.

Sample request: https://management.azure.com/subscriptions/5db89e2c-2127-4418-9a31-dac67b04e87b/resourceGroups/bgola-test-flexible_group/providers/Microsoft.Compute/virtualMachineScaleSets/bgola-test-flexible/virtualMachines?api-version=2023-09-01

Sample response for the flexible mode:

{
  "value": [
    {
      "name": "bgola-test-flexible_04945d5e",
      "id": "/subscriptions/5db89e2c-2127-4418-9a31-dac67b04e87b/resourceGroups/bgola-test-flexible_group/providers/Microsoft.Compute/virtualMachineScaleSets/bgola-test-flexible/virtualMachines/bgola-test-flexible_04945d5e",
      "type": "Microsoft.Compute/virtualMachineScaleSets/virtualMachines",
      "location": "westeurope",
      "instanceId": "bgola-test-flexible_04945d5e",
      "zones": [
        null
      ]
    }
  ]
}

Sample response for the uniform mode:

{
  "value": [
    {
      "name": "aks-agentpool-14709675-vmss_6",
      "id": "/subscriptions/5db89e2c-2127-4418-9a31-dac67b04e87b/resourceGroups/MC_Built-In-Technology-Solutions_BITS-AKS-Test_westus/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool-14709675-vmss/virtualMachines/6",
      "type": "Microsoft.Compute/virtualMachineScaleSets/virtualMachines",
      "location": "westus",
      "tags": {
        "Project": "Built-In Technology Solutions",
        "aks-managed-consolidated-additional-properties": "2ef6bd7a-353a-11ee-afc8-deb3f01c93e7",
        "aks-managed-createOperationID": "",
        "aks-managed-creationSource": "vmssclient-aks-agentpool-14709675-vmss",
        "aks-managed-kubeletIdentityClientID": "8833d46b-3f78-4096-8419-2a9bb74b3574",
        "aks-managed-operationID": "f91e8f60-a01e-46cd-a1c6-87129050aea7",
        "aks-managed-orchestrator": "Kubernetes:1.24.15",
        "aks-managed-poolName": "agentpool",
        "aks-managed-resourceNameSuffix": "81201883",
        "aks-managed-ssh-access": "LocalUser"
      },
      "identity": {
        "type": "UserAssigned",
        "userAssignedIdentities": {
          "/subscriptions/5db89e2c-2127-4418-9a31-dac67b04e87b/resourceGroups/MC_Built-In-Technology-Solutions_BITS-AKS-Test_westus/providers/Microsoft.ManagedIdentity/userAssignedIdentities/BITS-AKS-Test-agentpool": {
            "principalId": "fdc00193-91fd-4290-8881-709574dc379c",
            "clientId": "8833d46b-3f78-4096-8419-2a9bb74b3574"
          },
          "/subscriptions/5db89e2c-2127-4418-9a31-dac67b04e87b/resourcegroups/MC_Built-In-Technology-Solutions_BITS-AKS-Test_westus/providers/Microsoft.ManagedIdentity/userAssignedIdentities/omsagent-bits-aks-test": {
            "principalId": "348f54da-9b9e-4210-9222-02bddd4692ba",
            "clientId": "8128b5d9-d1c9-4899-b217-70f1ea614671"
          }
        }
      },
      "instanceId": "6",
      "sku": {
        "name": "Standard_B2s",
        "tier": "Standard"
      },
      "properties": {
        "latestModelApplied": true,
        "modelDefinitionApplied": "VirtualMachineScaleSet",
        "networkProfileConfiguration": {
          (...)
        },
        "provisioningState": "Succeeded",
        "hardwareProfile": {
          "vmSize": "Standard_B2s"
        },
        "vmId": "a5a38c5c-2ddb-4356-8d6e-281138bb3724",
        "storageProfile": {
          (...)
        },
        "osProfile": {
          (...)
        },
        "networkProfile": {
          (...)
        },
        "timeCreated": "2023-04-12T12:57:40.4732867+00:00"
      },
      "resources": [
        (...)
      ]
    }
  ]
}

bgola-signalfx avatar Jan 18 '24 14:01 bgola-signalfx