@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
package/LICENSE
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
GNU LESSER GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 3, 29 June 2007
|
|
3
|
+
|
|
4
|
+
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
|
5
|
+
Everyone is permitted to copy and distribute verbatim copies
|
|
6
|
+
of this license document, but changing it is not allowed.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
This version of the GNU Lesser General Public License incorporates
|
|
10
|
+
the terms and conditions of version 3 of the GNU General Public
|
|
11
|
+
License, supplemented by the additional permissions listed below.
|
|
12
|
+
|
|
13
|
+
0. Additional Definitions.
|
|
14
|
+
|
|
15
|
+
As used herein, "this License" refers to version 3 of the GNU Lesser
|
|
16
|
+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
|
17
|
+
General Public License.
|
|
18
|
+
|
|
19
|
+
"The Library" refers to a covered work governed by this License,
|
|
20
|
+
other than an Application or a Combined Work as defined below.
|
|
21
|
+
|
|
22
|
+
An "Application" is any work that makes use of an interface provided
|
|
23
|
+
by the Library, but which is not otherwise based on the Library.
|
|
24
|
+
Defining a subclass of a class defined by the Library is deemed a mode
|
|
25
|
+
of using an interface provided by the Library.
|
|
26
|
+
|
|
27
|
+
A "Combined Work" is a work produced by combining or linking an
|
|
28
|
+
Application with the Library. The particular version of the Library
|
|
29
|
+
with which the Combined Work was made is also called the "Linked
|
|
30
|
+
Version".
|
|
31
|
+
|
|
32
|
+
The "Minimal Corresponding Source" for a Combined Work means the
|
|
33
|
+
Corresponding Source for the Combined Work, excluding any source code
|
|
34
|
+
for portions of the Combined Work that, considered in isolation, are
|
|
35
|
+
based on the Application, and not on the Linked Version.
|
|
36
|
+
|
|
37
|
+
The "Corresponding Application Code" for a Combined Work means the
|
|
38
|
+
object code and/or source code for the Application, including any data
|
|
39
|
+
and utility programs needed for reproducing the Combined Work from the
|
|
40
|
+
Application, but excluding the System Libraries of the Combined Work.
|
|
41
|
+
|
|
42
|
+
1. Exception to Section 3 of the GNU GPL.
|
|
43
|
+
|
|
44
|
+
You may convey a covered work under sections 3 and 4 of this License
|
|
45
|
+
without being bound by section 3 of the GNU GPL.
|
|
46
|
+
|
|
47
|
+
2. Conveying Modified Versions.
|
|
48
|
+
|
|
49
|
+
If you modify a copy of the Library, and, in your modifications, a
|
|
50
|
+
facility refers to a function or data to be supplied by an Application
|
|
51
|
+
that uses the facility (other than as an argument passed when the
|
|
52
|
+
facility is invoked), then you may convey a copy of the modified
|
|
53
|
+
version:
|
|
54
|
+
|
|
55
|
+
a) under this License, provided that you make a good faith effort to
|
|
56
|
+
ensure that, in the event an Application does not supply the
|
|
57
|
+
function or data, the facility still operates, and performs
|
|
58
|
+
whatever part of its purpose remains meaningful, or
|
|
59
|
+
|
|
60
|
+
b) under the GNU GPL, with none of the additional permissions of
|
|
61
|
+
this License applicable to that copy.
|
|
62
|
+
|
|
63
|
+
3. Object Code Incorporating Material from Library Header Files.
|
|
64
|
+
|
|
65
|
+
The object code form of an Application may incorporate material from
|
|
66
|
+
a header file that is part of the Library. You may convey such object
|
|
67
|
+
code under terms of your choice, provided that, if the incorporated
|
|
68
|
+
material is not limited to numerical parameters, data structure
|
|
69
|
+
layouts and accessors, or small macros, inline functions and templates
|
|
70
|
+
(ten or fewer lines in length), you do both of the following:
|
|
71
|
+
|
|
72
|
+
a) Give prominent notice with each copy of the object code that the
|
|
73
|
+
Library is used in it and that the Library and its use are
|
|
74
|
+
covered by this License.
|
|
75
|
+
|
|
76
|
+
b) Accompany the object code with a copy of the GNU GPL and this license
|
|
77
|
+
document.
|
|
78
|
+
|
|
79
|
+
4. Combined Works.
|
|
80
|
+
|
|
81
|
+
You may convey a Combined Work under terms of your choice that,
|
|
82
|
+
taken together, effectively do not restrict modification of the
|
|
83
|
+
portions of the Library contained in the Combined Work and reverse
|
|
84
|
+
engineering for debugging such modifications, if you also do each of
|
|
85
|
+
the following:
|
|
86
|
+
|
|
87
|
+
a) Give prominent notice with each copy of the Combined Work that
|
|
88
|
+
the Library is used in it and that the Library and its use are
|
|
89
|
+
covered by this License.
|
|
90
|
+
|
|
91
|
+
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
|
92
|
+
document.
|
|
93
|
+
|
|
94
|
+
c) For a Combined Work that displays copyright notices during
|
|
95
|
+
execution, include the copyright notice for the Library among
|
|
96
|
+
these notices, as well as a reference directing the user to the
|
|
97
|
+
copies of the GNU GPL and this license document.
|
|
98
|
+
|
|
99
|
+
d) Do one of the following:
|
|
100
|
+
|
|
101
|
+
0) Convey the Minimal Corresponding Source under the terms of this
|
|
102
|
+
License, and the Corresponding Application Code in a form
|
|
103
|
+
suitable for, and under terms that permit, the user to
|
|
104
|
+
recombine or relink the Application with a modified version of
|
|
105
|
+
the Linked Version to produce a modified Combined Work, in the
|
|
106
|
+
manner specified by section 6 of the GNU GPL for conveying
|
|
107
|
+
Corresponding Source.
|
|
108
|
+
|
|
109
|
+
1) Use a suitable shared library mechanism for linking with the
|
|
110
|
+
Library. A suitable mechanism is one that (a) uses at run time
|
|
111
|
+
a copy of the Library already present on the user's computer
|
|
112
|
+
system, and (b) will operate properly with a modified version
|
|
113
|
+
of the Library that is interface-compatible with the Linked
|
|
114
|
+
Version.
|
|
115
|
+
|
|
116
|
+
e) Provide Installation Information, but only if you would otherwise
|
|
117
|
+
be required to provide such information under section 6 of the
|
|
118
|
+
GNU GPL, and only to the extent that such information is
|
|
119
|
+
necessary to install and execute a modified version of the
|
|
120
|
+
Combined Work produced by recombining or relinking the
|
|
121
|
+
Application with a modified version of the Linked Version. (If
|
|
122
|
+
you use option 4d0, the Installation Information must accompany
|
|
123
|
+
the Minimal Corresponding Source and Corresponding Application
|
|
124
|
+
Code. If you use option 4d1, you must provide the Installation
|
|
125
|
+
Information in the manner specified by section 6 of the GNU GPL
|
|
126
|
+
for conveying Corresponding Source.)
|
|
127
|
+
|
|
128
|
+
5. Combined Libraries.
|
|
129
|
+
|
|
130
|
+
You may place library facilities that are a work based on the
|
|
131
|
+
Library side by side in a single library together with other library
|
|
132
|
+
facilities that are not Applications and are not covered by this
|
|
133
|
+
License, and convey such a combined library under terms of your
|
|
134
|
+
choice, if you do both of the following:
|
|
135
|
+
|
|
136
|
+
a) Accompany the combined library with a copy of the same work based
|
|
137
|
+
on the Library, uncombined with any other library facilities,
|
|
138
|
+
conveyed under the terms of this License.
|
|
139
|
+
|
|
140
|
+
b) Give prominent notice with the combined library that part of it
|
|
141
|
+
is a work based on the Library, and explaining where to find the
|
|
142
|
+
accompanying uncombined form of the same work.
|
|
143
|
+
|
|
144
|
+
6. Revised Versions of the GNU Lesser General Public License.
|
|
145
|
+
|
|
146
|
+
The Free Software Foundation may publish revised and/or new versions
|
|
147
|
+
of the GNU Lesser General Public License from time to time. Such new
|
|
148
|
+
versions will be similar in spirit to the present version, but may
|
|
149
|
+
differ in detail to address new problems or concerns.
|
|
150
|
+
|
|
151
|
+
Each version is given a distinguishing version number. If the
|
|
152
|
+
Library as you received it specifies that a certain numbered version
|
|
153
|
+
of the GNU Lesser General Public License "or any later version"
|
|
154
|
+
applies to it, you have the option of following the terms and
|
|
155
|
+
conditions either of that published version or of any later version
|
|
156
|
+
published by the Free Software Foundation. If the Library as you
|
|
157
|
+
received it does not specify a version number of the GNU Lesser
|
|
158
|
+
General Public License, you may choose any version of the GNU Lesser
|
|
159
|
+
General Public License ever published by the Free Software Foundation.
|
|
160
|
+
|
|
161
|
+
If the Library as you received it specifies that a proxy can decide
|
|
162
|
+
whether future versions of the GNU Lesser General Public License shall
|
|
163
|
+
apply, that proxy's public statement of acceptance of any version is
|
|
164
|
+
permanent authorization for you to choose that version for the
|
|
165
|
+
Library.
|
|
166
|
+
|
package/README.md
CHANGED
|
@@ -1,3 +1,249 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @webda/azure module
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This module is part of Webda Application Framework that allows you to quickly develop applications with all modern prerequisites: Security, Extensibility, GraphQL, REST, CloudNative [https://webda.io](https://webda.io)
|
|
4
|
+
|
|
5
|
+
<img src="https://webda.io/img/webda.svg" width="128" />
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
[](https://gitter.im/loopingz/webda?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
10
|
+
[](https://codecov.io/gh/loopingz/webda.io)
|
|
11
|
+
[](https://sonarcloud.io/summary/new_code?id=loopingz_webda.io)
|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
<!-- README_HEADER -->
|
|
15
|
+
|
|
16
|
+
Azure Blob storage, Cosmos DB, Service Bus, Key Vault, Monitor logging, Container Apps and Functions integrations for Webda.
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
pnpm add @webda/azure
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Credentials
|
|
25
|
+
|
|
26
|
+
`getAzureCredential(params)` returns an Azure SDK `TokenCredential`. Complete service-principal parameters select `ClientSecretCredential`; other configurations use `DefaultAzureCredential`, including Azure CLI, managed identity and workload identity authentication.
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
import { getAzureCredential, loadAzureParameters } from "@webda/azure";
|
|
30
|
+
|
|
31
|
+
const params = loadAzureParameters({ endpoint: "http://127.0.0.1:10000/devstoreaccount1" });
|
|
32
|
+
const credential = getAzureCredential(params);
|
|
33
|
+
// Pass credential to your Azure SDK client. Use params.endpoint for the service's emulator endpoint.
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
| Parameter | Environment fallback | Purpose |
|
|
37
|
+
| ---------------- | ----------------------- | ----------------------------------------------------- |
|
|
38
|
+
| `tenantId` | `AZURE_TENANT_ID` | Microsoft Entra tenant |
|
|
39
|
+
| `clientId` | `AZURE_CLIENT_ID` | Service principal or user-assigned identity client |
|
|
40
|
+
| `clientSecret` | `AZURE_CLIENT_SECRET` | Service principal secret (`string` or `SecretString`) |
|
|
41
|
+
| `subscriptionId` | `AZURE_SUBSCRIPTION_ID` | Resource subscription |
|
|
42
|
+
| `endpoint` | — | Service-specific endpoint, such as Azurite |
|
|
43
|
+
|
|
44
|
+
Service parameter classes implementing `AzureServiceParameters` can call `loadAzureParameters(this)` from `load()`. It fills absent fields and returns the same object, preserving explicit values and encrypted `SecretString` instances. `getAzureCredential` resolves defaults in a copy, so it preserves its input. It forwards the configured tenant/client to the default chain's managed and workload identity options; the SDK also honors its standard authentication environment variables.
|
|
45
|
+
|
|
46
|
+
Use managed or workload identity for deployed applications, or `az login` for development. To configure a service principal, supply all three of `tenantId`, `clientId` and `clientSecret`. Secrets decrypted by Webda remain wrapped until the SDK constructor needs their plain value. Clear-text secrets emit the existing `SecretString.from` warning, which names the field and never logs its value. Creating a credential performs no token request; the SDK acquires a token when a client needs one.
|
|
47
|
+
|
|
48
|
+
See Microsoft's [Azure Identity documentation](https://learn.microsoft.com/en-us/javascript/api/overview/azure/identity-readme?view=azure-node-latest) for the SDK's credential chain and environment variables.
|
|
49
|
+
|
|
50
|
+
## Resource contributions
|
|
51
|
+
|
|
52
|
+
Services implement `AzureContributor` to describe their ARM resources, container environment, outputs and managed-identity roles. Deployers merge the returned contribution and grant its roles to the application's managed identity.
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
import type { AzureContributor, AzureDeployerInfo, AzureResourceContribution } from "@webda/azure";
|
|
56
|
+
|
|
57
|
+
class StorageContribution implements AzureContributor {
|
|
58
|
+
getAzureResources(deployer: AzureDeployerInfo): AzureResourceContribution {
|
|
59
|
+
const account = "myappstorage";
|
|
60
|
+
const scope = `[resourceId('Microsoft.Storage/storageAccounts', '${account}')]`;
|
|
61
|
+
return {
|
|
62
|
+
resources: [
|
|
63
|
+
{
|
|
64
|
+
type: "Microsoft.Storage/storageAccounts",
|
|
65
|
+
apiVersion: "2023-05-01",
|
|
66
|
+
name: account,
|
|
67
|
+
location: deployer.resources.location,
|
|
68
|
+
tags: deployer.getDefaultTags(),
|
|
69
|
+
sku: { name: "Standard_LRS" },
|
|
70
|
+
kind: "StorageV2"
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
env: { STORAGE_ACCOUNT: account, STORAGE_KEY: { secretRef: "storage-key" } },
|
|
74
|
+
outputs: { storageAccountId: { type: "string", value: scope } },
|
|
75
|
+
roleAssignments: [
|
|
76
|
+
{
|
|
77
|
+
roleDefinitionId:
|
|
78
|
+
"[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe')]",
|
|
79
|
+
scope
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
`AzureDeployerInfo` exposes `resources.resourceGroup`, `resources.location`, `resources.subscriptionId`, `getDefaultTags(tags?)` and `getAppPrincipalId()`. Contributors describe resources synchronously; the deployer performs Azure operations. Environment secrets use `{ secretRef }` references to secrets supplied by the deployer.
|
|
88
|
+
|
|
89
|
+
## Runtime services
|
|
90
|
+
|
|
91
|
+
Declare these services in `webda.config.jsonc`. All use the credentials above and create SDK clients during initialization.
|
|
92
|
+
|
|
93
|
+
```jsonc
|
|
94
|
+
{
|
|
95
|
+
"services": {
|
|
96
|
+
"Files": {
|
|
97
|
+
"type": "Webda/AzureBlobBinary",
|
|
98
|
+
"account": "myappstorage",
|
|
99
|
+
"container": "files",
|
|
100
|
+
"models": { "MyApp/Document": ["attachments"] }
|
|
101
|
+
},
|
|
102
|
+
"Database": {
|
|
103
|
+
"type": "Webda/CosmosStore",
|
|
104
|
+
"endpoint": "https://myapp.documents.azure.com",
|
|
105
|
+
"database": "webda",
|
|
106
|
+
"container": "models",
|
|
107
|
+
"models": ["MyApp/Document"]
|
|
108
|
+
},
|
|
109
|
+
"Work": { "type": "Webda/ServiceBusQueue", "namespace": "myapp.servicebus.windows.net", "queue": "work" },
|
|
110
|
+
"Events": {
|
|
111
|
+
"type": "Webda/ServiceBusPubSub",
|
|
112
|
+
"namespace": "myapp.servicebus.windows.net",
|
|
113
|
+
"topic": "events",
|
|
114
|
+
"subscription": "api"
|
|
115
|
+
},
|
|
116
|
+
"Vault": { "type": "Webda/AzureKeyVault", "vaultUrl": "https://myapp.vault.azure.net" }
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Blob binaries and content
|
|
122
|
+
|
|
123
|
+
`AzureBlobBinary` implements `CloudBinary` and registers `azure://container/key` and `azblob://container/key` content URLs. `getContent`, `putContent`, `headContent` and `deleteContent` support streaming, byte ranges, metadata and conditional creation. `prefix` scopes binary keys. `connectionString` accepts a `SecretString`; `endpoint` overrides the configured storage endpoint. `createContainer` defaults to `false`.
|
|
124
|
+
|
|
125
|
+
Files use `<prefix>/<md5>/data` and exact model/attribute/owner markers. A direct upload has three steps:
|
|
126
|
+
|
|
127
|
+
1. Send the normal binary challenge (`hash`, `challenge`, `size`, name and MIME type). A verified matching proof attaches an existing file immediately.
|
|
128
|
+
2. PUT bytes to the returned SAS URL with **all returned headers**, including `x-ms-blob-type: BlockBlob` and `Content-MD5`. This SAS only creates an isolated staging blob; it cannot replace shared content.
|
|
129
|
+
3. POST the binary's `complete/{hash}` action. Webda checks the staged bytes, size and proof before publishing and attaching the file. An unfinished or invalid upload never grants access to existing data.
|
|
130
|
+
|
|
131
|
+
SAS URLs use a shared key when the connection string contains one, or an Entra user delegation key otherwise. The contributor grants Blob Data Contributor on the container and Blob Delegator on the account for signing. Signed URLs and proof values are never logged. `urlExpiry` controls SAS lifetime; `pendingTimeout` limits completion time. Configure a storage lifecycle policy to expire `_staging/` and `_pending/` objects older than that timeout, allowing for the SAS lifetime.
|
|
132
|
+
|
|
133
|
+
For Azurite, use `connectionString: "UseDevelopmentStorage=true"`, `createContainer: true`, and `serviceVersion: "2023-11-03"` when its supported API version predates the SDK. Development connection strings may also provide a `BlobEndpoint`. Keep the container private.
|
|
134
|
+
|
|
135
|
+
### Cosmos DB
|
|
136
|
+
|
|
137
|
+
`CosmosStore` uses the NoSQL API and a serializer envelope to preserve dates, behaviors and concrete model types. `key` accepts a `SecretString`; without it the SDK uses Entra authentication. `createIfNotExists` defaults to `false`; `throughput` optionally configures container RU/s when creating it.
|
|
138
|
+
|
|
139
|
+
The default partition key is `/id`, with the model primary key encoded as a Cosmos-safe identifier. A custom partition such as `/tenant` must be a top-level field included in the model's primary key. It is immutable with that key. A container's partition definition must match the service setting.
|
|
140
|
+
|
|
141
|
+
Replace, delete and patches use ETags; stale conditions raise `UpdateConditionFailError`, and missing records raise `StoreNotFoundError`. Patch, increment and remove operations use atomic Cosmos Patch. A change requiring more than ten patch operations fails before writing; use `update()` for larger replacements. Concurrent writes can surface an ETag conflict for the caller to retry.
|
|
142
|
+
|
|
143
|
+
Supported WebdaQL filters are `=`, `!=`, `<`, `<=`, `>`, `>=`, `IN`, array `CONTAINS`, `LIKE`, `IS NULL`, `IS NOT NULL`, and nested `AND`/`OR`, plus `ORDER BY`, parameters, page limits and opaque continuation tokens. Query values are bound parameters. Cosmos composite indexes may be required for multi-field ordering. Aggregation uses the repository fallback policy; bulk UPDATE and DELETE are explicitly unsupported.
|
|
144
|
+
|
|
145
|
+
The resource contributor creates the SQL database/container under the account named by `endpoint` and assigns the **Cosmos data-plane** Built-in Data Contributor role. Provision the account itself separately or through the deployer's `customResources`.
|
|
146
|
+
|
|
147
|
+
### Service Bus
|
|
148
|
+
|
|
149
|
+
Both services accept `namespace`, optional `connectionString` (`SecretString`), and `createIfNotExists` (default `false`). Queue settings include `queue`, `maxMessages` (10), `maxWaitTimeInMs` (1000), and `maxPendingMessages` (1000).
|
|
150
|
+
|
|
151
|
+
`ServiceBusQueue` receives in peek-lock mode. Each opaque receipt retains the exact SDK message; `deleteMessage(receipt)` completes it. Failed processing leaves the message available after lock expiry. The pending receipt map is bounded and expired receipts are removed on subsequent receives. Size reports active messages. Long-running manual consumers must finish within the configured Service Bus lock duration.
|
|
152
|
+
|
|
153
|
+
`ServiceBusPubSub` publishes JSON to `topic`. A configured `subscription` is shared and is never deleted by shutdown. Omitting it creates a unique temporary subscription per consumer with five-minute idle expiry. Successful callbacks complete messages; failed callbacks abandon them. Cancellation waits for receiver creation and closes it, then deletes only its own temporary subscription.
|
|
154
|
+
|
|
155
|
+
Contributors create messaging entities in an existing namespace and grant Data Sender/Data Receiver. Temporary subscriptions also need topic-scoped Data Owner for their management operations. Runtime `createIfNotExists` needs management privileges; production deployments normally create entities through ARM instead.
|
|
156
|
+
|
|
157
|
+
### Key Vault configuration and encryption
|
|
158
|
+
|
|
159
|
+
`AzureKeyVault.getSecret(name)` returns a masked `SecretString`. To load a JSON configuration document, configure `ConfigurationService.sources` as `["Vault:configuration-secret"]`. Within that document, a whole value such as `"${keyvault:database-password}"` resolves to the named secret. Embedded string interpolation is deliberately not supported, so secret wrappers remain intact. ConfigurationService polls for changes.
|
|
160
|
+
|
|
161
|
+
The module registers the `azure` configuration encrypter before services are created:
|
|
162
|
+
|
|
163
|
+
```jsonc
|
|
164
|
+
{
|
|
165
|
+
"parameters": {
|
|
166
|
+
"configurationEncryption": {
|
|
167
|
+
"default": "azure",
|
|
168
|
+
"encrypters": { "azure": { "keyId": "https://myapp.vault.azure.net/keys/configuration" } }
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
"services": { "Database": { "key": "encrypt:azure:replace-this" } }
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Run `webda config encrypt` to replace the marker with an `crypt:azure:` value. `WEBDA_AZURE_KEY_ID` is the fallback key URL. A random AES-256-GCM key encrypts the value locally and Key Vault wraps that key with RSA-OAEP-256. The envelope pins the vault key version, and tampered values fail authentication. Keep previous key versions enabled while their envelopes remain in use. Decrypted service values stay wrapped until the SDK needs them. The contributor grants Key Vault Secrets User and Crypto User on an existing vault.
|
|
176
|
+
|
|
177
|
+
### Monitor logs and OpenTelemetry
|
|
178
|
+
|
|
179
|
+
Container Apps already forwards stdout to Log Analytics. `AzureMonitorLogger` is optional when a custom table is needed:
|
|
180
|
+
|
|
181
|
+
```json
|
|
182
|
+
{
|
|
183
|
+
"type": "Webda/AzureMonitorLogger",
|
|
184
|
+
"endpoint": "https://my-dce.ingest.monitor.azure.com",
|
|
185
|
+
"ruleId": "dcr-immutable-id",
|
|
186
|
+
"streamName": "Custom-Webda",
|
|
187
|
+
"logLevel": "INFO",
|
|
188
|
+
"batchSize": 100,
|
|
189
|
+
"flushInterval": 5000,
|
|
190
|
+
"maxBufferedLogs": 10000
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Follow Microsoft's [Logs ingestion setup](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/tutorial-logs-ingestion-portal) to create a Log Analytics custom table, a DCR and (when needed) a DCE. Use the DCR's **immutable** ID, its ingestion stream name, and the DCE or direct DCR ingestion endpoint. Grant the application identity **Monitoring Metrics Publisher** on the DCR. The stream and target table need these columns:
|
|
195
|
+
|
|
196
|
+
```json
|
|
197
|
+
[
|
|
198
|
+
{ "name": "TimeGenerated", "type": "datetime" },
|
|
199
|
+
{ "name": "Level", "type": "string" },
|
|
200
|
+
{ "name": "Message", "type": "string" }
|
|
201
|
+
]
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
The logger filters levels, sends serial batches, retains failed records for retry and flushes on stop. Its bounded buffer drops new records when full (`droppedLogs` records the count). Delivery is at least once; retries can duplicate records. `lastDeliveryFailed` is available for health checks, and a failed final flush raises an error after listeners are detached.
|
|
205
|
+
|
|
206
|
+
For traces and metrics, reuse `@webda/otel` and an OTLP collector with Azure Monitor ingestion. The current Webda OTEL service selects console or OTLP exporters; it does not accept an Azure exporter instance in its configuration. A separately configured Azure Monitor OpenTelemetry SDK/exporter is another option, but avoid initializing competing global SDKs. See Microsoft's [Azure Monitor OpenTelemetry options](https://learn.microsoft.com/en-us/azure/azure-monitor/containers/opentelemetry-options). This package adds no second tracing or metrics implementation.
|
|
207
|
+
|
|
208
|
+
## Deployers
|
|
209
|
+
|
|
210
|
+
`Webda/AzureContainerAppsDeployer` builds an OCI image and deploys its digest with ARM. `Webda/AzureFunctionsPackager` creates a deterministic Functions archive, and `Webda/AzureFunctionsDeployer` deploys it to Node 22 Flex Consumption through OneDeploy. See the [Azure deployment guide](https://webda.io/docs/Deployments/Azure).
|
|
211
|
+
|
|
212
|
+
## Emulator tests
|
|
213
|
+
|
|
214
|
+
The `Azure emulators` workflow runs Blob uploads against Azurite and Cosmos repository conformance against the Linux emulator. Unit tests use SDK mocks and need no cloud credentials. To run the emulator tests locally, start their containers, trust the Cosmos emulator certificate with `NODE_EXTRA_CA_CERTS`, then run:
|
|
215
|
+
|
|
216
|
+
```sh
|
|
217
|
+
AZURE_EMULATOR_TESTS=true pnpm --filter @webda/azure exec vitest run src/services/emulators.spec.ts --coverage.enabled=false
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Only that test process trusts the emulator certificate; TLS verification remains enabled. The documented emulator account keys are development credentials only.
|
|
221
|
+
|
|
222
|
+
## Validation
|
|
223
|
+
|
|
224
|
+
```sh
|
|
225
|
+
pnpm --filter @webda/azure build
|
|
226
|
+
pnpm --filter @webda/azure test
|
|
227
|
+
pnpm --filter @webda/azure lint
|
|
228
|
+
pnpm --filter @webda/azure format
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
<!-- README_FOOTER -->
|
|
232
|
+
|
|
233
|
+
## Sponsors
|
|
234
|
+
|
|
235
|
+
<!--
|
|
236
|
+
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor](mailto:sponsor@webda.io)
|
|
237
|
+
-->
|
|
238
|
+
|
|
239
|
+
Arize AI is a machine learning observability and model monitoring platform. It helps you visualize, monitor, and explain your machine learning models. [Learn more](https://arize.com)
|
|
240
|
+
|
|
241
|
+
[<img src="https://webda.io/img/sponsors/arize.svg" width="200">](https://arize.com)
|
|
242
|
+
|
|
243
|
+
Loopingz is a software development company that provides consulting and development services. [Learn more](https://loopingz.com)
|
|
244
|
+
|
|
245
|
+
[<img src="https://webda.io/img/sponsors/loopingz.png" width="200">](https://loopingz.com)
|
|
246
|
+
|
|
247
|
+
Tellae is an innovative consulting firm specialized in cities transportation issues. We provide our clients, both public and private, with solutions to support your strategic and operational decisions. [Learn more](https://tellae.fr)
|
|
248
|
+
|
|
249
|
+
[<img src="https://webda.io/img/sponsors/tellae.svg" width="200">](https://tellae.fr)
|
package/lib/auth.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { AccessToken, TokenCredential } from "@azure/core-auth";
|
|
2
|
+
import { AzureServiceParameters } from "./services/azure-parameters.js";
|
|
3
|
+
/** Azure authentication shared by ARM deployment, ACR publishing and OneDeploy. */
|
|
4
|
+
export declare class AzureAuth {
|
|
5
|
+
protected parameters: AzureServiceParameters;
|
|
6
|
+
protected credential?: TokenCredential;
|
|
7
|
+
protected armToken?: AccessToken;
|
|
8
|
+
/**
|
|
9
|
+
* Initialize the Azure integration.
|
|
10
|
+
* @param parameters - Azure authentication or integration parameters
|
|
11
|
+
*/
|
|
12
|
+
constructor(parameters: AzureServiceParameters);
|
|
13
|
+
/**
|
|
14
|
+
* Return the shared Azure SDK credential.
|
|
15
|
+
* @returns Credential shared by Azure SDK clients
|
|
16
|
+
*/
|
|
17
|
+
getCredential(): TokenCredential;
|
|
18
|
+
/**
|
|
19
|
+
* Acquire or reuse an ARM access token.
|
|
20
|
+
* @returns Access token for ARM requests
|
|
21
|
+
*/
|
|
22
|
+
getArmToken(): Promise<string>;
|
|
23
|
+
/**
|
|
24
|
+
* Exchange an ARM token for an ACR refresh token.
|
|
25
|
+
* @param loginServer - ACR login server hostname
|
|
26
|
+
* @returns ACR refresh token
|
|
27
|
+
*/
|
|
28
|
+
getAcrRefreshToken(loginServer: string): Promise<string>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAErE,OAAO,EAAE,sBAAsB,EAAsB,MAAM,gCAAgC,CAAC;AAE5F,mFAAmF;AACnF,qBAAa,SAAS;IAOR,SAAS,CAAC,UAAU,EAAE,sBAAsB;IANxD,SAAS,CAAC,UAAU,CAAC,EAAE,eAAe,CAAC;IACvC,SAAS,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC;IACjC;;;OAGG;IACH,YAAsB,UAAU,EAAE,sBAAsB,EAAI;IAE5D;;;OAGG;IACH,aAAa,IAAI,eAAe,CAE/B;IAED;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC,CAanC;IAED;;;;OAIG;IACG,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA0B7D;CACF"}
|
package/lib/auth.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { WebdaError } from "@webda/core";
|
|
2
|
+
import { getAzureCredential } from "./services/azure-parameters.js";
|
|
3
|
+
/** Azure authentication shared by ARM deployment, ACR publishing and OneDeploy. */
|
|
4
|
+
export class AzureAuth {
|
|
5
|
+
/**
|
|
6
|
+
* Initialize the Azure integration.
|
|
7
|
+
* @param parameters - Azure authentication or integration parameters
|
|
8
|
+
*/
|
|
9
|
+
constructor(parameters) {
|
|
10
|
+
this.parameters = parameters;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Return the shared Azure SDK credential.
|
|
14
|
+
* @returns Credential shared by Azure SDK clients
|
|
15
|
+
*/
|
|
16
|
+
getCredential() {
|
|
17
|
+
return (this.credential ?? (this.credential = getAzureCredential(this.parameters)));
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Acquire or reuse an ARM access token.
|
|
21
|
+
* @returns Access token for ARM requests
|
|
22
|
+
*/
|
|
23
|
+
async getArmToken() {
|
|
24
|
+
try {
|
|
25
|
+
if (!this.armToken || this.armToken.expiresOnTimestamp < Date.now() + 60000) {
|
|
26
|
+
this.armToken = (await this.getCredential().getToken("https://management.azure.com/.default")) ?? undefined;
|
|
27
|
+
}
|
|
28
|
+
if (!this.armToken)
|
|
29
|
+
throw new Error();
|
|
30
|
+
return this.armToken.token;
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
throw new WebdaError.CodeError("AZURE_AUTH", "Azure authentication failed: run az login or configure AZURE_CLIENT_ID, AZURE_TENANT_ID and AZURE_CLIENT_SECRET");
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Exchange an ARM token for an ACR refresh token.
|
|
38
|
+
* @param loginServer - ACR login server hostname
|
|
39
|
+
* @returns ACR refresh token
|
|
40
|
+
*/
|
|
41
|
+
async getAcrRefreshToken(loginServer) {
|
|
42
|
+
if (!/^[a-zA-Z0-9-]+\.azurecr\.(?:io|cn|us)$/.test(loginServer))
|
|
43
|
+
throw new WebdaError.BadRequest("ACR token exchange requires an Azure Container Registry login server");
|
|
44
|
+
const body = new URLSearchParams({
|
|
45
|
+
grant_type: "access_token",
|
|
46
|
+
service: loginServer,
|
|
47
|
+
access_token: await this.getArmToken()
|
|
48
|
+
});
|
|
49
|
+
if (this.parameters.tenantId)
|
|
50
|
+
body.set("tenant", this.parameters.tenantId);
|
|
51
|
+
try {
|
|
52
|
+
const response = await fetch(`https://${loginServer}/oauth2/exchange`, {
|
|
53
|
+
method: "POST",
|
|
54
|
+
body,
|
|
55
|
+
redirect: "error",
|
|
56
|
+
signal: AbortSignal.timeout(30000)
|
|
57
|
+
});
|
|
58
|
+
if (!response.ok)
|
|
59
|
+
throw new Error();
|
|
60
|
+
const result = (await response.json());
|
|
61
|
+
if (!result.refresh_token)
|
|
62
|
+
throw new Error();
|
|
63
|
+
return result.refresh_token;
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
throw new WebdaError.CodeError("AZURE_ACR_AUTH", "ACR token exchange failed; check the identity's registry push permissions");
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=auth.js.map
|
package/lib/auth.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sources":["../src/auth.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAA0B,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAE5F,mFAAmF;AACnF,MAAM,OAAO,SAAS;IAGpB;;;OAGG;IACH,YAAsB,UAAkC;0BAAlC,UAAU;IAA2B,CAAC;IAE5D;;;OAGG;IACH,aAAa;QACX,OAAO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AAkB,EAAE;gBACrE,MAAM,EAAE,MAAM;gBACd,IAAI;gBACJ,QAAQ,EAAE,OAAO;gBACjB,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC;aACnC,CAAC,CAAC;YACH,IAAI,CAAC,QAAQ,CAAC,EAAE;gBAAE,MAAM,IAAI,KAAK,EAAE,CAAC;YACpC,MAAM,MAAM,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAA+B,CAAC;YACrE,IAAI,CAAC,MAAM,CAAC,aAAa;gBAAE,MAAM,IAAI,KAAK,EAAE,CAAC;YAC7C,OAAO,MAAM,CAAC,aAAa,CAAC;QAC9B,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,IAAI,UAAU,CAAC,SAAS,CAC5B,gBAAgB,EAChB,2EAA2E,CAC5E,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { SecretString } from "@webda/core";
|
|
2
|
+
import { ContainerDeployer, ContainerDeployerParameters } from "@webda/oci";
|
|
3
|
+
import { AzureServiceParameters } from "../services/azure-parameters.js";
|
|
4
|
+
import { AzureDeployerInfo, AzureRoleAssignment } from "../services/contributors.js";
|
|
5
|
+
import { AzureTemplate } from "../template.js";
|
|
6
|
+
/** Shared ARM and OCI parameters used by Azure deployment units. */
|
|
7
|
+
export declare class AzureArmDeployerParameters extends ContainerDeployerParameters implements AzureServiceParameters {
|
|
8
|
+
tenantId?: string;
|
|
9
|
+
clientId?: string;
|
|
10
|
+
clientSecret?: string | SecretString;
|
|
11
|
+
subscriptionId: string;
|
|
12
|
+
endpoint?: string;
|
|
13
|
+
resourceGroup: string;
|
|
14
|
+
location: string;
|
|
15
|
+
createResourceGroup: boolean;
|
|
16
|
+
deploymentName?: string;
|
|
17
|
+
resourceTags: Record<string, string>;
|
|
18
|
+
customResources: Record<string, any>[] | Record<string, Record<string, any>>;
|
|
19
|
+
templateOutput?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Perform load.
|
|
22
|
+
* @override
|
|
23
|
+
*/
|
|
24
|
+
load(params?: any): this;
|
|
25
|
+
}
|
|
26
|
+
/** Deployment results contain resource endpoints, never tokens or secret parameter values. */
|
|
27
|
+
export interface AzureDeployResult {
|
|
28
|
+
image?: string;
|
|
29
|
+
digest?: string;
|
|
30
|
+
fqdn?: string;
|
|
31
|
+
revision?: string;
|
|
32
|
+
outputs: Record<string, any>;
|
|
33
|
+
}
|
|
34
|
+
/** Shared template collection and ARM deployment. SDK clients are created only when deploying. */
|
|
35
|
+
export declare abstract class AzureArmDeployer<T extends AzureArmDeployerParameters = AzureArmDeployerParameters> extends ContainerDeployer<T, AzureDeployResult> implements AzureDeployerInfo {
|
|
36
|
+
resources: T;
|
|
37
|
+
template: AzureTemplate;
|
|
38
|
+
result?: AzureDeployResult;
|
|
39
|
+
protected secretValues: Map<string, string | SecretString>;
|
|
40
|
+
protected contributedEnv: Record<string, string | {
|
|
41
|
+
secretRef: string;
|
|
42
|
+
}>;
|
|
43
|
+
protected roles: AzureRoleAssignment[];
|
|
44
|
+
/**
|
|
45
|
+
* Perform get resolved parameters.
|
|
46
|
+
* @override
|
|
47
|
+
*/
|
|
48
|
+
getResolvedParameters(): T;
|
|
49
|
+
/**
|
|
50
|
+
* Resolve the deployment scope and reset template state.
|
|
51
|
+
*/
|
|
52
|
+
protected prepare(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Merge deployment tags with resource tags.
|
|
55
|
+
* @param tags - Resource-specific tags
|
|
56
|
+
* @returns The default tags result
|
|
57
|
+
*/
|
|
58
|
+
getDefaultTags(tags?: Record<string, string>): Record<string, string>;
|
|
59
|
+
abstract getAppResourceId(): string;
|
|
60
|
+
/**
|
|
61
|
+
* Return the managed identity resource identifier.
|
|
62
|
+
* @returns The identity resource id result
|
|
63
|
+
*/
|
|
64
|
+
protected getIdentityResourceId(): string;
|
|
65
|
+
/**
|
|
66
|
+
* Return the ARM expression for the application principal.
|
|
67
|
+
* @returns The app principal id result
|
|
68
|
+
*/
|
|
69
|
+
abstract getAppPrincipalId(): string;
|
|
70
|
+
abstract generateTemplate(image?: string): AzureTemplate;
|
|
71
|
+
/**
|
|
72
|
+
* Add a secret without placing its value in the serializable template.
|
|
73
|
+
* @param value - Value to convert or protect
|
|
74
|
+
* @returns The secure parameter result
|
|
75
|
+
*/
|
|
76
|
+
protected secureParameter(value: string | SecretString): string;
|
|
77
|
+
/**
|
|
78
|
+
* Merge service resources, environment and roles. Conflicting contributions are rejected.
|
|
79
|
+
*/
|
|
80
|
+
Resources(): void;
|
|
81
|
+
/**
|
|
82
|
+
* Add a resource, rejecting conflicting declarations.
|
|
83
|
+
* @param resource - ARM resource declaration
|
|
84
|
+
*/
|
|
85
|
+
protected addResource(resource: Record<string, any>): void;
|
|
86
|
+
/**
|
|
87
|
+
* Grant every contributed role to one application or job identity.
|
|
88
|
+
* @param principalId - ARM principal identifier expression
|
|
89
|
+
* @param identityResourceId - Resource providing the managed identity
|
|
90
|
+
*/
|
|
91
|
+
protected grantRoles(principalId?: string, identityResourceId?: string): void;
|
|
92
|
+
/**
|
|
93
|
+
* Write a reviewable ARM template; this command never builds, pushes or deploys.
|
|
94
|
+
* @param output - Optional template output path
|
|
95
|
+
* @returns Generated ARM template
|
|
96
|
+
*/
|
|
97
|
+
generate(output?: string): Promise<AzureTemplate>;
|
|
98
|
+
/** Save the current template with secure parameters left as references.
|
|
99
|
+
* @param output - Optional template output path
|
|
100
|
+
*/
|
|
101
|
+
protected writeTemplate(output?: string): void;
|
|
102
|
+
/**
|
|
103
|
+
* Deploy the ARM template with secure parameter values.
|
|
104
|
+
* @returns Deployment outputs
|
|
105
|
+
*/
|
|
106
|
+
sendTemplate(): Promise<Record<string, any>>;
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=arm.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arm.service.d.ts","sources":["../../src/deployers/arm.service.ts"],"names":[],"mappings":"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