Skip to content

Commit

Permalink
Merge pull request #59 from Barts-Life-Science/andrii-dev
Browse files Browse the repository at this point in the history
Airlock Notifier updates
  • Loading branch information
akolensky authored May 20, 2024
2 parents bb84e17 + c5ee70e commit b9d8239
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 29 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ terraform.rc
**/http-client.private.env.json

# vscode
.vscode

# node
node_modules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,34 +147,35 @@
"runAfter": {},
"type": "ParseJson"
},
"Send_Email_with_SMTP": {
"Send_an_email_(V2)": {
"inputs": {
"parameters": {
"body": "<a href=\"@{parameters('tre_url')}/workspaces/@{body('Parse_JSON')?['data']?['workspace']?['id']}/requests/@{body('Parse_JSON')?['data']?['request']?['id']}\">View the request</a>",
"from": "@parameters('smtp_from_email')",
"importance": "Normal",
"subject": "@variables('message')",
"to": "@{join(variables('recipients'), ';')}"
},
"serviceProviderConfiguration": {
"connectionName": "Smtp",
"operationId": "sendEmail",
"serviceProviderId": "/serviceProviders/Smtp"
}
"body": {
"Body": "<p>@{concat(parameters('tre_url'),'/workspaces/',body('Parse_JSON')?['data']?['workspace']?['id'],'/requests/',body('Parse_JSON')?['data']?['request']?['id'])}</p>",
"Importance": "Normal",
"Subject": "@variables('message')",
"To": "@{join(variables('recipients'),';')}"
},
"host": {
"connection": {
"referenceName": "outlook"
}
},
"method": "post",
"path": "/v2/Mail"
},
"runAfter": {
"Switch_on_request_status": [
"Succeeded"
]
"Switch_on_request_status": [
"SUCCEEDED"
]
},
"type": "ServiceProvider"
},
"type": "ApiConnection"
},
"Succeeded": {
"inputs": {
"runStatus": "Succeeded"
},
"runAfter": {
"Send_Email_with_SMTP": [
"Send_an_email_(V2)": [
"Succeeded"
]
},
Expand Down
14 changes: 13 additions & 1 deletion templates/shared_services/airlock_notifier/app/connections.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@
"type": "ManagedServiceIdentity"
},
"connectionRuntimeUrl": "@appsetting('smtp_connection_runtime_url')"
}
},
"outlook": {
"api": {
"id": "/subscriptions/@appsetting('subscription')/providers/Microsoft.Web/locations/uksouth/managedApis/outlook"
},
"authentication": {
"type": "ManagedServiceIdentity"
},
"connection": {
"id": "/subscriptions/@appsetting('subscription')/resourceGroups/@appsetting('resource_group')/providers/Microsoft.Web/connections/outlook"
},
"connectionRuntimeUrl": "https://dbd1728c4196793d.11.common.logic-uksouth.azure-apihub.net/apim/outlook/3a2261e686234238a0058f766e39e7a4"
}
}
}
2 changes: 1 addition & 1 deletion templates/shared_services/airlock_notifier/porter.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
schemaVersion: 1.0.0
name: tre-shared-service-airlock-notifier
version: 0.9.0
version: 0.9.3
description: "A shared service notifying on Airlock Operations"
registry: azuretre
dockerfile: Dockerfile.tmpl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ resource "azurerm_logic_app_standard" "logic_app" {
storage_account_name = data.azurerm_storage_account.storage.name
storage_account_access_key = data.azurerm_storage_account.storage.primary_access_key
virtual_network_subnet_id = data.azurerm_subnet.airlock_notification.id
version = "~4"
app_settings = {
"FUNCTIONS_WORKER_RUNTIME" = "node"
"WEBSITE_NODE_DEFAULT_VERSION" = "~12"
"WEBSITE_NODE_DEFAULT_VERSION" = "~14"
"serviceBus_connectionString" = data.azurerm_servicebus_namespace.core.default_primary_connection_string
"subscription" = data.azurerm_subscription.current.subscription_id
"resource_group" = data.azurerm_resource_group.core.name
Expand Down
10 changes: 4 additions & 6 deletions templates/workspaces/base-adf/terraform/adf_link.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ data "azurerm_data_factory" "adf_core" {

# Create a private endpoint to the storage account from the data platform
resource "azurerm_data_factory_managed_private_endpoint" "adf_dataplatform_pe" {
name = "pe-adf-ws-${local.workspace_resource_name_suffix}"
data_factory_id = data.azurerm_data_factory.adf_core.id
target_resource_id = azurerm_storage_account.stg.id
subresource_name = "file"
name = "pe-adf-ws-${local.workspace_resource_name_suffix}"
data_factory_id = data.azurerm_data_factory.adf_core.id
target_resource_id = azurerm_storage_account.stg.id
subresource_name = "file"
}


Expand All @@ -29,5 +29,3 @@ resource "azurerm_data_factory_linked_service_azure_file_storage" "ls_shared_fil
integration_runtime_name = "adf-ir-${var.tre_id}"
file_share = "vm-shared-storage"
}

# Create a data source in the data factory
7 changes: 7 additions & 0 deletions templates/workspaces/base-adf/terraform/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ terraform {
source = "Azure/azapi"
version = "=1.5.0"
}
null = {
source = "hashicorp/null"
version = "3.2.2"
}
}

backend "azurerm" {}
Expand Down Expand Up @@ -42,3 +46,6 @@ provider "azuread" {

provider "azapi" {
}

provider "null" {
}

0 comments on commit b9d8239

Please sign in to comment.