CommandableAzureFunction

Abstract Azure Function function that acts as a container to instantiate and run components and expose them via an external entry point.

Implements: AzureFunction

Description

The CommandableAzureFunction allows you to create an abstract Azure Function function that acts as a container to instantiate and run components and expose them via an external entry point.

Important points

  • All actions are automatically generated for commands defined in ICommandable components. Each command is exposed as an action defined by the “cmd” parameter.

  • Container configuration for this Azure Function is stored in "./config/config.yml" file. But this path can be overridden by the CONFIG_PATH environment variable.

  • Note: This component has been deprecated. Use Azure FunctionController instead.

References

  • *:logger:*:*:1.0: (optional) ILogger components to pass log messages
  • *:counters:*:*:1.0: (optional) ICounters components to pass collected measurements
  • *:controller:azure-function:*:1.0: (optional) IAzureFunctionController controllers to handle action requests.
  • *:controller:commandable-azure-function:*:1.0: (optional) IAzureFunctionController controllers to handle action requests.

Constructors

Creates a new instance of this Azure Function.

AzureFunction(name: Optional[str], description: Optional[str])

  • name: Optional[str] - (optional) container’s name (accessible via ContextInfo)
  • description: Optional[str] - (optional) container’s description (accessible via ContextInfo)

Instance methods

_get_parameters

Returns body from Azure Function context. This method can be overloaded in child classes

_get_parameters(context: HttpRequest): Parameters

register

Registers all actions in this Azure Function.

register(): void

Examples

class MyAzureFunctionFunction(CommandableAzureFunction):
    def __init__(self):
        super().__init__("mygroup", "MyGroup AzureFunction")
        self._dependency_resolver.put("controller", Descriptor("mygroup", "controller", "*", "*", "1.0"))

azure_function = MyAzureFunctionFunction()
controller.run()
print("MyAzureFunction is started")