{"record":{"id":"20a83f9e0a07ca88","repo":"kubernetes/kops","slug":"on-azure-subnets-must-include-regions","errorCode":null,"errorMessage":"on Azure, subnets must include Regions","messagePattern":"on Azure, subnets must include Regions","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/utils.go","lineNumber":160,"sourceCode":"\t\t\tvar zoneNames []string\n\t\t\tfor _, subnet := range cluster.Spec.Networking.Subnets {\n\t\t\t\tif !fi.ArrayContains(zoneNames, subnet.Zone) {\n\t\t\t\t\tzoneNames = append(zoneNames, subnet.Zone)\n\t\t\t\t}\n\t\t\t}\n\t\t\tosc.UseZones(zoneNames)\n\t\t\tcloud = osc\n\t\t}\n\n\tcase kops.CloudProviderAzure:\n\t\t{\n\t\t\tfor _, subnet := range cluster.Spec.Networking.Subnets {\n\t\t\t\tif subnet.Region != \"\" {\n\t\t\t\t\tregion = subnet.Region\n\t\t\t\t}\n\t\t\t}\n\t\t\tif region == \"\" {\n\t\t\t\treturn nil, fmt.Errorf(\"on Azure, subnets must include Regions\")\n\t\t\t}\n\n\t\t\tcloudTags := map[string]string{azure.TagClusterName: cluster.ObjectMeta.Name}\n\t\t\tfor k, v := range cluster.Spec.CloudLabels {\n\t\t\t\tcloudTags[k] = v\n\t\t\t}\n\n\t\t\tsubscriptionID := cluster.Spec.CloudProvider.Azure.SubscriptionID\n\t\t\tresourceGroupName := cluster.AzureResourceGroupName()\n\t\t\tazureCloud, err := azure.NewAzureCloud(subscriptionID, resourceGroupName, region, cloudTags)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tcloud = azureCloud\n\t\t}\n\tcase kops.CloudProviderScaleway:\n\t\t{","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/utils.go#L142-L178","documentation":"A configuration validation in BuildCloud for Azure clusters: no subnet in spec.networking.subnets defines a Region, so kOps cannot determine the Azure region for the cloud client. As with GCE, on Azure the region is inferred from subnet definitions; all-empty Regions make cluster construction impossible.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/utils.go:160 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set region on at least one subnet in spec.networking.subnets to a valid Azure region (e.g. westeurope)","Use kops edit cluster to fix the spec, then re-run","When generating clusters programmatically, populate subnet regions from the target Azure location"],"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-12T07:17:12.445Z"}