Skip to content

az find fails with NameResolutionError when app.aladdin.microsoft.com returns NXDOMAIN #33691

Description

Describe the bug

Running the az find command results in an unhandled exception. Instead of returning command examples or a user-friendly error message, the CLI exits with a Python traceback after failing to resolve app.aladdin.microsoft.com.

Authentication and other Azure resource management commands continue to work normally, indicating the issue is isolated to az find.

Related command

az find vm

Errors

requests.exceptions.ConnectionError:
HTTPSConnectionPool(host='app.aladdin.microsoft.com', port=443)

Caused by:

urllib3.exceptions.NameResolutionError:
Failed to resolve 'app.aladdin.microsoft.com'
([Errno 8] nodename nor servname provided, or not known)

Issue script & Debug output

az find vm --debug

Expected behavior

az find should return example Azure CLI commands. If the backend service is unavailable or the endpoint cannot be reached, the command should fail gracefully with a clear error message instead of an unhandled Python traceback.

Environment Summary

  • Azure CLI: 2.87.0
  • Installation method: Homebrew
  • Operating System: macOS
  • Python: Bundled with Homebrew Azure CLI (Python 3.13)

The following commands work successfully:

az account show
az vm list
az group list

Additional context

Running the following command:

nslookup app.aladdin.microsoft.com

returns:

** server can't find app.aladdin.microsoft.com: NXDOMAIN

This suggests the issue is isolated to the endpoint used by az find. If the endpoint has been retired or changed, the CLI may need to use an updated endpoint or handle the failure more gracefully.

Activity

  1. added
    bugThis issue requires a change to an existing behavior in the product in order to be resolved.
    on Jul 1, 2026
  2. added
    Azure CLI TeamThe command of the issue is owned by Azure CLI team
    questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
    ARMaz resource/group/lock/tag/deployment/policy/managementapp/account management-group
    on Jul 1, 2026
  3. a0x1ab commented on Jul 1, 2026

    @a0x1ab
    Member

    Bug Analysis

    az find (the find module, e.g. src/azure-cli/azure/cli/command_modules/find/)
    calls out to the aladdin service (app.aladdin.microsoft.com) to fetch usage
    examples. When DNS resolution for that host fails (NXDOMAIN, e.g. due to
    network restrictions or the endpoint being unreachable), the underlying
    requests/urllib3 call raises an unhandled
    requests.exceptions.ConnectionError wrapping a
    urllib3.exceptions.NameResolutionError, which propagates all the way up and
    crashes the CLI with a raw Python traceback instead of a clean CLI error.

    Fix guidance:

    • Locate the HTTP call to the aladdin endpoint in the find module (likely in
      _gather_examples/_call_aladdin_service or similarly named helper in
      src/azure-cli/azure/cli/command_modules/find/custom.py or _help_files.py).
    • Wrap the outbound request in a try/except that catches
      requests.exceptions.RequestException (which covers ConnectionError,
      Timeout, etc., including DNS resolution failures) and raises a
      CLIError/CLIInternalError (or logs a friendly warning and returns
      gracefully) instead of letting the raw exception bubble up.
    • Add/adjust unit tests under
      src/azure-cli/azure/cli/command_modules/find/tests/ to simulate a
      connection failure (e.g. mock requests.post/requests.get to raise
      requests.exceptions.ConnectionError) and assert az find reports a clean,
      user-friendly error instead of raising an unhandled traceback.
    • Repro: az find vm when app.aladdin.microsoft.com is unreachable/NXDOMAIN
      (CLI 2.87.0, macOS, Python 3.13, per the issue).

    Use this EXACT PR title: [Find] Fix #33691: az find vm: handle NameResolutionError gracefully in az find

    PR title & description format (required)

    This repo enforces a PR format (guide). Please author the PR exactly as follows or CI's Check the Format of Pull Request Title and Content will fail.

    Use this EXACT PR title (copy verbatim, do not reword):

    [Find] Fix #33691: `az find vm`: handle NameResolutionError gracefully in az find
    

    Keep the backticks around the command and the Fix #33691: prefix. You may only adjust the wording after the command (the final summary) if the fix changes; the [Find] prefix, issue link, and backticked command must stay.

    Description — follow the PR template and fill in:

    • Link the issue — start the Description with a closing keyword so the PR auto-links and closes it: Fixes #33691.
    • Related command — the az ... command this affects.
    • Description (mandatory) — why the bug happens, what you changed, and the resulting behavior.
    • Testing Guide — example command(s) showing the fix works.
    • History Notes — leave the title to drive the history note, or add extra lines in the same format (component in brackets + the command in backticks), e.g. [Find] `az <command>`: <note>.
    • Keep the template checklist and tick the items you've satisfied.

    Posted by agent-assist (autonomous bug-fix pipeline).

  4. added a commit that references this issue on Jul 1, 2026
    8a0f5e8
  5. removed
    questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
    on Jul 1, 2026
  6. added this to the Backlog milestone on Jul 1, 2026
  7. yonzhan commented on Jul 1, 2026

    @yonzhan
    Collaborator

    az find

  8. microsoft-github-policy-service commented on Jul 7, 2026

    @microsoft-github-policy-service
    Contributor

    🔔 Routing this issue to @Azure/act-quality-productivity-squad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

ARMaz resource/group/lock/tag/deployment/policy/managementapp/account management-groupAuto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamComputeaz vm/vmss/image/disk/snapshotact-quality-productivity-squadbugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions