{"record":{"id":"4b271e4d1face3e1","repo":"kubernetes/kops","slug":"cloud-t-does-not-expose-azure-subscription-id","errorCode":null,"errorMessage":"cloud %T does not expose Azure subscription ID","messagePattern":"cloud %T does not expose Azure subscription ID","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/azuretasks/subnet_terraform.go","lineNumber":137,"sourceCode":"\t}\n\n\tsubscriptionID, err := azureSubscriptionID(t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tsubnetID := azure.SubnetID{\n\t\tSubscriptionID:     subscriptionID,\n\t\tResourceGroupName:  fi.ValueOf(s.ResourceGroup.Name),\n\t\tVirtualNetworkName: fi.ValueOf(s.VirtualNetwork.Name),\n\t\tSubnetName:         fi.ValueOf(s.Name),\n\t}\n\treturn terraformWriter.LiteralFromStringValue(subnetID.String()), nil\n}\n\nfunc azureSubscriptionID(t *terraform.TerraformTarget) (string, error) {\n\tcloud, ok := t.Cloud.(subscriptionIDProvider)\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"cloud %T does not expose Azure subscription ID\", t.Cloud)\n\t}\n\tsubscriptionID := cloud.SubscriptionID()\n\tif subscriptionID == \"\" {\n\t\treturn \"\", fmt.Errorf(\"Azure subscription ID is empty\")\n\t}\n\treturn subscriptionID, nil\n}\n","sourceCodeStart":119,"sourceCodeEnd":145,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/azuretasks/subnet_terraform.go#L119-L145","documentation":"Type-assertion guard in azureSubscriptionID: the TerraformTarget's Cloud does not implement subscriptionIDProvider, so the Azure subscription ID needed to build resource IDs (e.g. subnet self-links) cannot be obtained. Fires when Terraform rendering runs against a cloud implementation that is not the Azure cloud — a programming/wiring error rather than runtime drift.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/azuretasks/subnet_terraform.go:137 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure Azure tasks are only rendered with an Azure cloud configuration","Check that the cloud instance passed in TerraformTarget implements SubscriptionID()","Report as a bug if rendering Azure resources was intended"],"exampleFix":null,"handlingStrategy":"type-guard","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"}