{"record":{"id":"b2ef120c1f883de0","repo":"kubernetes/kops","slug":"findvpcinfo-not-implemented-on-azurecloud-use-fin","errorCode":null,"errorMessage":"FindVPCInfo not implemented on azureCloud, use FindVNetInfo instead","messagePattern":"FindVPCInfo not implemented on azureCloud, use FindVNetInfo instead","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/azure/azure_cloud.go","lineNumber":190,"sourceCode":"\tCacheAzureCloudInstance(subscriptionID, resourceGroupName, azureCloudImpl)\n\n\treturn azureCloudImpl, nil\n}\n\nfunc (c *azureCloudImplementation) Region() string {\n\treturn c.location\n}\n\nfunc (c *azureCloudImplementation) ProviderID() kops.CloudProviderID {\n\treturn kops.CloudProviderAzure\n}\n\nfunc (c *azureCloudImplementation) DNS() (dnsprovider.Interface, error) {\n\treturn nil, errors.New(\"DNS not implemented on azureCloud\")\n}\n\nfunc (c *azureCloudImplementation) FindVPCInfo(id string) (*fi.VPCInfo, error) {\n\treturn nil, errors.New(\"FindVPCInfo not implemented on azureCloud, use FindVNetInfo instead\")\n}\n\nfunc (c *azureCloudImplementation) FindVNetInfo(id, resourceGroup string) (*fi.VPCInfo, error) {\n\tvnets, err := c.vnetsClient.List(context.TODO(), resourceGroup)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, vnet := range vnets {\n\t\tif *vnet.ID != id {\n\t\t\tcontinue\n\t\t}\n\t\tif vnet.Properties == nil {\n\t\t\tcontinue\n\t\t}\n\t\tsubnets := make([]*fi.SubnetInfo, 0)\n\t\tfor _, subnet := range vnet.Properties.Subnets {\n\t\t\tif subnet.Properties == nil {\n\t\t\t\tcontinue","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/azure/azure_cloud.go#L172-L208","documentation":"fi.Cloud.FindVPCInfo looks up a VPC by id; on Azure there is no VPC concept, so azureCloudImplementation returns this error and directs callers to FindVNetInfo, its Azure-specific equivalent backed by the vnetsClient.","triggerScenarios":"Calling FindVPCInfo(id) on an Azure cloud object — e.g. validation or network discovery code paths shared with AWS/GCE that resolve subnets/networks via FindVPCInfo.","commonSituations":"Porting provider-agnostic network validation code to Azure; utility code or plugins that assume VPC semantics; running kops validate/tooling that hits the generic FindVPCInfo path on an Azure cluster.","solutions":["Call FindVNetInfo(id, resourceGroup) instead, passing the VNet id and its resource group","Refactor caller code to be provider-aware and use the Azure-specific network lookup","If implementing generic support, add a FindVPCInfo shim in azureCloudImplementation that delegates to FindVNetInfo"],"exampleFix":"// before\nvpcInfo, err := cloud.FindVPCInfo(vnetID)\n// after\ntype azCloud interface { FindVNetInfo(id, resourceGroup string) (*fi.VPCInfo, error) }\nvpcInfo, err := cloud.(azCloud).FindVNetInfo(vnetID, resourceGroup)","handlingStrategy":"validation","validationCode":"if c.ProviderID() == kops.CloudProviderAzure {\n\tvpcInfo, err := c.(*azure.Cloud).FindVNetInfo(vnetID, resourceGroup)\n} else {\n\tvpcInfo, err := c.FindVPCInfo(id)\n}","typeGuard":"type vnetFinder interface { FindVNetInfo(id, resourceGroup string) (*fi.VPCInfo, error) }\nif vf, ok := cloud.(vnetFinder); ok { info, err := vf.FindVNetInfo(id, rg) }","tryCatchPattern":"info, err := cloud.FindVPCInfo(id)\nif err != nil && strings.Contains(err.Error(), \"use FindVNetInfo instead\") {\n\tinfo, err = azureCloud.FindVNetInfo(id, resourceGroup)\n}","preventionTips":["Branch network lookups on CloudProviderID","Track the resourceGroup alongside VNet ids for Azure","Prefer Azure-specific paths (FindVNetInfo) in Azure code"],"tags":["azure","vpc","vnet","not-implemented"],"backgroundTag":"not-implemented-on-provider","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}