🧠API Reference
CLI
doctor(path='.', verbose=False, debug=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
|
Annotated[bool, Option(-v, --verbose, help='Show detailed hints for failed checks')]
|
Show detailed hints for failed checks. |
False
|
debug
|
Annotated[bool, Option(help='Enable debug logging')]
|
Enable debug logging to stderr. |
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
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 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
|
Doctor
Doctor(path='.', allow_v1=False)
Diagnostic runner for Azure Functions apps.
Loads checks from model-specific rule assets located in
azure_functions_doctor.assets.rules.v1.json
and v2.json
. Legacy
rules.json
support has been removed; callers should ensure the
appropriate v1/v2 files are present in package assets.
Source code in src/azure_functions_doctor/doctor.py
39 40 41 42 43 44 45 46 47 48 |
|
load_rules()
Load rules based on detected programming model.
Source code in src/azure_functions_doctor/doctor.py
85 86 87 88 89 90 91 92 |
|
Handlers
HandlerRegistry()
Registry for diagnostic check handlers with individual handler methods.
Source code in src/azure_functions_doctor/handlers.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
|
handle(rule, path)
Route rule execution to appropriate handler.
Source code in src/azure_functions_doctor/handlers.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
|
generic_handler(rule, path)
Execute a diagnostic rule based on its type and condition.
This function maintains backward compatibility while delegating to the registry.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rule
|
Rule
|
The diagnostic rule to execute. |
required |
path
|
Path
|
Path to the Azure Functions project. |
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
501 502 503 504 505 506 507 508 509 510 511 512 513 514 |
|
Configuration
Configuration management for Azure Functions Doctor.
Config()
Centralized configuration management with environment variable support.
Source code in src/azure_functions_doctor/config.py
27 28 29 30 |
|
get(key, default=None)
Get configuration value by key.
Source code in src/azure_functions_doctor/config.py
64 65 66 |
|
get_custom_rules_path()
Get custom rules file path from environment.
Source code in src/azure_functions_doctor/config.py
106 107 108 109 110 111 112 113 114 |
|
get_log_format()
Get logging format style.
Source code in src/azure_functions_doctor/config.py
78 79 80 |
|
get_log_level()
Get logging level.
Source code in src/azure_functions_doctor/config.py
74 75 76 |
|
get_max_file_size_mb()
Get maximum file size for processing in MB.
Source code in src/azure_functions_doctor/config.py
82 83 84 |
|
get_output_width()
Get output width for formatting.
Source code in src/azure_functions_doctor/config.py
94 95 96 |
|
get_rules_file()
Get rules file name.
Source code in src/azure_functions_doctor/config.py
90 91 92 |
|
get_search_timeout_seconds()
Get search operation timeout in seconds.
Source code in src/azure_functions_doctor/config.py
86 87 88 |
|
is_colors_enabled()
Check if color output is enabled.
Source code in src/azure_functions_doctor/config.py
98 99 100 |
|
is_parallel_execution_enabled()
Check if parallel execution is enabled.
Source code in src/azure_functions_doctor/config.py
102 103 104 |
|
set(key, value)
Set configuration value.
Source code in src/azure_functions_doctor/config.py
68 69 70 71 72 |
|
to_dict()
Return configuration as dictionary.
Source code in src/azure_functions_doctor/config.py
116 117 118 |
|
get_config()
Get the global configuration instance.
Source code in src/azure_functions_doctor/config.py
125 126 127 |
|
override_config(**kwargs)
Override configuration values (useful for testing).
Source code in src/azure_functions_doctor/config.py
130 131 132 133 |
|
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
9 10 11 12 13 14 15 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 |
|
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
55 56 57 58 59 60 61 62 63 64 65 66 67 |
|
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
40 41 42 43 44 45 46 47 48 49 50 51 52 |
|
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: A string icon such as ✓, !, or ✗.
Source code in src/azure_functions_doctor/utils.py
27 28 29 30 31 32 33 34 35 36 37 |
|