{"record":{"id":"e43e80211395380d","repo":"kubernetes/kops","slug":"downloading-nodeup-from-an-azureblob-url-is-not","errorCode":null,"errorMessage":"downloading nodeup from an azureblob:// URL is not supported in Azure environment %q","messagePattern":"downloading nodeup from an azureblob:// URL is not supported in Azure environment %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/resources/nodeup.go","lineNumber":326,"sourceCode":"}\n\nfunc (b *NodeUpScript) Build() (fi.Resource, error) {\n\tif b.ProxyEnv == nil {\n\t\tb.ProxyEnv = funcEmptyString\n\t}\n\tif b.EnvironmentVariables == nil {\n\t\tb.EnvironmentVariables = funcEmptyString\n\t}\n\n\tif b.useS3Download() && b.S3Region == \"\" {\n\t\treturn nil, fmt.Errorf(\"ResolveS3Region must be called before building a nodeup script with an s3:// source\")\n\t}\n\n\tif b.useBlobDownload() {\n\t\t// The script hard-codes the public cloud blob.core.windows.net endpoint suffix.\n\t\t// Azure environment names are case-insensitive; AzureCloud is the CLI name of the public cloud.\n\t\tif azureEnv := os.Getenv(\"AZURE_ENVIRONMENT\"); azureEnv != \"\" && !strings.EqualFold(azureEnv, \"AzurePublicCloud\") && !strings.EqualFold(azureEnv, \"AzureCloud\") {\n\t\t\treturn nil, fmt.Errorf(\"downloading nodeup from an azureblob:// URL is not supported in Azure environment %q\", azureEnv)\n\t\t}\n\t}\n\n\tfunctions := template.FuncMap{\n\t\t\"NodeUpSourceAmd64\": func() (string, error) {\n\t\t\treturn b.nodeUpSource(architectures.ArchitectureAmd64)\n\t\t},\n\t\t\"NodeUpSourceHashAmd64\": func() string {\n\t\t\tif b.NodeUpAssets[architectures.ArchitectureAmd64] != nil {\n\t\t\t\treturn b.NodeUpAssets[architectures.ArchitectureAmd64].Hash.Hex()\n\t\t\t}\n\t\t\treturn \"\"\n\t\t},\n\t\t\"NodeUpSourceArm64\": func() (string, error) {\n\t\t\treturn b.nodeUpSource(architectures.ArchitectureArm64)\n\t\t},\n\t\t\"NodeUpSourceHashArm64\": func() string {\n\t\t\tif b.NodeUpAssets[architectures.ArchitectureArm64] != nil {","sourceCodeStart":308,"sourceCodeEnd":344,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/model/resources/nodeup.go#L308-L344","documentation":"The generated nodeup script hard-codes the public Azure cloud blob endpoint suffix (blob.core.windows.net). Build therefore rejects azureblob:// downloads when AZURE_ENVIRONMENT names a non-public cloud, since nodeup would otherwise download from the wrong endpoint and fail at boot time.","triggerScenarios":"Building a NodeUpScript that uses blob download while the AZURE_ENVIRONMENT environment variable is set to a sovereign cloud name such as 'AzureChinaCloud', 'AzureUSGovernment', or 'AzureGermanCloud' (any value not equal, case-insensitively, to AzurePublicCloud or AzureCloud).","commonSituations":"CI agents or developer shells configured for Azure China/Government stacks running kops against public cloud (or vice versa); leftover AZURE_ENVIRONMENT from az CLI tooling.","solutions":["Unset AZURE_ENVIRONMENT or set it to AzurePublicCloud/AzureCloud when targeting public Azure.","If you genuinely target a sovereign cloud, do not use azureblob:// nodeup sources — switch to another source scheme.","Check `echo $AZURE_ENVIRONMENT` in the environment running kops.","Adjust CI job environment variables so only the intended Azure environment is configured."],"exampleFix":"// before\nexport AZURE_ENVIRONMENT=AzureChinaCloud\nkops update cluster ...\n// after\nunset AZURE_ENVIRONMENT   # or: export AZURE_ENVIRONMENT=AzurePublicCloud\nkops update cluster ...","handlingStrategy":"validation","validationCode":"if azureEnv := os.Getenv(\"AZURE_ENVIRONMENT\"); azureEnv != \"\" &&\n    !strings.EqualFold(azureEnv, \"AzurePublicCloud\") &&\n    !strings.EqualFold(azureEnv, \"AzureCloud\") && blobSourceInUse {\n    return fmt.Errorf(\"%s not supported for azureblob nodeup source\", azureEnv)\n}","typeGuard":"func isPublicAzureEnv() bool {\n    e := os.Getenv(\"AZURE_ENVIRONMENT\")\n    return e == \"\" || strings.EqualFold(e, \"AzurePublicCloud\") || strings.EqualFold(e, \"AzureCloud\")\n}","tryCatchPattern":"if err := errUnsupportedAzureEnv; err != nil {\n    return fmt.Errorf(\"unset AZURE_ENVIRONMENT or use a non-blob nodeup source: %w\", err)\n}","preventionTips":["Check AZURE_ENVIRONMENT in the kops execution environment before azureblob workflows","Unset leftover az CLI environment variables in CI","Use non-blob source schemes for sovereign cloud stacks"],"tags":["azure","environment-variable","nodeup"],"backgroundTag":"unsupported-azure-environment","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"}