Skip to main content

AzureArmDeployer

@webda/azure


Abstract Class: AzureArmDeployer<T>

Defined in: azure/src/deployers/arm.service.ts:114

Shared template collection and ARM deployment. SDK clients are created only when deploying.

Extends​

Extended by​

Type Parameters​

T​

T extends AzureArmDeployerParameters = AzureArmDeployerParameters

Implements​

Constructors​

Constructor​

new AzureArmDeployer<T>(name, params): AzureArmDeployer<T>

Defined in: core/lib/services/service.d.ts:72

Create a new Service instance

Service

Parameters​

name​

string

The name of the service

params​

T

The parameters block define in the configuration file

Returns​

AzureArmDeployer<T>

Inherited from​

ContainerDeployer<T, AzureDeployResult>.constructor

Properties​

_compiledCapabilities​

protected _compiledCapabilities: Record<string, any>

Defined in: core/lib/services/iservice.d.ts:50

Capabilities detected at compile-time from @WebdaCapability-tagged interfaces.

Populated during Service.resolve by reading the service's entry in webda.module.json. Each key is a capability name (e.g., "request-filter"), and the value is an empty object {} by default. Override getCapabilities to provide capability-specific configuration or to conditionally disable capabilities.

See​

getCapabilities

Inherited from​

ContainerDeployer._compiledCapabilities


[WEBDA_EVENTS]​

[WEBDA_EVENTS]: object

Defined in: core/lib/services/service.d.ts:50

Set the Webda events here

Inherited from​

ContainerDeployer.[WEBDA_EVENTS]


contributedEnv​

protected contributedEnv: Record<string, string | { secretRef: string; }> = {}

Defined in: azure/src/deployers/arm.service.ts:137

Contributed env


logger​

protected logger: Logger

Defined in: core/lib/services/service.d.ts:59

Logger with class context

Inherited from​

ContainerDeployer.logger


metrics?​

protected optional metrics?: object

Defined in: core/lib/services/service.d.ts:63

Get metrics

Inherited from​

ContainerDeployer.metrics


name​

readonly name: string

Defined in: core/lib/services/iservice.d.ts:27

Name

Inherited from​

ContainerDeployer.name


parameters​

readonly parameters: T

Defined in: core/lib/services/iservice.d.ts:31

Parameters

Inherited from​

ContainerDeployer.parameters


resources​

resources: T

Defined in: azure/src/deployers/arm.service.ts:121

Resources

Implementation of​

AzureDeployerInfo.resources


result?​

optional result?: AzureDeployResult

Defined in: azure/src/deployers/arm.service.ts:129

Result


roles​

protected roles: AzureRoleAssignment[] = []

Defined in: azure/src/deployers/arm.service.ts:141

Roles


secretValues​

protected secretValues: Map<string, string | SecretString>

Defined in: azure/src/deployers/arm.service.ts:133

Secret values


template​

template: AzureTemplate

Defined in: azure/src/deployers/arm.service.ts:125

Template


createConfiguration?​

static optional createConfiguration?: (params) => any

Defined in: core/lib/services/iservice.d.ts:35

Create configuration set by the application on load

Parameters​

params​

any

Returns​

any

Inherited from​

ContainerDeployer.createConfiguration


filterConfiguration?​

static optional filterConfiguration?: (params) => any

Defined in: core/lib/services/iservice.d.ts:39

Create configuration set by the application on load

Parameters​

params​

any

Returns​

any

Inherited from​

ContainerDeployer.filterConfiguration


Parameters​

static Parameters: typeof ServiceParameters

Defined in: core/lib/services/service.d.ts:46

Service parameters

Inherited from​

ContainerDeployer.Parameters

Methods​

__clean()​

abstract __clean(): Promise<void>

Defined in: core/lib/services/service.d.ts:224

Clean the service data, can only be used in test mode

Returns​

Promise<void>

Inherited from​

ContainerDeployer.__clean


addListener()​

addListener<Key>(eventName, listener): this

Defined in: core/lib/events/asynceventemitter.d.ts:87

Add listener

Type Parameters​

Key​

Key extends never

Parameters​

eventName​

Key

the event name

listener​

(event) => void | Promise<void>

the event listener

Returns​

this

this for chaining

See​

EventEmitter.addListener

Inherited from​

ContainerDeployer.addListener


addResource()​

protected addResource(resource): void

Defined in: azure/src/deployers/arm.service.ts:229

Add a resource, rejecting conflicting declarations.

Parameters​

resource​

Record<string, any>

ARM resource declaration

Returns​

void


addRoute()​

protected addRoute(url, methods, executer, openapi?, override?): void

Defined in: core/lib/services/service.d.ts:177

Add a route dynamicaly

Parameters​

url​

string

of the route can contains dynamic part like {uuid}

methods​

HttpMethodType[]

the HTTP methods

executer​

Function

Method to execute for this route

openapi?​

OpenAPIWebdaDefinition

the OpenAPI specification

override?​

boolean

whether to override existing

Returns​

void

Inherited from​

ContainerDeployer.addRoute


authorizeClientEvent()​

authorizeClientEvent(_event, _context): boolean

Defined in: core/lib/services/service.d.ts:153

Authorize a public event subscription

Parameters​

_event​

string

the event name

_context​

OperationContext

the execution context

Returns​

boolean

true if the condition is met

Inherited from​

ContainerDeployer.authorizeClientEvent


build()​

build(output?): Promise<string>

Defined in: oci/lib/container.service.d.ts:173

Build the image into an OCI layout folder or tar archive

Load the archive with podman load -i <file> or copy it with skopeo copy oci-archive:<file> ....

Parameters​

output?​

string

Output folder, or tar archive when ending with .tar

Returns​

Promise<string>

the output path

Inherited from​

ContainerDeployer.build


buildImage()​

buildImage(parameters, output, includeBaseLayers): Promise<BuiltImage>

Defined in: oci/lib/container.service.d.ts:157

Build the image into an OCI layout

Parameters​

parameters​

ContainerDeployerParameters

the resolved parameters

output​

string

the layout folder

includeBaseLayers​

boolean

download the base layers into the layout

Returns​

Promise<BuiltImage>

the built image

Inherited from​

ContainerDeployer.buildImage


computeParameters()​

computeParameters(): void

Defined in: core/lib/services/service.d.ts:77

Used to compute or derivate input parameter to attribute

Returns​

void

Deprecated​

Inherited from​

ContainerDeployer.computeParameters


deploy()​

deploy(): Promise<string | AzureDeployResult>

Defined in: oci/lib/container.service.d.ts:187

Deploy the image: build and push it, so webda -d <deployment> deploy publishes it with the other units

Returns​

Promise<string | AzureDeployResult>

the pushed digest

Inherited from​

ContainerDeployer.deploy


emit()​

emit<Key>(event, data): Promise<void>

Defined in: core/lib/services/service.d.ts:213

Emit the event with data and wait for Promise to finish if listener returned a Promise

Type Parameters​

Key​

Key extends never

Parameters​

event​

Key

the event name

data​

object[Key]

the data to process

Returns​

Promise<void>

Inherited from​

ContainerDeployer.emit


generate()​

generate(output?): Promise<AzureTemplate>

Defined in: azure/src/deployers/arm.service.ts:280

Write a reviewable ARM template; this command never builds, pushes or deploys.

Parameters​

output?​

string

Optional template output path

Returns​

Promise<AzureTemplate>

Generated ARM template


generateTemplate()​

abstract generateTemplate(image?): AzureTemplate

Defined in: azure/src/deployers/arm.service.ts:187

Parameters​

image?​

string

Returns​

AzureTemplate


getAppPrincipalId()​

abstract getAppPrincipalId(): string

Defined in: azure/src/deployers/arm.service.ts:186

Return the ARM expression for the application principal.

Returns​

string

The app principal id result

Implementation of​

AzureDeployerInfo.getAppPrincipalId


getAppResourceId()​

abstract getAppResourceId(): string

Defined in: azure/src/deployers/arm.service.ts:174

Returns​

string


getCapabilities()​

getCapabilities(): Record<string, any>

Defined in: core/lib/services/iservice.d.ts:72

Return the capabilities of this service.

By default returns capabilities detected at compile-time from

Returns​

Record<string, any>

the result

Webda Capability-tagged​

interfaces in webda.module.json.

Override to disable capabilities based on configuration:

getCapabilities() {
const caps = super.getCapabilities();
if (!this.parameters.enabled) delete caps["request-filter"];
return caps;
}

Inherited from​

ContainerDeployer.getCapabilities


getClientEvents()​

getClientEvents(): string[]

Defined in: core/lib/services/service.d.ts:144

Return the events that an external system can subscribe to

Returns​

string[]

the list of results

Inherited from​

ContainerDeployer.getClientEvents


getDefaultTags()​

getDefaultTags(tags?): Record<string, string>

Defined in: azure/src/deployers/arm.service.ts:171

Merge deployment tags with resource tags.

Parameters​

tags?​

Record<string, string> = {}

Resource-specific tags

Returns​

Record<string, string>

The default tags result

Implementation of​

AzureDeployerInfo.getDefaultTags


getIdentityResourceId()​

protected getIdentityResourceId(): string

Defined in: azure/src/deployers/arm.service.ts:179

Return the managed identity resource identifier.

Returns​

string

The identity resource id result


getLayerEntries()​

getLayerEntries(parameters): Promise<TarEntry[]>

Defined in: oci/lib/container.service.d.ts:148

Files of the application layer: the packaged application under the working directory

Parameters​

parameters​

ContainerDeployerParameters

the resolved parameters

Returns​

Promise<TarEntry[]>

the layer entries

Inherited from​

ContainerDeployer.getLayerEntries


getMaxListeners()​

getMaxListeners(): number

Defined in: core/lib/events/asynceventemitter.d.ts:91

Returns​

number

Inherited from​

ContainerDeployer.getMaxListeners


getMetric()​

getMetric<T>(type, configuration): T

Defined in: core/lib/services/service.d.ts:138

Add service name label

Type Parameters​

T​

T = Gauge<string> | Counter<string> | Histogram<string>

Parameters​

type​

CustomConstructor<T, [MetricConfiguration<T>]>

the type to look up

configuration​

MetricConfiguration<T>

the configuration

Returns​

T

the result

Inherited from​

ContainerDeployer.getMetric


getName()​

getName(): string

Defined in: core/lib/services/service.d.ts:218

Get service name

Returns​

string

the result string

Inherited from​

ContainerDeployer.getName


getOpenApiReplacements()​

getOpenApiReplacements(): any

Defined in: core/lib/services/service.d.ts:182

Return variables for replacement in openapi

Returns​

any

the result

Inherited from​

ContainerDeployer.getOpenApiReplacements


getOperationId()​

getOperationId(id): string | undefined

Defined in: core/lib/services/service.d.ts:167

If undefined is returned it cancel the operation registration

Parameters​

id​

string

the identifier

Returns​

string | undefined

the result

Inherited from​

ContainerDeployer.getOperationId


getParameters()​

getParameters(): T

Defined in: core/lib/services/service.d.ts:82

Get the service parameters

Returns​

T

the result

Inherited from​

ContainerDeployer.getParameters


getResolvedParameters()​

getResolvedParameters(): T

Defined in: azure/src/deployers/arm.service.ts:147

Perform get resolved parameters.

Returns​

T

Overrides​

ContainerDeployer.getResolvedParameters


getService()​

getService<T>(name): ServicesMap[T]

Defined in: core/lib/services/service.d.ts:131

Get a service by name

Type Parameters​

T​

T extends keyof ServicesMap

Parameters​

name​

T

the name to use

Returns​

ServicesMap[T]

the result map

Deprecated​

Use useService, might reconsider

Inherited from​

ContainerDeployer.getService


getState()​

getState(): ServiceStates

Defined in: core/lib/services/service.d.ts:55

Get the current state

Returns​

ServiceStates

the result

Inherited from​

ContainerDeployer.getState


getUrl()​

getUrl(url, _methods): string

Defined in: core/lib/services/service.d.ts:161

Return the full path url based on parameters

Parameters​

url​

string

relative url to service

_methods​

HttpMethodType[]

in case we need filtering (like Store)

Returns​

string

absolute url or undefined if need to skip the Route

Inherited from​

ContainerDeployer.getUrl


grantRoles()​

protected grantRoles(principalId?, identityResourceId?): void

Defined in: azure/src/deployers/arm.service.ts:247

Grant every contributed role to one application or job identity.

Parameters​

principalId?​

string = ...

ARM principal identifier expression

identityResourceId?​

string = ...

Resource providing the managed identity

Returns​

void


init()​

abstract init(): Promise<AzureArmDeployer<T>>

Defined in: core/lib/services/service.d.ts:207

Will be called after all the Services are created

Returns​

Promise<AzureArmDeployer<T>>

Inherited from​

ContainerDeployer.init


initMetrics()​

initMetrics(): void

Defined in: core/lib/services/service.d.ts:124

Init the metrics

Returns​

void

Inherited from​

ContainerDeployer.initMetrics


initOperations()​

initOperations(): void

Defined in: core/lib/services/service.d.ts:195

Init the operations from

Returns​

void

Operation​

decorators on this service

Inherited from​

ContainerDeployer.initOperations


listeners()​

listeners(eventName): Function[]

Defined in: core/lib/events/asynceventemitter.d.ts:151

Get all listeners for an event

Parameters​

eventName​

never

the event name

Returns​

Function[]

the list of results

Inherited from​

ContainerDeployer.listeners


loadCapabilities()​

protected loadCapabilities(): void

Defined in: core/lib/services/service.d.ts:120

Load capabilities from webda.module.json metadata into _compiledCapabilities.

Called during resolve after dependency injection. Reads the service's type name from parameters, looks it up in the application's module metadata (moddas or beans section), and populates _compiledCapabilities with an empty object for each declared capability name.

Fails silently if the application is not available (e.g., in unit tests where services are instantiated without a full application context).

Returns​

void

Example​

// If webda.module.json contains:
// { "moddas": { "MyApp/HawkService": { "capabilities": ["request-filter", "cors-filter"] } } }
// Then after resolve(), this.getCapabilities() returns:
// { "request-filter": {}, "cors-filter": {} }

See​

getCapabilities

Inherited from​

ContainerDeployer.loadCapabilities


log()​

log(level, ...args): void

Defined in: core/lib/services/service.d.ts:236

Log operation

Parameters​

level​

WorkerLogLevel

to log

args​

...any[]

additional arguments

Returns​

void

Inherited from​

ContainerDeployer.log


off()​

off<Key>(eventName, listener): this

Defined in: core/lib/events/asynceventemitter.d.ts:127

Perform off

Type Parameters​

Key​

Key extends never

Parameters​

eventName​

Key

the event name

listener​

(event) => void

the event listener

Returns​

this

this for chaining

See​

EventEmitter.off

Inherited from​

ContainerDeployer.off


on()​

on<Key>(eventName, listener): this

Defined in: core/lib/events/asynceventemitter.d.ts:111

Perform on

Type Parameters​

Key​

Key extends never

Parameters​

eventName​

Key

the event name

listener​

(event) => void

the event listener

Returns​

this

this for chaining

See​

EventEmitter.once

Inherited from​

ContainerDeployer.on


once()​

once<Key>(eventName, listener): this

Defined in: core/lib/events/asynceventemitter.d.ts:103

Perform once

Type Parameters​

Key​

Key extends never

Parameters​

eventName​

Key

the event name

listener​

(event) => void

the event listener

Returns​

this

this for chaining

See​

EventEmitter.once

Inherited from​

ContainerDeployer.once


operationSchemaName()​

protected operationSchemaName(method, side): string

Defined in: core/lib/services/service.d.ts:191

Schema of an operation side: <service name>.<method>.<side> when the application knows it, else the one the build writes, <class>.<method>.<side>, for the class or its nearest ancestor that has it (a service configured under another name than its class)

Parameters​

method​

string

the method name

side​

"input" | "output"

input or output

Returns​

string

the schema name

Inherited from​

ContainerDeployer.operationSchemaName


prepare()​

protected prepare(): void

Defined in: azure/src/deployers/arm.service.ts:154

Resolve the deployment scope and reset template state.

Returns​

void


push()​

push(): Promise<string>

Defined in: oci/lib/container.service.d.ts:181

Build the image and push it with its tags

Base layers are mounted or copied registry to registry, they are not stored locally.

Returns​

Promise<string>

the pushed digest

Inherited from​

ContainerDeployer.push


removeAllListeners()​

removeAllListeners<Key>(eventName?): this

Defined in: core/lib/events/asynceventemitter.d.ts:134

Remove all listeners

Type Parameters​

Key​

Key extends never

Parameters​

eventName?​

Key

the event name

Returns​

this

this for chaining

See​

EventEmitter.removeAllListeners

Inherited from​

ContainerDeployer.removeAllListeners


removeListener()​

removeListener<Key>(eventName, listener): this

Defined in: core/lib/events/asynceventemitter.d.ts:119

Remove listener

Type Parameters​

Key​

Key extends never

Parameters​

eventName​

Key

the event name

listener​

(event) => void

the event listener

Returns​

this

this for chaining

See​

EventEmitter.removeListener

Inherited from​

ContainerDeployer.removeListener


resolve()​

resolve(): this

Defined in: core/lib/services/service.d.ts:98

Resolve parameters and load metadata. @Route-declared routes are scanned and registered by Router.discoverRoutes(services) from Core.init() once every service has resolved — nothing to do per-service here.

Returns​

this

the result

Inherited from​

ContainerDeployer.resolve


resolveOutput()​

protected resolveOutput(output): string

Defined in: oci/lib/container.service.d.ts:164

Resolve the output path against the application folder

Parameters​

output​

string

the output from the parameters or the command line

Returns​

string

the absolute path

Inherited from​

ContainerDeployer.resolveOutput


Resources()​

Resources(): void

Defined in: azure/src/deployers/arm.service.ts:204

Merge service resources, environment and roles. Conflicting contributions are rejected.

Returns​

void


secureParameter()​

protected secureParameter(value): string

Defined in: azure/src/deployers/arm.service.ts:194

Add a secret without placing its value in the serializable template.

Parameters​

value​

string | SecretString

Value to convert or protect

Returns​

string

The secure parameter result


sendTemplate()​

sendTemplate(): Promise<Record<string, any>>

Defined in: azure/src/deployers/arm.service.ts:302

Deploy the ARM template with secure parameter values.

Returns​

Promise<Record<string, any>>

Deployment outputs


setMaxListeners()​

setMaxListeners(n): this

Defined in: core/lib/events/asynceventemitter.d.ts:95

Parameters​

n​

number

Returns​

this

Inherited from​

ContainerDeployer.setMaxListeners


stop()​

stop(): Promise<void>

Defined in: core/lib/services/service.d.ts:86

Shutdown the current service if action need to be taken

Returns​

Promise<void>

Inherited from​

ContainerDeployer.stop


toJSON()​

toJSON(): string

Defined in: core/lib/services/service.d.ts:200

Prevent service to be serialized

Returns​

string

the result

Inherited from​

ContainerDeployer.toJSON


toString()​

toString(): string

Defined in: core/lib/services/service.d.ts:91

Return service representation

Returns​

string

the result

Inherited from​

ContainerDeployer.toString


writeTemplate()​

protected writeTemplate(output?): void

Defined in: azure/src/deployers/arm.service.ts:289

Save the current template with secure parameters left as references.

Parameters​

output?​

string

Optional template output path

Returns​

void