File tree Expand file tree Collapse file tree 2 files changed +42
-34
lines changed
Expand file tree Collapse file tree 2 files changed +42
-34
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,22 @@ var previewLabel = activeLabel == 'blue' ? 'green' : 'blue'
4242var productionLabel = promotePreview ? previewLabel : activeLabel
4343var targetLabel = promotePreview ? productionLabel : previewLabel
4444var useLatestForProductionTraffic = promotePreview || empty (productionRevisionName )
45+ var previewTrafficEntry = {
46+ label : previewLabel
47+ latestRevision : true
48+ weight : 0
49+ }
50+ var productionTrafficEntry = useLatestForProductionTraffic
51+ ? {
52+ label : productionLabel
53+ latestRevision : true
54+ weight : 100
55+ }
56+ : {
57+ label : productionLabel
58+ revisionName : productionRevisionName
59+ weight : 100
60+ }
4561
4662var apiEnvironmentVariables = [
4763 {
@@ -98,23 +114,11 @@ resource containerApp 'Microsoft.App/containerApps@2025-10-02-preview' = {
98114 external : true
99115 targetPort : 8080
100116 allowInsecure : false
101- traffic : [
102- {
103- label : previewLabel
104- latestRevision : true
105- weight : 0
106- }
107- useLatestForProductionTraffic
108- ? {
109- label : productionLabel
110- latestRevision : true
111- weight : 100
112- }
113- : {
114- label : productionLabel
115- revisionName : productionRevisionName
116- weight : 100
117- }
117+ traffic : promotePreview ? [
118+ productionTrafficEntry
119+ ] : [
120+ previewTrafficEntry
121+ productionTrafficEntry
118122 ]
119123 }
120124 dapr : {
Original file line number Diff line number Diff line change @@ -21,6 +21,22 @@ var previewLabel = activeLabel == 'blue' ? 'green' : 'blue'
2121var productionLabel = promotePreview ? previewLabel : activeLabel
2222var targetLabel = promotePreview ? productionLabel : previewLabel
2323var useLatestForProductionTraffic = promotePreview || empty (productionRevisionName )
24+ var previewTrafficEntry = {
25+ label : previewLabel
26+ latestRevision : true
27+ weight : 0
28+ }
29+ var productionTrafficEntry = useLatestForProductionTraffic
30+ ? {
31+ label : productionLabel
32+ latestRevision : true
33+ weight : 100
34+ }
35+ : {
36+ label : productionLabel
37+ revisionName : productionRevisionName
38+ weight : 100
39+ }
2440
2541resource containerApp 'Microsoft.App/containerApps@2025-10-02-preview' = {
2642 name : containerAppName
@@ -50,23 +66,11 @@ resource containerApp 'Microsoft.App/containerApps@2025-10-02-preview' = {
5066 external : true
5167 targetPort : 80
5268 allowInsecure : false
53- traffic : [
54- {
55- label : previewLabel
56- latestRevision : true
57- weight : 0
58- }
59- useLatestForProductionTraffic
60- ? {
61- label : productionLabel
62- latestRevision : true
63- weight : 100
64- }
65- : {
66- label : productionLabel
67- revisionName : productionRevisionName
68- weight : 100
69- }
69+ traffic : promotePreview ? [
70+ productionTrafficEntry
71+ ] : [
72+ previewTrafficEntry
73+ productionTrafficEntry
7074 ]
7175 }
7276 }
You can’t perform that action at this time.
0 commit comments