File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,6 +9,17 @@ resource "azurerm_container_registry" "alz" {
99 network_rule_bypass_option = var. use_private_networking ? " AzureServices" : " None"
1010}
1111
12+ resource "azapi_update_resource" "network_rule_bypass_allowed_for_tasks" {
13+ count = var. use_self_hosted_agents && var. use_private_networking ? 1 : 0
14+ type = " Microsoft.ContainerRegistry/registries@2025-05-01-preview"
15+ resource_id = azurerm_container_registry. alz [0 ]. id
16+ body = {
17+ properties = {
18+ networkRuleBypassAllowedForTasks = true
19+ }
20+ }
21+ }
22+
1223resource "azurerm_container_registry_task" "alz" {
1324 count = var. use_self_hosted_agents ? 1 : 0
1425 name = " image-build-task"
@@ -39,7 +50,10 @@ resource "azurerm_container_registry_task_schedule_run_now" "alz" {
3950 lifecycle {
4051 replace_triggered_by = [azurerm_container_registry_task . alz ]
4152 }
42- depends_on = [azurerm_role_assignment . container_registry_push_for_task ]
53+ depends_on = [
54+ azurerm_role_assignment . container_registry_push_for_task ,
55+ azapi_update_resource . network_rule_bypass_allowed_for_tasks
56+ ]
4357}
4458
4559resource "azurerm_role_assignment" "container_registry_pull_for_container_instance" {
You can’t perform that action at this time.
0 commit comments