AzureFunctionConnectionResolver class

Helper class to retrieve Azure connection and credential parameters, validate them and compose a AzureFunctionConnectionParams value.

Configuration parameters

  • connections:
    • uri: full connection uri with specific app and function name
    • protocol: connection protocol
    • app_name: alternative app name
    • function_name: application function name
  • credentials:
    • auth_code: authorization code or null if using custom auth

References

  • *:discovery:*:*:1.0 (optional) IDiscovery services to resolve connections
  • *:credential-store:*:*:1.0 (optional) Credential stores to resolve credentials

See ConnectionParams (in the Pip.Services components package) See IDiscovery (in the Pip.Services components package)

Example

var config = ConfigParams.fromTuples([
    'connection.uri', 'http://myapp.azurewebsites.net/api/myfunction',
    'connection.app_name', 'myapp',
    'connection.function_name', 'myfunction',
    'credential.auth_code', 'XXXXXXXXXX',
]);

var connectionResolver = AzureConnectionResolver();
connectionResolver.configure(config);
connectionResolver.setReferences(references);

final connectionParams = await connectionResolver.resolve(Context.fromTraceId('123'));
    // Now use connection...
Implemented types

Constructors

AzureFunctionConnectionResolver()

Properties

connectionResolver ConnectionResolver
The connection resolver.
final
credentialResolver CredentialResolver
The credential resolver.
final
hashCode int
The hash code for this object.
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

composeConnection(AzureFunctionConnectionParams connection) AzureFunctionConnectionParams
configure(ConfigParams config) → void
Configures component by passing configuration parameters.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolve(IContext? context) Future<AzureFunctionConnectionParams>
Resolves connection and credental parameters and generates a single AzureFunctionConnectionParams value.
setReferences(IReferences references) → void
Sets references to dependent components.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited