Skip to content

Commit b4475eb

Browse files
committed
Remove function app sync bash command
This is now the responsibility of the component
1 parent ca3ae71 commit b4475eb

File tree

4 files changed

+2
-88
lines changed

4 files changed

+2
-88
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
- Azure: Add new required `frontdoor_id` Terraform variable for components with `endpoint` defined
2020
- Azure: Add `--with-sp-login` option to `mach plan` command
2121
- Azure: Add two extra tags to all resources: `environment` and `site`
22+
- Azure: Remove function app sync bash command: this is now the responsibility of the component
2223

2324

2425
**Breaking changes**

src/mach/templates/partials/component.tf

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,4 @@ module "{{ component.name }}" {
100100
null_resource.commercetools,
101101
{% endif %}
102102
]
103-
}
104-
105-
{% if site.azure and component.has_cloud_integration %}
106-
# see https://docs.microsoft.com/en-us/azure/azure-functions/functions-deployment-technologies#trigger-syncing
107-
# this updates the functionapp in case of any changes.
108-
data "external" "sync_triggers_{{ component.name }}" {
109-
program = ["bash", "-c", "az rest --method post --uri 'https://management.azure.com/subscriptions/${local.subscription_id}/resourceGroups/${local.resource_group_name}/providers/Microsoft.Web/sites/${module.{{ component.name }}.app_service_name}/syncfunctiontriggers?api-version=2016-08-01'"]
110-
111-
# need to make sure this runs after the module
112-
depends_on = [
113-
module.{{ component.name }}.app_service_name
114-
]
115-
}
116-
{% endif %}
103+
}

tests/files/azure_config1_expected_mach-site-eu.json

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -628,43 +628,5 @@
628628
]
629629
}
630630
}
631-
],
632-
"data": [
633-
{
634-
"external": {
635-
"sync_triggers_us-payment": {
636-
"program": [
637-
[
638-
"bash",
639-
"-c",
640-
"az rest --method post --uri 'https://management.azure.com/subscriptions/${local.subscription_id}/resourceGroups/${local.resource_group_name}/providers/Microsoft.Web/sites/${module.us-payment.app_service_name}/syncfunctiontriggers?api-version=2016-08-01'"
641-
]
642-
],
643-
"depends_on": [
644-
[
645-
"${module.us-payment.app_service_name}"
646-
]
647-
]
648-
}
649-
}
650-
},
651-
{
652-
"external": {
653-
"sync_triggers_api-extensions": {
654-
"program": [
655-
[
656-
"bash",
657-
"-c",
658-
"az rest --method post --uri 'https://management.azure.com/subscriptions/${local.subscription_id}/resourceGroups/${local.resource_group_name}/providers/Microsoft.Web/sites/${module.api-extensions.app_service_name}/syncfunctiontriggers?api-version=2016-08-01'"
659-
]
660-
],
661-
"depends_on": [
662-
[
663-
"${module.api-extensions.app_service_name}"
664-
]
665-
]
666-
}
667-
}
668-
}
669631
]
670632
}

tests/files/azure_config1_expected_mach-site-us.json

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -505,42 +505,6 @@
505505
]
506506
}
507507
}
508-
},
509-
{
510-
"external": {
511-
"sync_triggers_payment": {
512-
"program": [
513-
[
514-
"bash",
515-
"-c",
516-
"az rest --method post --uri 'https://management.azure.com/subscriptions/${local.subscription_id}/resourceGroups/${local.resource_group_name}/providers/Microsoft.Web/sites/${module.payment.app_service_name}/syncfunctiontriggers?api-version=2016-08-01'"
517-
]
518-
],
519-
"depends_on": [
520-
[
521-
"${module.payment.app_service_name}"
522-
]
523-
]
524-
}
525-
}
526-
},
527-
{
528-
"external": {
529-
"sync_triggers_api-extensions": {
530-
"program": [
531-
[
532-
"bash",
533-
"-c",
534-
"az rest --method post --uri 'https://management.azure.com/subscriptions/${local.subscription_id}/resourceGroups/${local.resource_group_name}/providers/Microsoft.Web/sites/${module.api-extensions.app_service_name}/syncfunctiontriggers?api-version=2016-08-01'"
535-
]
536-
],
537-
"depends_on": [
538-
[
539-
"${module.api-extensions.app_service_name}"
540-
]
541-
]
542-
}
543-
}
544508
}
545509
],
546510
"module": [

0 commit comments

Comments
 (0)