{"record":{"id":"d639818c7e8857f8","repo":"kubernetes/kops","slug":"missing-required-azure-resource-group-name-when","errorCode":null,"errorMessage":"missing required --azure-resource-group-name when specifying Network ID","messagePattern":"missing required --azure-resource-group-name when specifying Network ID","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/defaults.go","lineNumber":106,"sourceCode":"\t\t\tc.Spec.Networking.NetworkCIDR = vpcInfo.CIDR\n\t\t\tif c.Spec.Networking.NetworkCIDR == \"\" {\n\t\t\t\treturn fmt.Errorf(\"unable to infer NetworkCIDR from Network ID, please specify --network-cidr\")\n\t\t\t}\n\t\t} else {\n\t\t\t// TODO: Choose non-overlapping networking CIDRs for VPCs, using vpcInfo\n\t\t\tc.Spec.Networking.NetworkCIDR = defaultAWSNetworkCIDR\n\t\t}\n\n\t\t// Amazon VPC CNI uses the same network\n\t\tif c.Spec.Networking.AmazonVPC != nil && c.Spec.Networking.NonMasqueradeCIDR != \"::/0\" {\n\t\t\tc.Spec.Networking.NonMasqueradeCIDR = c.Spec.Networking.NetworkCIDR\n\t\t}\n\t}\n\n\tif cloud.ProviderID() == kops.CloudProviderAzure && c.Spec.Networking.NetworkCIDR == \"\" {\n\t\tif c.SharedVPC() {\n\t\t\tif c.Spec.CloudProvider.Azure == nil || c.Spec.CloudProvider.Azure.ResourceGroupName == \"\" {\n\t\t\t\treturn fmt.Errorf(\"missing required --azure-resource-group-name when specifying Network ID\")\n\t\t\t}\n\t\t\tvpcInfo, err := cloud.(azure.AzureCloud).FindVNetInfo(c.Spec.Networking.NetworkID, c.Spec.CloudProvider.Azure.ResourceGroupName)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif vpcInfo == nil {\n\t\t\t\treturn fmt.Errorf(\"unable to find Network ID %q\", c.Spec.Networking.NetworkID)\n\t\t\t}\n\t\t\tc.Spec.Networking.NetworkCIDR = vpcInfo.CIDR\n\t\t\tif c.Spec.Networking.NetworkCIDR == \"\" {\n\t\t\t\treturn fmt.Errorf(\"unable to infer NetworkCIDR from Network ID, please specify --network-cidr\")\n\t\t\t}\n\t\t} else {\n\t\t\tc.Spec.Networking.NetworkCIDR = defaultAzureNetworkCIDR\n\t\t}\n\t}\n\n\tif cloud.ProviderID() == kops.CloudProviderLinode && c.Spec.Networking.NetworkCIDR == \"\" {","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/defaults.go#L88-L124","documentation":"Azure configuration guard in PerformAssignments: an Azure cluster specified a NetworkID (existing network) but the required --azure-resource-group-name flag was not provided, so kOps cannot locate resources in the user-supplied resource group.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/defaults.go:106 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set --azure-resource-group-name to the resource group holding the existing network","Or clear the Network ID to let kOps manage its own network"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}