Skip to content

[Find] Fix Azure/azure-cli#33691: az find vm: handle NameResolutionError gracefully in az find#33692

Draft
a0x1ab with Copilot wants to merge 3 commits into
devfrom
copilot/fix-az-find-name-resolution-error
Draft

[Find] Fix Azure/azure-cli#33691: az find vm: handle NameResolutionError gracefully in az find#33692
a0x1ab with Copilot wants to merge 3 commits into
devfrom
copilot/fix-az-find-name-resolution-error

Conversation

Copilot AI commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Related command
az find

Description

az find crashed with a raw Python traceback when app.aladdin.microsoft.com was unreachable (DNS NXDOMAIN / network failure). requests.get in call_aladdin_service had no exception handling, so requests.exceptions.ConnectionError propagated unhandled to the user.

  • call_aladdin_service: wrap requests.get in try/except requests.exceptions.ConnectionError; log a actionable warning naming the unreachable host and return None instead of raising.
  • process_query: guard response.status_code access — treat None the same as non-200 (shows the existing "command has been retired" message).
  • get_generated_examples: guard response.status_code access — returns empty list on None.
# Before: unhandled traceback
# requests.exceptions.ConnectionError: HTTPSConnectionPool(host='app.aladdin.microsoft.com', port=443)

# After: clean warning + graceful degradation
# WARNING: Failed to connect to 'app.aladdin.microsoft.com'. Please check your network connection.

Testing Guide

Run unit tests:

python -m unittest src/azure-cli/azure/cli/command_modules/find/tests/latest/test_find.py -v

Two new tests cover the failure path:

  • test_call_aladdin_service_connection_error — asserts None is returned on ConnectionError
  • test_get_generated_examples_connection_error — asserts empty list is returned on ConnectionError

History Notes

[Find] az find: handle ConnectionError/NameResolutionError gracefully when aladdin service is unreachable


This checklist is used to make sure that common guidelines for a pull request are followed.

@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented Jul 1, 2026

Copy link
Copy Markdown
️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.14
️✔️acs
️✔️latest
️✔️3.12
️✔️3.14
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.14
️✔️ams
️✔️latest
️✔️3.12
️✔️3.14
️✔️apim
️✔️latest
️✔️3.12
️✔️3.14
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.14
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.14
️✔️aro
️✔️latest
️✔️3.12
️✔️3.14
️✔️backup
️✔️latest
️✔️3.12
️✔️3.14
️✔️batch
️✔️latest
️✔️3.12
️✔️3.14
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.14
️✔️billing
️✔️latest
️✔️3.12
️✔️3.14
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.14
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.14
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.14
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.14
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.14
️✔️config
️✔️latest
️✔️3.12
️✔️3.14
️✔️configure
️✔️latest
️✔️3.12
️✔️3.14
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.14
️✔️container
️✔️latest
️✔️3.12
️✔️3.14
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.14
️✔️core
️✔️latest
️✔️3.12
️✔️3.14
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.14
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.14
️✔️dls
️✔️latest
️✔️3.12
️✔️3.14
️✔️dms
️✔️latest
️✔️3.12
️✔️3.14
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.14
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.14
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.14
️✔️find
️✔️latest
️✔️3.12
️✔️3.14
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.14
️✔️identity
️✔️latest
️✔️3.12
️✔️3.14
️✔️iot
️✔️latest
️✔️3.12
️✔️3.14
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.14
️✔️lab
️✔️latest
️✔️3.12
️✔️3.14
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.14
️✔️maps
️✔️latest
️✔️3.12
️✔️3.14
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.14
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.14
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.14
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.14
️✔️network
️✔️latest
️✔️3.12
️✔️3.14
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.14
️✔️postgresql
️✔️latest
️✔️3.12
️✔️3.14
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.14
️✔️profile
️✔️latest
️✔️3.12
️✔️3.14
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.14
️✔️redis
️✔️latest
️✔️3.12
️✔️3.14
️✔️relay
️✔️latest
️✔️3.12
️✔️3.14
️✔️resource
️✔️latest
️✔️3.12
️✔️3.14
️✔️role
️✔️latest
️✔️3.12
️✔️3.14
️✔️search
️✔️latest
️✔️3.12
️✔️3.14
️✔️security
️✔️latest
️✔️3.12
️✔️3.14
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.14
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.14
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.14
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.14
️✔️sql
️✔️latest
️✔️3.12
️✔️3.14
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.14
️✔️storage
️✔️latest
️✔️3.12
️✔️3.14
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.14
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.14
️✔️util
️✔️latest
️✔️3.12
️✔️3.14
️✔️vm
️✔️latest
️✔️3.12
️✔️3.14

@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented Jul 1, 2026

Copy link
Copy Markdown
️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@microsoft-github-policy-service microsoft-github-policy-service Bot added the Auto-Assign Auto assign by bot label Jul 1, 2026
@microsoft-github-policy-service microsoft-github-policy-service Bot added Compute az vm/vmss/image/disk/snapshot act-observability-squad ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group act-identity-squad labels Jul 1, 2026
Copilot AI changed the title [WIP] Fix az find fails with NameResolutionError [Find] Fix Azure/azure-cli#33691: az find vm: handle NameResolutionError gracefully in az find Jul 1, 2026
Copilot finished work on behalf of a0x1ab July 1, 2026 19:22
Copilot AI requested a review from a0x1ab July 1, 2026 19:22

@a0x1ab a0x1ab left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI Review — #33692

Status: Changes requested

Failing check

  • Check the Format of Pull Request Title and Content — 1 error.
    The current PR title uses Fix Azure/azure-cli#33691: but the gate expects
    the short Fix #33691: form (this fix lives in the same repo as the issue,
    so the owner/repo prefix should be omitted).

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.

Live-test (Tester) note

The live-test dispatch for this PR failed at an infrastructure step (gh api
call hit a 403 from an expired/disallowed PAT on the issue-sentinel runner,
unrelated to this PR's code) before it could determine whether any test files
changed. This is not something to fix in this PR — no action needed here;
it will be re-evaluated automatically on the next push.

Other CI

22/23 completed checks passed; the remaining checks were still running at
review time and are unaffected by this comment.

Please update the PR title to the exact string above and re-push.


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

@a0x1ab

a0x1ab commented Jul 1, 2026

Copy link
Copy Markdown
Member

@copilot the automated CI and live-test review on this PR found failures. Please look into the requested changes here: #33692 (review) and push a fix.


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

Copilot AI commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

@copilot the automated CI and live-test review on this PR found failures. Please look into the requested changes here: #33692 (review) and pu...

The CI failure is a PR title format issue only — no code changes are required. The title needs to drop the Azure/azure-cli owner/repo prefix from the issue link (same-repo references use the short form). Please update the PR title to:

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

All code changes and tests are already correct.

Copilot finished work on behalf of a0x1ab July 1, 2026 19:48
Copilot AI requested a review from a0x1ab July 1, 2026 19:48
@yonzhan

yonzhan commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Find

@a0x1ab

a0x1ab commented Jul 2, 2026

Copy link
Copy Markdown
Member

@copilot the automated CI and live-test review on this PR found failures. Please look into the requested changes here: #33692 (review) and push a fix.


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

@a0x1ab a0x1ab left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Review — CI failure found

CI check failed: Azure.azure-cli (Check the Format of Pull Request Title and Content)https://github.com/Azure/azure-cli/runs/84619134129

The current PR title does not match the required format:

[Find] Fix Azure/azure-cli#33691: \az find vm`: handle NameResolutionError gracefully in az find`

Issues with the current title:

  • It uses Azure/azure-cli#33691 instead of the bare #33691 form the gate expects after Fix .
  • It uses `az find vm` as the command, but this PR only changes behavior in az find itself (no vm subcommand involved) — the backticked command should be `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`: 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.

Please rename the PR to exactly:

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

Note: the live-test workflow run (https://github.com/Azure/issue-sentinel/actions/runs/28542127904) also shows a failure, but this is not related to your code — the run found no changed test files to execute (azdev live test was correctly skipped as neutral) and the reported failure came from an internal PAT/token issue when posting the results comment back to this PR. No action needed on that front; it will be re-run automatically. Only the PR title/format issue above needs a fix.


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

Copilot AI commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot the automated CI and live-test review on this PR found failures. Please look into the requested changes here: #33692 (review) and pu...

The CI failure is a PR title-only issue — no code changes are required. Please update the PR title to exactly:

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

Two changes from the current title: Azure/azure-cli#33691#33691 (same-repo short form), and `az find vm``az find` (no vm subcommand is involved in this fix).

Copilot AI requested a review from a0x1ab July 2, 2026 10:35
Copilot finished work on behalf of a0x1ab July 2, 2026 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

act-identity-squad act-observability-squad ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group Auto-Assign Auto assign by bot Compute az vm/vmss/image/disk/snapshot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

4 participants