{"record":{"id":"d1d79f912be3ae59","repo":"kubernetes/kops","slug":"unsupported-resource-type-q-for-q","errorCode":null,"errorMessage":"unsupported resource type %q for %q","messagePattern":"unsupported resource type %q for %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/nodeidentity/azure/client.go","lineNumber":94,"sourceCode":"\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error parsing providerID: %v\", err)\n\t}\n\n\tswitch res.ResourceType.String() {\n\tcase \"Microsoft.Compute/virtualMachines\":\n\t\tresp, err := c.vmClient.Get(ctx, res.ResourceGroupName, res.Name, nil)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"getting VM: %w\", err)\n\t\t}\n\t\treturn resp.VirtualMachine.Tags, nil\n\tcase \"Microsoft.Compute/virtualMachineScaleSets/virtualMachines\":\n\t\tresp, err := c.vmssClient.Get(ctx, res.ResourceGroupName, res.Parent.Name, res.Name, nil)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"getting VMSS VM: %w\", err)\n\t\t}\n\t\treturn resp.VirtualMachineScaleSetVM.Tags, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unsupported resource type %q for %q\", res.ResourceType, providerID)\n\t}\n}\n","sourceCodeStart":76,"sourceCodeEnd":97,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/nodeidentity/azure/client.go#L76-L97","documentation":"getVMTags only supports two Azure resource types: standalone virtualMachines and virtualMachineScaleSets/virtualMachines. If the parsed providerID points at any other ARM resource type (disks, NICs, availability sets, AKS-managed resources, etc.), this error names the unsupported type and the offending providerID.","triggerScenarios":"arm.ParseResourceID succeeds but res.ResourceType.String() is neither 'Microsoft.Compute/virtualMachines' nor 'Microsoft.Compute/virtualMachineScaleSets/virtualMachines' — the providerID points at a non-VM resource, or uses an unexpected casing/casing-normalized type string.","commonSituations":"ProviderID manually set to a NIC or disk ID; newer azure SDK versions changing ResourceType string formatting (casing like 'microsoft.compute/virtualmachines'); third-party controllers writing custom azure:// IDs; future Azure resource kinds not yet handled by kops.","solutions":["Print/verify res.ResourceType.String() for the offending providerID and correct the node's providerID to point at the actual VM resource","Check providerID casing — Azure ARM type names are case-sensitive here; normalize to 'Microsoft.Compute/...' form","Upgrade kops if a newer Azure CCM emits a resource type not yet handled in this switch","Extend the switch in client.go:94 to handle the new resource type if you maintain a fork"],"exampleFix":"// before\nswitch res.ResourceType.String() {\ncase \"Microsoft.Compute/virtualMachines\":\n    ...\n\n// after (tolerate case variations)\nswitch strings.ToLower(res.ResourceType.String()) {\ncase \"microsoft.compute/virtualmachines\":\n    ...","handlingStrategy":"type-guard","validationCode":"res, err := arm.ParseResourceID(strings.TrimPrefix(providerID, \"azure://\"))\nif err != nil {\n    return err\n}\nt := res.ResourceType.String()\nif t != \"Microsoft.Compute/virtualMachines\" && t != \"Microsoft.Compute/virtualMachineScaleSets/virtualMachines\" {\n    return fmt.Errorf(\"unsupported resource type %q\", t)\n}","typeGuard":"func isSupportedVMResourceType(res *arm.ResourceID) bool {\n    t := strings.ToLower(res.ResourceType.String())\n    return t == \"microsoft.compute/virtualmachines\" || t == \"microsoft.compute/virtualmachinescalesets/virtualmachines\"\n}","tryCatchPattern":"tags, err := getVMTags(ctx, pid)\nif err != nil && strings.Contains(err.Error(), \"unsupported resource type\") {\n    // providerID points at a non-VM resource; fix the node's providerID\n}","preventionTips":["Point providerIDs at VM/VMSS-instance resources only, never disks/NICs","Normalize ARM type casing before comparison","Extend the switch when adopting newer Azure resource kinds","Log res.ResourceType for unsupported IDs to aid triage"],"tags":["azure","providerid","arm","unsupported-resource"],"backgroundTag":"unsupported-azure-resource-type","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}