pip_services3_azure.containers package

Submodules

Module contents

class pip_services3_azure.containers.AzureFunction(name: Optional[str], description: Optional[str])

Bases: pip_services3_container.Container.Container

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

When handling calls “cmd” parameter determines which what action shall be called, while other parameters are passed to the action itself.

Container configuration for this Azure Function is stored in “./config/config.yml” file. But this path can be overriden by CONFIG_PATH environment variable.

### References ###
  • *:logger:*:*:1.0 (optional) ILogger components to pass log messages

  • *:counters:*:*:1.0 (optional) ICounters components to pass collected measurements

  • *:ervice:azure-function:*:*:1.0 (optional) IAzureFunctionService services to handle action requests

  • *:service:commandable-azure-function:*:*:1.0 (optional) IAzureFunctionService services to handle action requests

Example:

act(context: azure.functions._http.HttpRequest) azure.functions._http.HttpResponse

Calls registered action in this Azure Function. “cmd” parameter in the action parameters determin what action shall be called.

This method shall only be used in testing.

Parameters

context – action parameters.

Returns

action result

get_handler() Callable[[azure.functions._http.HttpRequest], azure.functions._http.HttpResponse]
open(correlation_id: Optional[str])

Opens the component.

Parameters

correlation_id – (optional) transaction id to trace execution through call chain.

register()

Registers all actions in this Azure Function.

Note: Overloading of this method has been deprecated. Use AzureFunctionService instead.

run()

Runs this Azure Function, loads container configuration, instantiate components and manage their lifecycle, makes this function ready to access action calls.

set_references(references: pip_services3_commons.refer.IReferences.IReferences)

Sets references to dependent components.

Parameters

references – references to locate the component dependencies.

class pip_services3_azure.containers.AzureFunctionContextHelper

Bases: object

static get_command(context: azure.functions._http.HttpRequest) str

Returns command from Azure Function context.

Parameters

context – the Azure Function context

Returns

returns command from context

static get_correlation_id(context: azure.functions._http.HttpRequest) str

Returns correlationId from Azure Function context.

Parameters

context – the Azure Function context

Returns

returns correlationId from context

static get_parameters(context: azure.functions._http.HttpRequest) pip_services3_commons.run.Parameters.Parameters

Returns body from Azure Function context http request.

Parameters

context – the Azure Function context

Returns

returns body from context

class pip_services3_azure.containers.CommandableAzureFunction(name: Optional[str], description: Optional[str])

Bases: pip_services3_azure.containers.AzureFunction.AzureFunction

Abstract Azure Function function, that acts as a container to instantiate and run components and expose them via external entry point. All actions are automatically generated for commands defined in ICommandable. Each command is exposed as an action defined by “cmd” parameter.

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

Note: This component has been deprecated. Use Azure FunctionService instead.

### References ###
  • *:logger:*:*:1.0: (optional) ILogger components to pass log messages

  • *:counters:*:*:1.0: (optional) ICounters components to pass collected measurements

  • *:service:azure-function:*:1.0: (optional) IAzureFunctionService services to handle action requests

  • *:service:commandable-azure-function:*:1.0: (optional) IAzureFunctionService services to handle action requests

Example:

register()

Registers all actions in this Azure Function.