Skip to content

Add FileNotFoundError handling for missing az CLI in function deployment#99

Merged
sbaidachni merged 2 commits into
sbaidachni/docker_docsfrom
copilot/sub-pr-87-0b6f0cd3-ace1-42fb-b545-19ecaafd1b45
Mar 2, 2026
Merged

Add FileNotFoundError handling for missing az CLI in function deployment#99
sbaidachni merged 2 commits into
sbaidachni/docker_docsfrom
copilot/sub-pr-87-0b6f0cd3-ace1-42fb-b545-19ecaafd1b45

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 2, 2026

_deploy_functions and _deploy_functions_withslot only caught subprocess.CalledProcessError, leaving FileNotFoundError unhandled when az is not installed or not on PATH — resulting in a cryptic traceback with no guidance.

Changes

  • _deploy_functions / _deploy_functions_withslot: Add FileNotFoundError catch block before CalledProcessError in both subprocess.run call sites, printing an actionable install/PATH message before re-raising.
except FileNotFoundError:
    print(
        "Error: 'az' CLI not found. Please install the Azure CLI and ensure it is on your PATH."
    )
    raise
except subprocess.CalledProcessError as e:
    print(f"Error deploying function app: {e}")
    raise

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: sbaidachni <10055252+sbaidachni@users.noreply.github.com>
Copilot AI changed the title [WIP] Update documentation and fix Docker issues Add FileNotFoundError handling for missing az CLI in function deployment Mar 2, 2026
@sbaidachni sbaidachni marked this pull request as ready for review March 2, 2026 20:25
@sbaidachni sbaidachni merged commit a9da77b into sbaidachni/docker_docs Mar 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants