🧠 API Reference
CLI
diagnose(path='.', verbose=False, format='table', output=None)
Run diagnostics on an Azure Functions application.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
Path to the Azure Functions app. Defaults to current directory. |
'.'
|
verbose
|
bool
|
Show detailed hints for failed checks. |
False
|
format
|
Annotated[str, Option(help="Output format: 'table' or 'json'")]
|
Output format: 'table' or 'json'. |
'table'
|
output
|
Annotated[Optional[Path], Option(help='Optional path to save JSON result')]
|
Optional file path to save JSON result. |
None
|
Source code in src/azure_functions_doctor/cli.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
|
Doctor
Doctor(path='.')
Diagnostic runner for Azure Functions apps. Loads checks from rules.json and executes them against a target project path.
Source code in src/azure_functions_doctor/doctor.py
31 32 |
|
Handlers
generic_handler(rule, path)
Execute a diagnostic rule based on its type and condition.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rule
|
Rule
|
The diagnostic rule to execute. |
required |
Returns:
Type | Description |
---|---|
dict[str, str]
|
A dictionary with the status and detail of the check. |
Source code in src/azure_functions_doctor/handlers.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
|
Check Logic
run_check(rule, base_path)
Wrap the generic_handler to cast a raw rule into a typed Rule.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rule
|
dict[str, Any]
|
Dictionary parsed from rules.json |
required |
base_path
|
Path
|
Path to Azure Functions app |
required |
Returns:
Type | Description |
---|---|
CheckResult
|
Structured result with status, label, value, and optional hint. |
Source code in src/azure_functions_doctor/check.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
|
Target Resolver
resolve_target_value(target)
Resolve the current value of a target used in version comparison or diagnostics.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target
|
str
|
The name of the target to resolve. Examples include "python" or "func_core_tools". |
required |
Returns:
Type | Description |
---|---|
str
|
A string representing the resolved version or value. |
Raises:
Type | Description |
---|---|
ValueError
|
If the target is not recognized. |
Source code in src/azure_functions_doctor/target_resolver.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
Utility
format_detail(status, value)
Return a colored Text element based on status and value.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
status
|
str
|
Diagnostic status ("pass", "fail", "warn"). |
required |
value
|
str
|
Text to display, typically a description. |
required |
Returns:
Type | Description |
---|---|
Text
|
A Rich Text object styled with status color. |
Source code in src/azure_functions_doctor/utils.py
54 55 56 57 58 59 60 61 62 63 64 65 66 |
|
format_result(status)
Return a styled icon Text element based on status.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
status
|
str
|
Diagnostic status ("pass", "fail", "warn"). |
required |
Returns:
Type | Description |
---|---|
Text
|
A Rich Text object with icon and style for headers. |
Source code in src/azure_functions_doctor/utils.py
39 40 41 42 43 44 45 46 47 48 49 50 51 |
|
format_status_icon(status)
Return a simple icon character based on status.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
status
|
str
|
Diagnostic status ("pass", "fail", "warn"). |
required |
Returns:
Type | Description |
---|---|
str
|
A string icon such as ✔, ✖, or ⚠. |
Source code in src/azure_functions_doctor/utils.py
26 27 28 29 30 31 32 33 34 35 36 |
|