🧠API Reference
CLI
doctor(path='.', verbose=False, debug=False, format='table', output=None, profile=None, rules=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', 'json', 'sarif', or 'junit'")]
|
Output format: 'table', 'json', 'sarif', or 'junit'. |
'table'
|
output
|
Annotated[Optional[Path], Option(help='Optional path to save output result')]
|
Optional file path to save output result. |
None
|
profile
|
Annotated[Optional[str], Option(help="Rule profile: 'minimal' or 'full'")]
|
Optional rule profile ('minimal' or 'full'). |
None
|
rules
|
Annotated[Optional[Path], Option(help='Optional path to a custom rules.json')]
|
Optional path to a custom rules.json. |
None
|
Source code in src/azure_functions_doctor/cli.py
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 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 | |
Doctor
Doctor(path='.', allow_v1=False, profile=None, rules_path=None)
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
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
load_rules()
Load and validate rules based on detected programming model or custom path.
Source code in src/azure_functions_doctor/doctor.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 | |
Handlers
HandlerRegistry()
Registry for diagnostic check handlers with individual handler methods.
Source code in src/azure_functions_doctor/handlers.py
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | |
handle(rule, path)
Route rule execution to appropriate handler.
Source code in src/azure_functions_doctor/handlers.py
165 166 167 168 169 170 171 172 173 174 175 176 177 178 | |
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
596 597 598 599 600 601 602 603 604 605 606 607 608 609 | |
Configuration
Configuration management for Azure Functions Doctor.
Environment variables with FUNC_DOCTOR_ prefix (e.g. FUNC_DOCTOR_LOG_LEVEL) are loaded into Config. These options are reserved for future use; the CLI currently configures logging via logging_config.setup_logging() and does not read from Config. When wiring Config into the CLI/Doctor (e.g. max_file_size_mb, search_timeout_seconds), update this module and the CLI entry point.
Config()
Centralized configuration management with environment variable support.
Options (max_file_size_mb, search_timeout_seconds, etc.) are for future use; not yet wired into the CLI or Doctor. Use get_config() to access the global instance.
Source code in src/azure_functions_doctor/config.py
38 39 40 41 | |
get(key, default=None)
Get configuration value by key.
Source code in src/azure_functions_doctor/config.py
75 76 77 | |
get_custom_rules_path()
Get custom rules file path from environment.
Source code in src/azure_functions_doctor/config.py
117 118 119 120 121 122 123 124 125 | |
get_log_format()
Get logging format style.
Source code in src/azure_functions_doctor/config.py
89 90 91 | |
get_log_level()
Get logging level.
Source code in src/azure_functions_doctor/config.py
85 86 87 | |
get_max_file_size_mb()
Get maximum file size for processing in MB.
Source code in src/azure_functions_doctor/config.py
93 94 95 | |
get_output_width()
Get output width for formatting.
Source code in src/azure_functions_doctor/config.py
105 106 107 | |
get_rules_file()
Get rules file name.
Source code in src/azure_functions_doctor/config.py
101 102 103 | |
get_search_timeout_seconds()
Get search operation timeout in seconds.
Source code in src/azure_functions_doctor/config.py
97 98 99 | |
is_colors_enabled()
Check if color output is enabled.
Source code in src/azure_functions_doctor/config.py
109 110 111 | |
is_parallel_execution_enabled()
Check if parallel execution is enabled.
Source code in src/azure_functions_doctor/config.py
113 114 115 | |
set(key, value)
Set configuration value.
Source code in src/azure_functions_doctor/config.py
79 80 81 82 83 | |
to_dict()
Return configuration as dictionary.
Source code in src/azure_functions_doctor/config.py
127 128 129 | |
get_config()
Get the global configuration instance.
Source code in src/azure_functions_doctor/config.py
136 137 138 | |
override_config(**kwargs)
Override configuration values (useful for testing).
Source code in src/azure_functions_doctor/config.py
141 142 143 144 | |
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 | |