@webda/azure 0.0.0-stage → 4.0.0-beta.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +166 -0
- package/README.md +248 -2
- package/lib/auth.d.ts +30 -0
- package/lib/auth.d.ts.map +1 -0
- package/lib/auth.js +70 -0
- package/lib/auth.js.map +1 -0
- package/lib/deployers/arm.service.d.ts +108 -0
- package/lib/deployers/arm.service.d.ts.map +1 -0
- package/lib/deployers/arm.service.js +280 -0
- package/lib/deployers/arm.service.js.map +1 -0
- package/lib/deployers/containerapps.service.d.ts +156 -0
- package/lib/deployers/containerapps.service.d.ts.map +1 -0
- package/lib/deployers/containerapps.service.js +455 -0
- package/lib/deployers/containerapps.service.js.map +1 -0
- package/lib/deployers/functions-entrypoint.d.ts +48 -0
- package/lib/deployers/functions-entrypoint.d.ts.map +1 -0
- package/lib/deployers/functions-entrypoint.js +78 -0
- package/lib/deployers/functions-entrypoint.js.map +1 -0
- package/lib/deployers/functions.service.d.ts +66 -0
- package/lib/deployers/functions.service.d.ts.map +1 -0
- package/lib/deployers/functions.service.js +322 -0
- package/lib/deployers/functions.service.js.map +1 -0
- package/lib/deployers/functionspackager.service.d.ts +43 -0
- package/lib/deployers/functionspackager.service.d.ts.map +1 -0
- package/lib/deployers/functionspackager.service.js +151 -0
- package/lib/deployers/functionspackager.service.js.map +1 -0
- package/lib/index.d.ts +15 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +18 -0
- package/lib/index.js.map +1 -0
- package/lib/services/azure-parameters.d.ts +41 -0
- package/lib/services/azure-parameters.d.ts.map +1 -0
- package/lib/services/azure-parameters.js +43 -0
- package/lib/services/azure-parameters.js.map +1 -0
- package/lib/services/blob.service.d.ts +157 -0
- package/lib/services/blob.service.d.ts.map +1 -0
- package/lib/services/blob.service.js +428 -0
- package/lib/services/blob.service.js.map +1 -0
- package/lib/services/contributors.d.ts +47 -0
- package/lib/services/contributors.d.ts.map +1 -0
- package/lib/services/contributors.js +2 -0
- package/lib/services/contributors.js.map +1 -0
- package/lib/services/cosmos.service.d.ts +211 -0
- package/lib/services/cosmos.service.d.ts.map +1 -0
- package/lib/services/cosmos.service.js +554 -0
- package/lib/services/cosmos.service.js.map +1 -0
- package/lib/services/functionserver.service.d.ts +42 -0
- package/lib/services/functionserver.service.d.ts.map +1 -0
- package/lib/services/functionserver.service.js +223 -0
- package/lib/services/functionserver.service.js.map +1 -0
- package/lib/services/keyvault.service.d.ts +91 -0
- package/lib/services/keyvault.service.d.ts.map +1 -0
- package/lib/services/keyvault.service.js +225 -0
- package/lib/services/keyvault.service.js.map +1 -0
- package/lib/services/monitorlogger.service.d.ts +66 -0
- package/lib/services/monitorlogger.service.d.ts.map +1 -0
- package/lib/services/monitorlogger.service.js +131 -0
- package/lib/services/monitorlogger.service.js.map +1 -0
- package/lib/services/servicebus.service.d.ts +128 -0
- package/lib/services/servicebus.service.d.ts.map +1 -0
- package/lib/services/servicebus.service.js +324 -0
- package/lib/services/servicebus.service.js.map +1 -0
- package/lib/template.d.ts +53 -0
- package/lib/template.d.ts.map +1 -0
- package/lib/template.js +74 -0
- package/lib/template.js.map +1 -0
- package/package.json +77 -3
- package/webda.module.json +1817 -0
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
2
|
+
var useValue = arguments.length > 2;
|
|
3
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
4
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
5
|
+
}
|
|
6
|
+
return useValue ? value : void 0;
|
|
7
|
+
};
|
|
8
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
9
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
10
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
11
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
12
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
13
|
+
var _, done = false;
|
|
14
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
15
|
+
var context = {};
|
|
16
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
17
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
18
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
19
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
20
|
+
if (kind === "accessor") {
|
|
21
|
+
if (result === void 0) continue;
|
|
22
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
23
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
24
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
25
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
26
|
+
}
|
|
27
|
+
else if (_ = accept(result)) {
|
|
28
|
+
if (kind === "field") initializers.unshift(_);
|
|
29
|
+
else descriptor[key] = _;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
33
|
+
done = true;
|
|
34
|
+
};
|
|
35
|
+
import { Command, CronService, getDeploymentVariables, SecretString, WebdaError } from "@webda/core";
|
|
36
|
+
import { formatImageReference, parseImageReference } from "@webda/oci";
|
|
37
|
+
import { AzureAuth } from "../auth.js";
|
|
38
|
+
import { armValue, containerAppsSchedule, resourceId, roleAssignmentId, createAzureTemplate } from "../template.js";
|
|
39
|
+
import { createHash } from "node:crypto";
|
|
40
|
+
import { AzureArmDeployer, AzureArmDeployerParameters } from "./arm.service.js";
|
|
41
|
+
export const AZURE_SECTIONS = ["LogAnalytics", "ManagedEnvironment", "ContainerApp", "Jobs", "Resources"];
|
|
42
|
+
/** Azure Container Apps unit parameters. Image tags and Azure resource tags are separate. */
|
|
43
|
+
export class AzureContainerAppsDeployerParameters extends AzureArmDeployerParameters {
|
|
44
|
+
constructor() {
|
|
45
|
+
super(...arguments);
|
|
46
|
+
this.registryAuth = "aad";
|
|
47
|
+
this.containerApp = {};
|
|
48
|
+
this.environment = {};
|
|
49
|
+
this.logAnalytics = {};
|
|
50
|
+
this.secrets = {};
|
|
51
|
+
this.customDomains = [];
|
|
52
|
+
this.crons = true;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/** Build an OCI image and deploy its immutable digest to Azure Container Apps.
|
|
56
|
+
* @WebdaModda
|
|
57
|
+
*/
|
|
58
|
+
let AzureContainerAppsDeployer = (() => {
|
|
59
|
+
var _a;
|
|
60
|
+
let _classSuper = AzureArmDeployer;
|
|
61
|
+
let _instanceExtraInitializers = [];
|
|
62
|
+
let _generate_decorators;
|
|
63
|
+
let _push_decorators;
|
|
64
|
+
let _deploy_decorators;
|
|
65
|
+
return _a = class AzureContainerAppsDeployer extends _classSuper {
|
|
66
|
+
constructor() {
|
|
67
|
+
super(...arguments);
|
|
68
|
+
this.image = (__runInitializers(this, _instanceExtraInitializers), "");
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Write the generated ARM template for review.
|
|
72
|
+
* @param output - Optional template output path
|
|
73
|
+
* @returns Generated ARM template
|
|
74
|
+
*/
|
|
75
|
+
async generate(output) {
|
|
76
|
+
return super.generate(output);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Perform get resolved parameters.
|
|
80
|
+
* @override
|
|
81
|
+
*/
|
|
82
|
+
getResolvedParameters() {
|
|
83
|
+
var _b, _c;
|
|
84
|
+
const p = super.getResolvedParameters();
|
|
85
|
+
const name = this.getName()
|
|
86
|
+
.toLowerCase()
|
|
87
|
+
.replace(/[^a-z0-9-]/g, "-")
|
|
88
|
+
.replace(/^-+|-+$/g, "")
|
|
89
|
+
.slice(0, 32);
|
|
90
|
+
(_b = p.containerApp).name ?? (_b.name = name);
|
|
91
|
+
(_c = p.environment).name ?? (_c.name = p.environment.id && !p.environment.id.startsWith("[")
|
|
92
|
+
? p.environment.id.split("/").slice(-1)[0]
|
|
93
|
+
: `${p.resourceGroup}-env`);
|
|
94
|
+
if (!p.image && p.registry) {
|
|
95
|
+
const packageName = getDeploymentVariables(this).package.name?.replace(/^@[^/]+\//, "") ?? name;
|
|
96
|
+
p.image = `${p.registry}.azurecr.io/${packageName.toLowerCase()}`;
|
|
97
|
+
}
|
|
98
|
+
if (!p.image)
|
|
99
|
+
throw new WebdaError.BadRequest("Container Apps requires image or registry");
|
|
100
|
+
if (!/^[a-z][a-z0-9-]{0,30}[a-z0-9]$/.test(p.containerApp.name))
|
|
101
|
+
throw new WebdaError.BadRequest("Invalid Container App name (2-32 lowercase letters, numbers and hyphens)");
|
|
102
|
+
return p;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Return the application resource identifier.
|
|
106
|
+
* @returns The app resource id result
|
|
107
|
+
*/
|
|
108
|
+
getAppResourceId() {
|
|
109
|
+
return resourceId("Microsoft.App/containerApps", this.resources.containerApp.name);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Return the managed identity resource identifier.
|
|
113
|
+
* @returns The identity resource id result
|
|
114
|
+
*/
|
|
115
|
+
getIdentityResourceId() {
|
|
116
|
+
return resourceId("Microsoft.ManagedIdentity/userAssignedIdentities", `${this.resources.containerApp.name}-identity`);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Return the ARM expression for the application principal.
|
|
120
|
+
* @returns The app principal id result
|
|
121
|
+
*/
|
|
122
|
+
getAppPrincipalId() {
|
|
123
|
+
return `[reference(${armValue(this.getIdentityResourceId())}, '2023-01-31').principalId]`;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Return the managed environment resource identifier.
|
|
127
|
+
* @returns The environment id result
|
|
128
|
+
*/
|
|
129
|
+
environmentId() {
|
|
130
|
+
return (this.resources.environment.id ?? resourceId("Microsoft.App/managedEnvironments", this.resources.environment.name));
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Describe the application managed identity.
|
|
134
|
+
* @returns The identity result
|
|
135
|
+
*/
|
|
136
|
+
identity() {
|
|
137
|
+
return { type: "SystemAssigned, UserAssigned", userAssignedIdentities: { [this.getIdentityResourceId()]: {} } };
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Build the runtime environment from contributors and explicit overrides.
|
|
141
|
+
* @returns The env result
|
|
142
|
+
*/
|
|
143
|
+
env() {
|
|
144
|
+
return Object.entries({
|
|
145
|
+
...this.contributedEnv,
|
|
146
|
+
AZURE_CLIENT_ID: `[reference(${armValue(this.getIdentityResourceId())}, '2023-01-31').clientId]`,
|
|
147
|
+
...this.resources.containerApp.env
|
|
148
|
+
}).map(([name, value]) => ({ name, ...(typeof value === "string" ? { value } : value) }));
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Convert configured secrets to secure parameters or Key Vault references.
|
|
152
|
+
* @returns The secrets result
|
|
153
|
+
*/
|
|
154
|
+
secrets() {
|
|
155
|
+
return Object.entries(this.resources.secrets).map(([name, value]) => ({
|
|
156
|
+
name,
|
|
157
|
+
...(typeof value === "object" && !(value instanceof SecretString)
|
|
158
|
+
? value
|
|
159
|
+
: { value: this.secureParameter(value) })
|
|
160
|
+
}));
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Configure managed identity image pulls.
|
|
164
|
+
* @returns The registries result
|
|
165
|
+
*/
|
|
166
|
+
registries() {
|
|
167
|
+
if (this.resources.registryAuth === "none")
|
|
168
|
+
return [];
|
|
169
|
+
const target = parseImageReference(this.resources.image);
|
|
170
|
+
return [{ server: target.registry, identity: this.getIdentityResourceId() }];
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Generate the deployment template without contacting Azure.
|
|
174
|
+
* @param image - Immutable container image reference
|
|
175
|
+
* @returns ARM template without secret values
|
|
176
|
+
*/
|
|
177
|
+
generateTemplate(image) {
|
|
178
|
+
this.prepare();
|
|
179
|
+
const target = parseImageReference(this.resources.image);
|
|
180
|
+
this.image = image ?? formatImageReference({ ...target, tag: target.digest ? undefined : target.tag });
|
|
181
|
+
this.addResource({
|
|
182
|
+
type: "Microsoft.ManagedIdentity/userAssignedIdentities",
|
|
183
|
+
apiVersion: "2023-01-31",
|
|
184
|
+
name: `${this.resources.containerApp.name}-identity`,
|
|
185
|
+
location: this.resources.location,
|
|
186
|
+
tags: this.getDefaultTags()
|
|
187
|
+
});
|
|
188
|
+
this.Resources();
|
|
189
|
+
if (!this.resources.environment.id) {
|
|
190
|
+
if (this.resources.logAnalytics !== false)
|
|
191
|
+
this.LogAnalytics();
|
|
192
|
+
this.ManagedEnvironment();
|
|
193
|
+
}
|
|
194
|
+
if (this.resources.registryAuth !== "none") {
|
|
195
|
+
const registry = this.resources.registry ?? target.registry.split(".")[0];
|
|
196
|
+
this.roles.push({
|
|
197
|
+
scope: resourceId("Microsoft.ContainerRegistry/registries", registry),
|
|
198
|
+
roleDefinitionId: `/subscriptions/${this.resources.subscriptionId}/providers/Microsoft.Authorization/roleDefinitions/7f951dda-4ed3-4680-a7ca-43fe172d538d`
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
this.grantRoles();
|
|
202
|
+
this.ContainerApp();
|
|
203
|
+
this.ManagedCertificates();
|
|
204
|
+
if (this.resources.crons)
|
|
205
|
+
this.Jobs();
|
|
206
|
+
this.template.outputs.fqdn = {
|
|
207
|
+
type: "string",
|
|
208
|
+
value: `[reference(${armValue(this.getAppResourceId())}, '2024-03-01').configuration.ingress.fqdn]`
|
|
209
|
+
};
|
|
210
|
+
this.template.outputs.latestRevisionName = {
|
|
211
|
+
type: "string",
|
|
212
|
+
value: `[reference(${armValue(this.getAppResourceId())}, '2024-03-01').latestRevisionName]`
|
|
213
|
+
};
|
|
214
|
+
return this.template;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Add the optional Log Analytics workspace.
|
|
218
|
+
*/
|
|
219
|
+
LogAnalytics() {
|
|
220
|
+
const p = this.resources, log = p.logAnalytics;
|
|
221
|
+
if (log === false)
|
|
222
|
+
return;
|
|
223
|
+
this.addResource({
|
|
224
|
+
type: "Microsoft.OperationalInsights/workspaces",
|
|
225
|
+
apiVersion: "2023-09-01",
|
|
226
|
+
name: log.name ?? `${p.environment.name}-logs`,
|
|
227
|
+
location: p.location,
|
|
228
|
+
tags: this.getDefaultTags(),
|
|
229
|
+
properties: { sku: { name: "PerGB2018" }, retentionInDays: log.retentionInDays ?? 30 }
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Add the Container Apps managed environment.
|
|
234
|
+
*/
|
|
235
|
+
ManagedEnvironment() {
|
|
236
|
+
const p = this.resources, log = p.logAnalytics;
|
|
237
|
+
const workspace = log === false
|
|
238
|
+
? undefined
|
|
239
|
+
: resourceId("Microsoft.OperationalInsights/workspaces", log.name ?? `${p.environment.name}-logs`);
|
|
240
|
+
this.addResource({
|
|
241
|
+
type: "Microsoft.App/managedEnvironments",
|
|
242
|
+
apiVersion: "2024-03-01",
|
|
243
|
+
name: p.environment.name,
|
|
244
|
+
location: p.location,
|
|
245
|
+
tags: this.getDefaultTags(),
|
|
246
|
+
dependsOn: workspace ? [workspace] : [],
|
|
247
|
+
properties: workspace
|
|
248
|
+
? {
|
|
249
|
+
appLogsConfiguration: {
|
|
250
|
+
destination: "log-analytics",
|
|
251
|
+
logAnalyticsConfiguration: {
|
|
252
|
+
customerId: `[reference(${armValue(workspace)}, '2023-09-01').customerId]`,
|
|
253
|
+
sharedKey: `[listKeys(${armValue(workspace)}, '2023-09-01').primarySharedKey]`
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
: {}
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Add the application and its scaling and ingress settings.
|
|
262
|
+
*/
|
|
263
|
+
ContainerApp() {
|
|
264
|
+
const p = this.resources, app = p.containerApp;
|
|
265
|
+
const roleIds = this.template.resources
|
|
266
|
+
.filter(resource => resource.type === "Microsoft.Authorization/roleAssignments")
|
|
267
|
+
.map(roleAssignmentId);
|
|
268
|
+
this.addResource({
|
|
269
|
+
type: "Microsoft.App/containerApps",
|
|
270
|
+
apiVersion: "2024-03-01",
|
|
271
|
+
name: app.name,
|
|
272
|
+
location: p.location,
|
|
273
|
+
tags: this.getDefaultTags(),
|
|
274
|
+
identity: this.identity(),
|
|
275
|
+
dependsOn: [this.getIdentityResourceId(), ...(!p.environment.id ? [this.environmentId()] : []), ...roleIds],
|
|
276
|
+
properties: {
|
|
277
|
+
managedEnvironmentId: this.environmentId(),
|
|
278
|
+
configuration: {
|
|
279
|
+
activeRevisionsMode: "Single",
|
|
280
|
+
ingress: app.ingress === false
|
|
281
|
+
? undefined
|
|
282
|
+
: {
|
|
283
|
+
external: true,
|
|
284
|
+
targetPort: 18080,
|
|
285
|
+
transport: "auto",
|
|
286
|
+
...app.ingress,
|
|
287
|
+
customDomains: p.customDomains.map(domain => ({
|
|
288
|
+
name: domain.name,
|
|
289
|
+
certificateId: domain.certificateId,
|
|
290
|
+
bindingType: domain.certificateId ? (domain.bindingType ?? "SniEnabled") : "Disabled"
|
|
291
|
+
}))
|
|
292
|
+
},
|
|
293
|
+
secrets: this.secrets(),
|
|
294
|
+
registries: this.registries()
|
|
295
|
+
},
|
|
296
|
+
template: {
|
|
297
|
+
containers: [
|
|
298
|
+
{
|
|
299
|
+
name: "webda",
|
|
300
|
+
image: this.image,
|
|
301
|
+
resources: { cpu: app.cpu ?? 0.5, memory: app.memory ?? "1Gi" },
|
|
302
|
+
env: this.env(),
|
|
303
|
+
probes: app.probes
|
|
304
|
+
}
|
|
305
|
+
],
|
|
306
|
+
scale: {
|
|
307
|
+
minReplicas: p.customDomains.some(domain => !domain.certificateId)
|
|
308
|
+
? Math.max(1, app.minReplicas ?? 0)
|
|
309
|
+
: (app.minReplicas ?? 0),
|
|
310
|
+
maxReplicas: app.maxReplicas ?? 10,
|
|
311
|
+
rules: app.scaleRules
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
/** Issue managed certificates after hostname registration, then bind them in a nested deployment. */
|
|
318
|
+
ManagedCertificates() {
|
|
319
|
+
const managed = this.resources.customDomains.filter(domain => !domain.certificateId);
|
|
320
|
+
if (!managed.length)
|
|
321
|
+
return;
|
|
322
|
+
if (this.resources.containerApp.ingress === false || this.resources.containerApp.ingress?.external === false)
|
|
323
|
+
throw new WebdaError.BadRequest("Managed certificates require public HTTP ingress");
|
|
324
|
+
const app = this.template.resources.find(resource => resource.type === "Microsoft.App/containerApps");
|
|
325
|
+
const certificates = new Map();
|
|
326
|
+
for (const domain of managed) {
|
|
327
|
+
if (!/^[a-zA-Z0-9.-]+$/.test(domain.name))
|
|
328
|
+
throw new WebdaError.BadRequest("Invalid custom domain name");
|
|
329
|
+
const name = `${this.resources.containerApp.name}-${createHash("sha256").update(domain.name).digest("hex").slice(0, 8)}`;
|
|
330
|
+
const id = resourceId("Microsoft.App/managedEnvironments/managedCertificates", this.resources.environment.name, name);
|
|
331
|
+
certificates.set(domain.name, id);
|
|
332
|
+
this.addResource({
|
|
333
|
+
type: "Microsoft.App/managedEnvironments/managedCertificates",
|
|
334
|
+
apiVersion: "2024-03-01",
|
|
335
|
+
name: `${this.resources.environment.name}/${name}`,
|
|
336
|
+
location: this.resources.location,
|
|
337
|
+
dependsOn: [this.getAppResourceId()],
|
|
338
|
+
properties: { subjectName: domain.name, domainControlValidation: domain.validationMethod ?? "CNAME" }
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
const boundApp = structuredClone(app);
|
|
342
|
+
delete boundApp.dependsOn;
|
|
343
|
+
boundApp.properties.configuration.ingress.customDomains = this.resources.customDomains.map(domain => ({
|
|
344
|
+
name: domain.name,
|
|
345
|
+
certificateId: domain.certificateId ?? certificates.get(domain.name),
|
|
346
|
+
bindingType: domain.bindingType ?? "SniEnabled"
|
|
347
|
+
}));
|
|
348
|
+
const nested = createAzureTemplate();
|
|
349
|
+
nested.parameters = structuredClone(this.template.parameters);
|
|
350
|
+
nested.resources = [boundApp];
|
|
351
|
+
this.addResource({
|
|
352
|
+
type: "Microsoft.Resources/deployments",
|
|
353
|
+
apiVersion: "2022-09-01",
|
|
354
|
+
name: `${this.resources.containerApp.name}-domains`,
|
|
355
|
+
dependsOn: [...certificates.values()],
|
|
356
|
+
properties: {
|
|
357
|
+
mode: "Incremental",
|
|
358
|
+
expressionEvaluationOptions: { scope: "inner" },
|
|
359
|
+
template: nested,
|
|
360
|
+
parameters: Object.fromEntries(Object.keys(nested.parameters).map(name => [name, { value: `[parameters('${name}')]` }]))
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Export declared crons as scheduled jobs, each running `cron run --id` on its operation.
|
|
366
|
+
*/
|
|
367
|
+
Jobs() {
|
|
368
|
+
for (const cron of CronService.resolveCrons()) {
|
|
369
|
+
const id = CronService.getExportId(cron), p = this.resources, app = p.containerApp;
|
|
370
|
+
const name = `${app.name.slice(0, 15)}-${id.slice(0, 16)}`.toLowerCase();
|
|
371
|
+
this.addResource({
|
|
372
|
+
type: "Microsoft.App/jobs",
|
|
373
|
+
apiVersion: "2024-03-01",
|
|
374
|
+
name,
|
|
375
|
+
location: p.location,
|
|
376
|
+
tags: this.getDefaultTags(),
|
|
377
|
+
identity: this.identity(),
|
|
378
|
+
dependsOn: [this.getAppResourceId()],
|
|
379
|
+
properties: {
|
|
380
|
+
environmentId: this.environmentId(),
|
|
381
|
+
configuration: {
|
|
382
|
+
triggerType: "Schedule",
|
|
383
|
+
replicaTimeout: 1800,
|
|
384
|
+
replicaRetryLimit: 3,
|
|
385
|
+
scheduleTriggerConfig: {
|
|
386
|
+
cronExpression: containerAppsSchedule(cron.cron),
|
|
387
|
+
parallelism: 1,
|
|
388
|
+
replicaCompletionCount: 1
|
|
389
|
+
},
|
|
390
|
+
secrets: this.secrets(),
|
|
391
|
+
registries: this.registries()
|
|
392
|
+
},
|
|
393
|
+
template: {
|
|
394
|
+
containers: [
|
|
395
|
+
{
|
|
396
|
+
name: "webda",
|
|
397
|
+
image: this.image,
|
|
398
|
+
args: ["cron", "run", "--id", id],
|
|
399
|
+
env: this.env(),
|
|
400
|
+
resources: { cpu: app.cpu ?? 0.5, memory: app.memory ?? "1Gi" }
|
|
401
|
+
}
|
|
402
|
+
]
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Publish the OCI image using the selected registry authentication.
|
|
410
|
+
* @returns The push result
|
|
411
|
+
*/
|
|
412
|
+
async push() {
|
|
413
|
+
const p = this.getResolvedParameters();
|
|
414
|
+
if (p.registryAuth === "aad") {
|
|
415
|
+
const server = parseImageReference(p.image).registry;
|
|
416
|
+
const token = await new AzureAuth(p).getAcrRefreshToken(server);
|
|
417
|
+
this.parameters.credentials[server] = { identityToken: new SecretString(token, "azure") };
|
|
418
|
+
}
|
|
419
|
+
return super.push();
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Publish and deploy the application, returning its endpoints.
|
|
423
|
+
* @returns The deploy result
|
|
424
|
+
*/
|
|
425
|
+
async deploy() {
|
|
426
|
+
const digest = await this.push();
|
|
427
|
+
const p = this.getResolvedParameters(), target = parseImageReference(p.image);
|
|
428
|
+
const image = formatImageReference({ ...target, tag: undefined, digest });
|
|
429
|
+
this.generateTemplate(image);
|
|
430
|
+
this.writeTemplate();
|
|
431
|
+
const outputs = await this.sendTemplate();
|
|
432
|
+
return (this.result = {
|
|
433
|
+
image,
|
|
434
|
+
digest,
|
|
435
|
+
fqdn: outputs.fqdn?.value,
|
|
436
|
+
revision: outputs.latestRevisionName?.value,
|
|
437
|
+
outputs
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
(() => {
|
|
442
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
443
|
+
_generate_decorators = [Command("azure template", { description: "Generate the Container Apps ARM template" })];
|
|
444
|
+
_push_decorators = [Command("container push", { description: "Build and push the image using Azure registry authentication" })];
|
|
445
|
+
_deploy_decorators = [Command("deploy", { description: "Build, publish and deploy the application to Azure Container Apps" })];
|
|
446
|
+
__esDecorate(_a, null, _generate_decorators, { kind: "method", name: "generate", static: false, private: false, access: { has: obj => "generate" in obj, get: obj => obj.generate }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
447
|
+
__esDecorate(_a, null, _push_decorators, { kind: "method", name: "push", static: false, private: false, access: { has: obj => "push" in obj, get: obj => obj.push }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
448
|
+
__esDecorate(_a, null, _deploy_decorators, { kind: "method", name: "deploy", static: false, private: false, access: { has: obj => "deploy" in obj, get: obj => obj.deploy }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
449
|
+
if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
450
|
+
})(),
|
|
451
|
+
_a.Parameters = AzureContainerAppsDeployerParameters,
|
|
452
|
+
_a;
|
|
453
|
+
})();
|
|
454
|
+
export { AzureContainerAppsDeployer };
|
|
455
|
+
//# sourceMappingURL=containerapps.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"containerapps.service.js","sources":["../../src/deployers/containerapps.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAY,sBAAsB,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM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AGG;YAEH,KAAK,CAAC,MAAM;gBACV,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;gBACjC,MAAM,CAAC,GAAG,IAAI,CAAC,qBAAqB,EAAE,EACpC,MAAM,GAAG,mBAAmB,CAAC,CAAC,CAAC,KAAM,CAAC,CAAC;gBACzC,MAAM,KAAK,GAAG,oBAAoB,CAAC,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC;gBAC1E,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;gBAC7B,IAAI,CAAC,aAAa,EAAE,CAAC;gBACrB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;gBAC1C,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG;oBACpB,KAAK;oBACL,MAAM;oBACN,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,KAAK;oBACzB,QAAQ,EAAE,OAAO,CAAC,kBAAkB,EAAE,KAAK;oBAC3C,OAAO;iBACR,CAAC,CAAC;YACL,CAAC;;;;oCAlYA,OAAO,CAAC,gBAAgB,EAAE,EAAE,WAAW,EAAE,0CAA0C,EAAE,CAAC;gCAmWtF,OAAO,CAAC,gBAAgB,EAAE,EAAE,WAAW,EAAE,8DAA8D,EAAE,CAAC;kCAe1G,OAAO,CAAC,QAAQ,EAAE,EAAE,WAAW,EAAE,mEAAmE,EAAE,CAAC;YAjXxG,yKAAM,QAAQ,6DAEb;YAiWD,6JAAM,IAAI,6DAQT;YAOD,mKAAM,MAAM,6DAeX;;;QA1YM,aAAU,GAAG,oCAAqC;;;SAJ9C,0BAA0B"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { HttpRequest, HttpResponseInit, InvocationContext } from "@azure/functions";
|
|
2
|
+
import { InstanceStorage } from "@webda/core";
|
|
3
|
+
import { AzureFunctionServer } from "../services/functionserver.service.js";
|
|
4
|
+
export interface AzureFunctionApplication {
|
|
5
|
+
server: AzureFunctionServer;
|
|
6
|
+
instance: InstanceStorage;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Load a packaged application through Webda's DI container in its own async storage.
|
|
10
|
+
* @param path - Application folder or content path
|
|
11
|
+
* @returns The boot azure function server result
|
|
12
|
+
*/
|
|
13
|
+
export declare function bootAzureFunctionServer(path?: string): Promise<AzureFunctionApplication>;
|
|
14
|
+
/**
|
|
15
|
+
* Memoized boot with recovery after failures; each concurrent invocation enters its own request context.
|
|
16
|
+
* @param boot - Application boot factory
|
|
17
|
+
* @returns HTTP, event and cron invocation handlers
|
|
18
|
+
*/
|
|
19
|
+
export declare function createAzureHandlers(boot?: typeof bootAzureFunctionServer): {
|
|
20
|
+
http: (request: HttpRequest, context: InvocationContext) => Promise<HttpResponseInit>;
|
|
21
|
+
event: (source: "servicebus" | "blob" | "timer", event: unknown, context: InvocationContext) => Promise<void>;
|
|
22
|
+
cron: (id: string) => Promise<void>;
|
|
23
|
+
};
|
|
24
|
+
export type AzureTrigger = {
|
|
25
|
+
name: string;
|
|
26
|
+
type: "servicebus";
|
|
27
|
+
queueName: string;
|
|
28
|
+
connection: string;
|
|
29
|
+
} | {
|
|
30
|
+
name: string;
|
|
31
|
+
type: "blob";
|
|
32
|
+
path: string;
|
|
33
|
+
connection: string;
|
|
34
|
+
} | {
|
|
35
|
+
name: string;
|
|
36
|
+
type: "timer";
|
|
37
|
+
schedule: string;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Called only by the generated Functions bootstrap, never by the package's normal import.
|
|
41
|
+
* @param crons - Exported cron definitions
|
|
42
|
+
* @param triggers - Additional event binding declarations
|
|
43
|
+
*/
|
|
44
|
+
export declare function registerAzureFunctions(crons?: {
|
|
45
|
+
id: string;
|
|
46
|
+
schedule: string;
|
|
47
|
+
}[], triggers?: AzureTrigger[]): void;
|
|
48
|
+
//# sourceMappingURL=functions-entrypoint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
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AM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,EAAO,EAC9C,QAAQ,GAAE,YAAY,EAAO,GAC5B,IAAI,CA6BN"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { app } from "@azure/functions";
|
|
2
|
+
import { Application, Core, runWithInstanceStorage, useInstanceStorage, WebdaError } from "@webda/core";
|
|
3
|
+
import { AzureFunctionServer } from "../services/functionserver.service.js";
|
|
4
|
+
/**
|
|
5
|
+
* Load a packaged application through Webda's DI container in its own async storage.
|
|
6
|
+
* @param path - Application folder or content path
|
|
7
|
+
* @returns The boot azure function server result
|
|
8
|
+
*/
|
|
9
|
+
export async function bootAzureFunctionServer(path = process.cwd()) {
|
|
10
|
+
return runWithInstanceStorage({}, async () => {
|
|
11
|
+
const application = new Application(path);
|
|
12
|
+
useInstanceStorage().application = application;
|
|
13
|
+
await application.load();
|
|
14
|
+
const core = new Core(application);
|
|
15
|
+
await core.init();
|
|
16
|
+
const server = Object.values(core.getServices()).find(service => service instanceof AzureFunctionServer || service.constructor.name === "AzureFunctionServer");
|
|
17
|
+
if (!server)
|
|
18
|
+
throw new WebdaError.CodeError("AZURE_FUNCTION_SERVER", "No AzureFunctionServer is configured in the application");
|
|
19
|
+
return { server, instance: useInstanceStorage() };
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Memoized boot with recovery after failures; each concurrent invocation enters its own request context.
|
|
24
|
+
* @param boot - Application boot factory
|
|
25
|
+
* @returns HTTP, event and cron invocation handlers
|
|
26
|
+
*/
|
|
27
|
+
export function createAzureHandlers(boot = bootAzureFunctionServer) {
|
|
28
|
+
let booted;
|
|
29
|
+
const invoke = async (callback) => {
|
|
30
|
+
booted ?? (booted = boot().catch(error => {
|
|
31
|
+
booted = undefined;
|
|
32
|
+
throw error;
|
|
33
|
+
}));
|
|
34
|
+
const { server, instance } = await booted;
|
|
35
|
+
return runWithInstanceStorage(instance, () => callback(server));
|
|
36
|
+
};
|
|
37
|
+
return {
|
|
38
|
+
http: (request, context) => invoke(server => server.handleRequest(request, context)),
|
|
39
|
+
event: (source, event, context) => invoke(server => server.handleEvent(source, event, context)),
|
|
40
|
+
cron: (id) => invoke(server => server.handleCron(id))
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Called only by the generated Functions bootstrap, never by the package's normal import.
|
|
45
|
+
* @param crons - Exported cron definitions
|
|
46
|
+
* @param triggers - Additional event binding declarations
|
|
47
|
+
*/
|
|
48
|
+
export function registerAzureFunctions(crons = [], triggers = []) {
|
|
49
|
+
const handlers = createAzureHandlers();
|
|
50
|
+
app.http("webda", {
|
|
51
|
+
route: "{*path}",
|
|
52
|
+
authLevel: "anonymous",
|
|
53
|
+
methods: ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"],
|
|
54
|
+
handler: handlers.http
|
|
55
|
+
});
|
|
56
|
+
for (const cron of crons)
|
|
57
|
+
app.timer(`cron-${cron.id}`, { schedule: cron.schedule, handler: () => handlers.cron(cron.id) });
|
|
58
|
+
for (const trigger of triggers) {
|
|
59
|
+
if (trigger.type === "servicebus")
|
|
60
|
+
app.serviceBusQueue(trigger.name, {
|
|
61
|
+
queueName: trigger.queueName,
|
|
62
|
+
connection: trigger.connection,
|
|
63
|
+
handler: (event, context) => handlers.event("servicebus", event, context)
|
|
64
|
+
});
|
|
65
|
+
else if (trigger.type === "blob")
|
|
66
|
+
app.storageBlob(trigger.name, {
|
|
67
|
+
path: trigger.path,
|
|
68
|
+
connection: trigger.connection,
|
|
69
|
+
handler: (event, context) => handlers.event("blob", event, context)
|
|
70
|
+
});
|
|
71
|
+
else
|
|
72
|
+
app.timer(trigger.name, {
|
|
73
|
+
schedule: trigger.schedule,
|
|
74
|
+
handler: (event, context) => handlers.event("timer", event, context)
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=functions-entrypoint.js.map
|
|
@@ -0,0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