{"record":{"id":"45ce7656318f2a86","repo":"JanDeDobbeleer/oh-my-posh","slug":"azure-config-dir-not-found","errorCode":null,"errorMessage":"azure config dir not found","messagePattern":"azure config dir not found","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/segments/az.go","lineNumber":172,"sourceCode":"\ta.TenantDisplayName = config.Tenant.Name\n\n\ta.Origin = \"PWSH\"\n\n\treturn true\n}\n\nfunc (a *Az) findConfig(fileName string) (string, error) {\n\tconfigDirs := []string{\n\t\ta.env.Getenv(\"AZURE_CONFIG_DIR\"),\n\t\tfilepath.Join(a.env.Home(), \".azure\"),\n\t\tfilepath.Join(a.env.Home(), \".Azure\"),\n\t}\n\tfor _, dir := range configDirs {\n\t\tif len(dir) != 0 && a.env.HasFilesInDir(dir, fileName) {\n\t\t\treturn filepath.Join(dir, fileName), nil\n\t\t}\n\t}\n\treturn \"\", errors.New(\"azure config dir not found\")\n}\n","sourceCodeStart":154,"sourceCodeEnd":174,"githubUrl":"https://github.com/JanDeDobbeleer/oh-my-posh/blob/0976794618c5ed95de0985dded50de1b4dc914cb/src/segments/az.go#L154-L174","documentation":"The azure segment reads Azure CLI state from `azureProfile.json` / `cloudsConfig.json` (or the PowerShell variant). findConfig searches AZURE_CONFIG_DIR, ~/.azure, and ~/.Azure for the file; if none of those directories contains it, this error is returned and the segment stays hidden.","triggerScenarios":"getCLISubscription calls findConfig while no Azure CLI profile exists: Azure CLI never installed or never run (`az login`), AZURE_CONFIG_DIR set to a directory without the profile file, or a non-default home directory.","commonSituations":"Fresh machine/container where `az login` was never executed; AZURE_CONFIG_DIR customized (e.g. in a dotfiles setup) but missing the profile; segment enabled in the theme although Azure CLI is not used; macOS/Linux users with a mounted but empty home.","solutions":["Install the Azure CLI and run `az login` so ~/.azure/azureProfile.json is created.","If AZURE_CONFIG_DIR is set, confirm it points at the directory actually containing azureProfile.json (check `echo $env:AZURE_CONFIG_DIR` / `echo $AZURE_CONFIG_DIR`).","Remove the azure segment from your theme if you do not use Azure on this machine - the error only means the segment disables itself."],"exampleFix":"# before\n$ echo $AZURE_CONFIG_DIR\n~/dotfiles/azure   # dir exists but has no azureProfile.json\n\n# after\n$ az login\n$ ls ~/.azure/azureProfile.json\n~/.azure/azureProfile.json","handlingStrategy":"validation","validationCode":"test -f \"${AZURE_CONFIG_DIR:-$HOME/.azure}/azureProfile.json\" && echo \"az profile found\" || echo \"run 'az login'\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `az login` once per machine before enabling the azure segment","If AZURE_CONFIG_DIR is set, confirm it contains azureProfile.json","Remove the azure segment from themes on machines without the Azure CLI"],"tags":["azure","config-file","segment","cli"],"backgroundTag":"missing-config-file","analyzedSha":"0976794618c5ed95de0985dded50de1b4dc914cb","analyzedAt":"2026-08-31T23:41:19.708Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}