你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
SettingsApi Class
Interface to extend for using existing settings decorator in functions.
- Inheritance
-
SettingsApiSettingsApi
Constructor
SettingsApi(*args, **kwargs)
Methods
function_name |
Optional: Sets name of the Function object. If not set, it will default to the name of the method name. additional setting fields :return: Decorator function. |
http_type |
Set http type of the Function object. |
retry |
The retry decorator adds <xref:azure.functions.RetryPolicy> to the function settings object for building Function object used in worker function indexing model. This is equivalent to defining RetryPolicy in the function.json which enables function to retry on failure. All optional fields will be given default value by function host when they are parsed by function host. Ref: https://aka.ms/azure_functions_retries attempts. :param maximum_interval: The maximum delay interval between retry attempts. :param setting_extra_fields: Keyword arguments for specifying additional setting fields. :return: Decorator function. |
function_name
Optional: Sets name of the Function object. If not set, it will default to the name of the method name.
additional setting fields :return: Decorator function.
function_name(name: str, setting_extra_fields: Dict[str, Any] | None = None) -> Callable[[...], Any]
Parameters
Name | Description |
---|---|
name
Required
|
Name of the function. |
setting_extra_fields
Required
|
Keyword arguments for specifying Default value: None
|
http_type
Set http type of the Function object.
http_type(http_type: str) -> Callable[[...], Any]
Parameters
Name | Description |
---|---|
http_type
Required
|
Http type of the function. |
Returns
Type | Description |
---|---|
Decorator function. |
retry
The retry decorator adds <xref:azure.functions.RetryPolicy> to the function settings object for building Function object used in worker function indexing model. This is equivalent to defining RetryPolicy in the function.json which enables function to retry on failure. All optional fields will be given default value by function host when they are parsed by function host.
Ref: https://aka.ms/azure_functions_retries
attempts. :param maximum_interval: The maximum delay interval between retry attempts. :param setting_extra_fields: Keyword arguments for specifying additional setting fields. :return: Decorator function.
retry(strategy: str, max_retry_count: str, delay_interval: str | None = None, minimum_interval: str | None = None, maximum_interval: str | None = None, setting_extra_fields: Dict[str, Any] | None = None) -> Callable[[...], Any]
Parameters
Name | Description |
---|---|
strategy
Required
|
The retry strategy to use. |
max_retry_count
Required
|
The maximum number of retry attempts. |
delay_interval
Required
|
The delay interval between retry attempts. Default value: None
|
minimum_interval
Required
|
The minimum delay interval between retry Default value: None
|
maximum_interval
Required
|
Default value: None
|
setting_extra_fields
Required
|
Default value: None
|
Attributes
app_script_file
Name of function app script file in which all the functions are defined.
Script file defined here is for placeholder purpose, please refer to worker defined script file path as the single point of truth.
Returns
Type | Description |
---|---|
Script file name. |