{"record":{"id":"2f9ff39fd48a3c84","repo":"hashicorp/nomad","slug":"empty-az-environment-value","errorCode":null,"errorMessage":"empty AZ Environment value","messagePattern":"empty AZ Environment value","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"client/fingerprint/env_azure.go","lineNumber":230,"sourceCode":"\t}\n\n\t// populate Links\n\tif id, ok := response.Attributes[\"unique.platform.azure.id\"]; ok {\n\t\tresponse.AddLink(\"azure\", id)\n\t}\n\n\tresponse.Detected = true\n\treturn nil\n}\n\nfunc (f *EnvAzureFingerprint) azureProbe() error {\n\tv, err := f.Get(\"compute/azEnvironment\", \"text\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif v = strings.TrimSpace(v); v == \"\" {\n\t\treturn errors.New(\"empty AZ Environment value\")\n\t}\n\n\treturn nil\n}\n\n// Reload is a no-op but implements ReloadableFingerprint\nfunc (f *EnvAzureFingerprint) Reload() {}\n","sourceCodeStart":212,"sourceCodeEnd":238,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/fingerprint/env_azure.go#L212-L238","documentation":"The Azure environment fingerprint queries the Azure Instance Metadata Service for the compute/azEnvironment value to confirm the node runs in Azure and record which environment (e.g. AzurePublicCloud). azureProbe rejects the value when it is missing or only whitespace, since a valid Azure node always reports an AZ environment string.","triggerScenarios":"Fingerprinting a Nomad client where the Azure IMDS responded but the compute/azEnvironment field was absent, empty, or whitespace-only — e.g. non-Azure hosts with something listening on the metadata address, or partial metadata responses.","commonSituations":"Hybrid environments where a metadata proxy or wrong URL returns JSON without the azEnvironment key, Azure Stack / sovereign clouds with unusual environment names, or connectivity issues truncating responses.","solutions":["Verify the metadata endpoint returns a non-empty azEnvironment (curl the IMDS and inspect compute/azEnvironment)","If the host is not Azure, disable the env_azure fingerprint in client config","Check the configured metadata base URL/headers match your environment (Azure Stack may need a custom endpoint)","Upgrade Nomad if your cloud returns a new environment name the old fingerprint does not handle"],"exampleFix":"// before\nclient { }\n// after\nclient {\n  fingerprint {\n    \"env_azure\" { disabled = true }\n  }\n}","handlingStrategy":"validation","validationCode":"// Pre-check before relying on Azure attributes\nresp, _ := http.Get(\"http://169.254.169.254/metadata/instance/compute/azEnvironment?api-version=2021-02-01&format=text\")\nbody, _ := io.ReadAll(resp.Body)\nif strings.TrimSpace(string(body)) == \"\" {\n    // missing azEnvironment: disable env_azure fingerprint or fix metadata access\n}","typeGuard":"func hasNonEmptyMetadata(body []byte) bool {\n    return len(strings.TrimSpace(string(body))) > 0\n}","tryCatchPattern":null,"preventionTips":["Verify Azure IMDS returns azEnvironment before enabling Azure-dependent config","Disable env_azure fingerprint on non-Azure or Azure Stack hosts with partial metadata","Keep Nomad updated for new Azure cloud environment names","Check proxy/firewall rules around 169.254.169.254"],"tags":["fingerprint","azure","metadata-service","network"],"backgroundTag":"empty-metadata-response","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}