Skip to content

Commit 040c5c5

Browse files
committed
Reapply "Only add an explicit dependency on an existing resource when the deployments engine will use the GET response" (#15524)
This reverts commit 1435468.
1 parent 4b190e2 commit 040c5c5

File tree

26 files changed

+515
-175
lines changed

26 files changed

+515
-175
lines changed

src/Bicep.Core.IntegrationTests/ExistingResourceTests.cs

Lines changed: 401 additions & 0 deletions
Large diffs are not rendered by default.

src/Bicep.Core.IntegrationTests/ScenarioTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5065,7 +5065,7 @@ public void Test_Issue10343()
50655065
"));
50665066

50675067
var evaluated = TemplateEvaluator.Evaluate(result.Template);
5068-
evaluated.Should().HaveValueAtPath("resources.foo3.dependsOn", new JArray("foo2"));
5068+
evaluated.Should().HaveValueAtPath("resources.foo3.dependsOn", new JArray("foo1"));
50695069
}
50705070

50715071
// https://github.com/Azure/bicep/issues/11292
@@ -6315,7 +6315,7 @@ public void Test_Issue13596(bool enableSymbolicNameCodegen)
63156315

63166316
if (enableSymbolicNameCodegen)
63176317
{
6318-
result.Template.Should().HaveJsonAtPath("$.resources.secret.dependsOn", """["sa"]""");
6318+
result.Template.Should().HaveJsonAtPath("$.resources.secret.dependsOn", """["mod"]""");
63196319
}
63206320
else
63216321
{

src/Bicep.Core.Samples/Files/baselines/Modules_CRLF/main.symbolicnames.json

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"_generator": {
77
"name": "bicep",
88
"version": "dev",
9-
"templateHash": "12632249060210513106"
9+
"templateHash": "14846102413726496336"
1010
}
1111
},
1212
"parameters": {
@@ -1851,10 +1851,7 @@
18511851
}
18521852
}
18531853
}
1854-
},
1855-
"dependsOn": [
1856-
"kv"
1857-
]
1854+
}
18581855
},
18591856
"secureModule2": {
18601857
"type": "Microsoft.Resources/deployments",
@@ -1912,10 +1909,7 @@
19121909
}
19131910
}
19141911
}
1915-
},
1916-
"dependsOn": [
1917-
"scopedKv"
1918-
]
1912+
}
19191913
},
19201914
"secureModuleLooped": {
19211915
"copy": {
@@ -1977,11 +1971,7 @@
19771971
}
19781972
}
19791973
}
1980-
},
1981-
"dependsOn": [
1982-
"[format('loopedKv[{0}]', copyIndex())]",
1983-
"[format('loopedKv[{0}]', copyIndex())]"
1984-
]
1974+
}
19851975
},
19861976
"secureModuleCondition": {
19871977
"type": "Microsoft.Resources/deployments",
@@ -2024,10 +2014,7 @@
20242014
}
20252015
}
20262016
}
2027-
},
2028-
"dependsOn": [
2029-
"kv"
2030-
]
2017+
}
20312018
},
20322019
"withSpace": {
20332020
"type": "Microsoft.Resources/deployments",

src/Bicep.Core.Samples/Files/baselines/NestedResources_LF/main.symbolicnames.json

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"_generator": {
77
"name": "bicep",
88
"version": "dev",
9-
"templateHash": "16972434704035043060"
9+
"templateHash": "236868819280717113"
1010
}
1111
},
1212
"parameters": {
@@ -71,19 +71,13 @@
7171
"properties": {
7272
"size": "[reference('existingParent').size]",
7373
"style": "[reference('existingParent::existingChild').style]"
74-
},
75-
"dependsOn": [
76-
"existingParent::existingChild"
77-
]
74+
}
7875
},
7976
"existingParent::existingChild": {
8077
"existing": true,
8178
"type": "My.Rp/parentType/childType",
8279
"apiVersion": "2020-12-01",
83-
"name": "[format('{0}/{1}', 'existingParent', 'existingChild')]",
84-
"dependsOn": [
85-
"existingParent"
86-
]
80+
"name": "[format('{0}/{1}', 'existingParent', 'existingChild')]"
8781
},
8882
"conditionParent::conditionChild::conditionGrandchild": {
8983
"condition": "[and(and(parameters('createParent'), parameters('createChild')), parameters('createGrandchild'))]",

src/Bicep.Core.Samples/Files/baselines/Resources_CRLF/main.symbolicnames.json

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"_generator": {
77
"name": "bicep",
88
"version": "dev",
9-
"templateHash": "12953345672979673276"
9+
"templateHash": "15062227467638827925"
1010
}
1111
},
1212
"parameters": {
@@ -665,10 +665,7 @@
665665
"p3_child1": {
666666
"type": "Microsoft.Rp1/resource1/child1",
667667
"apiVersion": "2020-06-01",
668-
"name": "[format('{0}/{1}', 'res1', 'child1')]",
669-
"dependsOn": [
670-
"p3_res1"
671-
]
668+
"name": "[format('{0}/{1}', 'res1', 'child1')]"
672669
},
673670
"p4_res1": {
674671
"existing": true,
@@ -682,10 +679,7 @@
682679
"type": "Microsoft.Rp1/resource1/child1",
683680
"apiVersion": "2020-06-01",
684681
"scope": "/",
685-
"name": "[format('{0}/{1}', 'res1', 'child1')]",
686-
"dependsOn": [
687-
"p4_res1"
688-
]
682+
"name": "[format('{0}/{1}', 'res1', 'child1')]"
689683
},
690684
"sqlServer": {
691685
"type": "Microsoft.Sql/servers",

src/Bicep.Core.Samples/Files/user_submitted/101/api-management-modular/NameValues.symbolicnames.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"_generator": {
77
"name": "bicep",
88
"version": "dev",
9-
"templateHash": "11528852364160566097"
9+
"templateHash": "14248540637091011874"
1010
}
1111
},
1212
"parameters": {
@@ -56,10 +56,7 @@
5656
"secret": "[variables('apimNameValueSet')[copyIndex()].isSecret]",
5757
"value": "[variables('apimNameValueSet')[copyIndex()].value]",
5858
"tags": "[variables('apimNameValueSet')[copyIndex()].tags]"
59-
},
60-
"dependsOn": [
61-
"parentAPIM"
62-
]
59+
}
6360
}
6461
},
6562
"outputs": {

src/Bicep.Core.Samples/Files/user_submitted/101/api-management-modular/groups.symbolicnames.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"_generator": {
77
"name": "bicep",
88
"version": "dev",
9-
"templateHash": "403029788224868668"
9+
"templateHash": "6816770503491912011"
1010
}
1111
},
1212
"parameters": {
@@ -47,10 +47,7 @@
4747
"properties": {
4848
"displayName": "[variables('groupsSet')[copyIndex()].groupDisplayName]",
4949
"description": "[variables('groupsSet')[copyIndex()].groupDescription]"
50-
},
51-
"dependsOn": [
52-
"parentAPIM"
53-
]
50+
}
5451
}
5552
},
5653
"outputs": {

src/Bicep.Core.Samples/Files/user_submitted/101/api-management-modular/main.symbolicnames.json

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"_generator": {
77
"name": "bicep",
88
"version": "dev",
9-
"templateHash": "13726378283629199613"
9+
"templateHash": "2208926443863165998"
1010
}
1111
},
1212
"parameters": {
@@ -163,7 +163,7 @@
163163
"_generator": {
164164
"name": "bicep",
165165
"version": "dev",
166-
"templateHash": "403029788224868668"
166+
"templateHash": "6816770503491912011"
167167
}
168168
},
169169
"parameters": {
@@ -204,10 +204,7 @@
204204
"properties": {
205205
"displayName": "[variables('groupsSet')[copyIndex()].groupDisplayName]",
206206
"description": "[variables('groupsSet')[copyIndex()].groupDescription]"
207-
},
208-
"dependsOn": [
209-
"parentAPIM"
210-
]
207+
}
211208
}
212209
},
213210
"outputs": {
@@ -251,7 +248,7 @@
251248
"_generator": {
252249
"name": "bicep",
253250
"version": "dev",
254-
"templateHash": "8034218730798252475"
251+
"templateHash": "16793550498477002119"
255252
}
256253
},
257254
"parameters": {
@@ -301,10 +298,7 @@
301298
"email": "[variables('usersSet')[copyIndex()].email]",
302299
"state": "[variables('usersSet')[copyIndex()].state]",
303300
"note": "[variables('usersSet')[copyIndex()].notes]"
304-
},
305-
"dependsOn": [
306-
"parentAPIM"
307-
]
301+
}
308302
}
309303
}
310304
}
@@ -336,7 +330,7 @@
336330
"_generator": {
337331
"name": "bicep",
338332
"version": "dev",
339-
"templateHash": "11528852364160566097"
333+
"templateHash": "14248540637091011874"
340334
}
341335
},
342336
"parameters": {
@@ -386,10 +380,7 @@
386380
"secret": "[variables('apimNameValueSet')[copyIndex()].isSecret]",
387381
"value": "[variables('apimNameValueSet')[copyIndex()].value]",
388382
"tags": "[variables('apimNameValueSet')[copyIndex()].tags]"
389-
},
390-
"dependsOn": [
391-
"parentAPIM"
392-
]
383+
}
393384
}
394385
},
395386
"outputs": {

src/Bicep.Core.Samples/Files/user_submitted/101/api-management-modular/users.symbolicnames.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"_generator": {
77
"name": "bicep",
88
"version": "dev",
9-
"templateHash": "8034218730798252475"
9+
"templateHash": "16793550498477002119"
1010
}
1111
},
1212
"parameters": {
@@ -56,10 +56,7 @@
5656
"email": "[variables('usersSet')[copyIndex()].email]",
5757
"state": "[variables('usersSet')[copyIndex()].state]",
5858
"note": "[variables('usersSet')[copyIndex()].notes]"
59-
},
60-
"dependsOn": [
61-
"parentAPIM"
62-
]
59+
}
6360
}
6461
}
6562
}

src/Bicep.Core.Samples/Files/user_submitted/101/azure-bastion/main.symbolicnames.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"_generator": {
77
"name": "bicep",
88
"version": "dev",
9-
"templateHash": "5898567106534730923"
9+
"templateHash": "12715898051173612753"
1010
}
1111
},
1212
"parameters": {
@@ -149,10 +149,7 @@
149149
]
150150
}
151151
}
152-
},
153-
"dependsOn": [
154-
"existingVirtualNetwork"
155-
]
152+
}
156153
},
157154
"bastionHost": {
158155
"type": "Microsoft.Network/bastionHosts",

0 commit comments

Comments
 (0)