Skip to content

Commit ed46fde

Browse files
authored
Merge pull request #164 from Barts-Life-Science/restore-airlock-fixes
Restore airlock fixes
2 parents 7776848 + fd4c100 commit ed46fde

File tree

4 files changed

+35
-22
lines changed

4 files changed

+35
-22
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ terraform.rc
183183
**/http-client.private.env.json
184184

185185
# vscode
186-
.vscode
187186

188187
# node
189188
node_modules

templates/shared_services/airlock_notifier/app/AirlockNotifier/workflow.json

+20-19
Original file line numberDiff line numberDiff line change
@@ -147,34 +147,35 @@
147147
"runAfter": {},
148148
"type": "ParseJson"
149149
},
150-
"Send_Email_with_SMTP": {
150+
"Send_an_email_(V2)": {
151151
"inputs": {
152-
"parameters": {
153-
"body": "<a href=\"@{parameters('tre_url')}/workspaces/@{body('Parse_JSON')?['data']?['workspace']?['id']}/requests/@{body('Parse_JSON')?['data']?['request']?['id']}\">View the request</a>",
154-
"from": "@parameters('smtp_from_email')",
155-
"importance": "Normal",
156-
"subject": "@variables('message')",
157-
"to": "@{join(variables('recipients'), ';')}"
158-
},
159-
"serviceProviderConfiguration": {
160-
"connectionName": "Smtp",
161-
"operationId": "sendEmail",
162-
"serviceProviderId": "/serviceProviders/Smtp"
163-
}
152+
"body": {
153+
"Body": "<p>@{concat(parameters('tre_url'),'/workspaces/',body('Parse_JSON')?['data']?['workspace']?['id'],'/requests/',body('Parse_JSON')?['data']?['request']?['id'])}</p>",
154+
"Importance": "Normal",
155+
"Subject": "@variables('message')",
156+
"To": "@{join(variables('recipients'),';')}"
157+
},
158+
"host": {
159+
"connection": {
160+
"referenceName": "outlook"
161+
}
162+
},
163+
"method": "post",
164+
"path": "/v2/Mail"
164165
},
165166
"runAfter": {
166-
"Switch_on_request_status": [
167-
"Succeeded"
168-
]
167+
"Switch_on_request_status": [
168+
"SUCCEEDED"
169+
]
169170
},
170-
"type": "ServiceProvider"
171-
},
171+
"type": "ApiConnection"
172+
},
172173
"Succeeded": {
173174
"inputs": {
174175
"runStatus": "Succeeded"
175176
},
176177
"runAfter": {
177-
"Send_Email_with_SMTP": [
178+
"Send_an_email_(V2)": [
178179
"Succeeded"
179180
]
180181
},

templates/shared_services/airlock_notifier/app/connections.json

+13-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@
3535
"type": "ManagedServiceIdentity"
3636
},
3737
"connectionRuntimeUrl": "@appsetting('smtp_connection_runtime_url')"
38-
}
38+
},
39+
"outlook": {
40+
"api": {
41+
"id": "/subscriptions/@appsetting('subscription')/providers/Microsoft.Web/locations/uksouth/managedApis/outlook"
42+
},
43+
"authentication": {
44+
"type": "ManagedServiceIdentity"
45+
},
46+
"connection": {
47+
"id": "/subscriptions/@appsetting('subscription')/resourceGroups/@appsetting('resource_group')/providers/Microsoft.Web/connections/outlook"
48+
},
49+
"connectionRuntimeUrl": "https://dbd1728c4196793d.11.common.logic-uksouth.azure-apihub.net/apim/outlook/3a2261e686234238a0058f766e39e7a4"
50+
}
3951
}
4052
}

templates/shared_services/airlock_notifier/terraform/airlock_notifier.tf

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ resource "azurerm_logic_app_standard" "logic_app" {
3636
storage_account_name = data.azurerm_storage_account.storage.name
3737
storage_account_access_key = data.azurerm_storage_account.storage.primary_access_key
3838
virtual_network_subnet_id = data.azurerm_subnet.airlock_notification.id
39+
version = "~4"
3940
app_settings = {
4041
"FUNCTIONS_WORKER_RUNTIME" = "node"
41-
"WEBSITE_NODE_DEFAULT_VERSION" = "~12"
42+
"WEBSITE_NODE_DEFAULT_VERSION" = "~18"
4243
"serviceBus_connectionString" = data.azurerm_servicebus_namespace.core.default_primary_connection_string
4344
"subscription" = data.azurerm_subscription.current.subscription_id
4445
"resource_group" = data.azurerm_resource_group.core.name

0 commit comments

Comments
 (0)