@@ -39,6 +39,11 @@ steps:
3939 parameters :
4040 serviceConnection : $(ACN_TEST_SERVICE_CONNECTION)
4141 resourceType : resourcegroups
42+ createCondition : |
43+ and(succeeded(),
44+ or(not(variables.OUT_RESULT_LENGTH),
45+ lt(variables.OUT_RESULT_LENGTH, variables.ACNCI_POOL_SIZE)))
46+ updateCondition : False
4247 inputs :
4348 resourceGroupList : $(OUT_RESULT)
4449 resourceGroupCount : $(OUT_RESULT_LENGTH)
@@ -47,11 +52,6 @@ steps:
4752 buildTagDefinitionIdKey : $(ACNCI_BUILDTAG_DEFINITIONID)
4853 buildTagCreatedByAppIdKey : $(ACNCI_BUILDTAG_CREATEDBYAPPID)
4954 buildTagCreatedByBuildIdKey : $(ACNCI_BUILDTAG_CREATEDBYAPPID)
50- createCondition : |
51- and(succeeded(),
52- or(not(variables.OUT_RESULT_LENGTH),
53- lt(variables.OUT_RESULT_LENGTH, variables.ACNCI_POOL_SIZE)))
54- updateCondition : False
5555
5656- task : AzureCLI@2
5757 name : resourcegroups
@@ -96,20 +96,20 @@ steps:
9696 serviceConnection : $(ACN_TEST_SERVICE_CONNECTION)
9797 resourceType : managedidentity
9898 refreshAfterCreation : True
99+ createCondition : |
100+ and(succeeded(),
101+ or(not(variables.OUT_RESULT_LENGTH),
102+ eq(variables.OUT_RESULT_LENGTH, 'null'),
103+ lt(variables.OUT_RESULT_LENGTH, 1)))
104+ updateCondition : False
99105 inputs :
100106 managedIdentityList : $(OUT_RESULT)
101107 managedIdentityCount : $(OUT_RESULT_LENGTH)
102- managedIdentityName : ' $(ACNCI_MANAGEDIDENTITY_PREFIX)- $(LOCAL_ACNCI_UNIQUE_ID)-$(resourcegroups.ACNCI_BUILD_RESOURCEGROUP_LOCATION)'
108+ managedIdentityName : ' $(ACNCI_MANAGEDIDENTITY_PREFIX)$(LOCAL_ACNCI_UNIQUE_ID)-$(resourcegroups.ACNCI_BUILD_RESOURCEGROUP_LOCATION)'
103109 resourceGroupName : $(resourcegroups.ACNCI_BUILD_RESOURCEGROUP)
104110 buildTagDefinitionIdKey : $(ACNCI_BUILDTAG_DEFINITIONID)
105111 buildTagCreatedByAppIdKey : $(ACNCI_BUILDTAG_CREATEDBYAPPID)
106112 buildTagCreatedByBuildIdKey : $(ACNCI_BUILDTAG_CREATEDBYBUILDID)
107- createCondition : |
108- and(succeeded(),
109- or(not(variables.OUT_RESULT_LENGTH),
110- eq(variables.OUT_RESULT_LENGTH, 'null'),
111- lt(variables.OUT_RESULT_LENGTH, 1)))
112- updateCondition : False
113113
114114- task : AzureCLI@2
115115 name : managedidentity
@@ -160,6 +160,13 @@ steps:
160160 serviceConnection : $(ACN_TEST_SERVICE_CONNECTION)
161161 resourceType : roledefinition
162162 refreshAfterCreation : True
163+ createCondition : |
164+ and(succeeded(),
165+ or(not(variables.OUT_RESULT_LENGTH),
166+ lt(variables.OUT_RESULT_LENGTH, 1)))
167+ updateCondition : |
168+ and(succeeded(),
169+ gt(variables.OUT_RESULT_LENGTH, 0))
163170 inputs :
164171 roleDefinitionName : $(ACNCI_BUILDUSER_ROLEDEFINITION_NAME)
165172 roleDefinitionJson : $(OUT_RESULT)
@@ -169,13 +176,6 @@ steps:
169176 buildTagDefinitionIdKey : $(ACNCI_BUILDTAG_DEFINITIONID)
170177 buildTagCreatedByAppIdKey : $(ACNCI_BUILDTAG_CREATEDBYAPPID)
171178 buildTagCreatedByBuildIdKey : $(ACNCI_BUILDTAG_CREATEDBYAPPID)
172- createCondition : |
173- and(succeeded(),
174- or(not(variables.OUT_RESULT_LENGTH),
175- lt(variables.OUT_RESULT_LENGTH, 1)))
176- updateCondition : |
177- and(succeeded(),
178- gt(variables.OUT_RESULT_LENGTH, 0))
179179
180180
181181# # Provision MI Roles
@@ -195,19 +195,19 @@ steps:
195195 parameters :
196196 serviceConnection : $(ACN_TEST_SERVICE_CONNECTION)
197197 resourceType : roleassignments
198+ createCondition : |
199+ and(succeeded(),
200+ or(not(variables.OUT_RESULT_LENGTH),
201+ eq(variables.OUT_RESULT, 'null'),
202+ lt(variables.OUT_RESULT_LENGTH, 1)))
203+ updateCondition : False
198204 inputs :
199205 roleName : $(ACNCI_BUILDUSER_ROLEDEFINITION_NAME)
200206 managedIdentityObjectId : $(build.ACNCI_BUILD_SP_APP_OID)
201207 resourceGroupId : $(resourcegroups.ACNCI_BUILD_RESOURCEGROUP_ID)
202208 buildTagDefinitionIdKey : $(ACNCI_BUILDTAG_DEFINITIONID)
203209 buildTagCreatedByAppIdKey : $(ACNCI_BUILDTAG_CREATEDBYAPPID)
204210 buildTagCreatedByBuildIdKey : $(ACNCI_BUILDTAG_CREATEDBYAPPID)
205- createCondition : |
206- and(succeeded(),
207- or(not(variables.OUT_RESULT_LENGTH),
208- eq(variables.OUT_RESULT, 'null'),
209- lt(variables.OUT_RESULT_LENGTH, 1)))
210- updateCondition : False
211211
212212
213213# storage accounts
@@ -226,18 +226,18 @@ steps:
226226 serviceConnection : $(ACN_TEST_SERVICE_CONNECTION)
227227 resourceType : storageaccounts
228228 refreshAfterCreation : True
229+ createCondition : |
230+ and(succeeded(),
231+ or(not(variables.OUT_RESULT_LENGTH),
232+ lt(variables.OUT_RESULT_LENGTH, 1)))
233+ updateCondition : False
229234 inputs :
230235 storageAccountName : ' $(ACNCI_SA_PREFIX)$(LOCAL_ACNCI_UNIQUE_ID)'
231236 resourceGroupName : $(resourcegroups.ACNCI_BUILD_RESOURCEGROUP)
232237 storageAccountManagedIdentityId : $(managedidentity.ACNCI_MANAGEDIDENTITY_ID)
233238 buildTagDefinitionIdKey : $(ACNCI_BUILDTAG_DEFINITIONID)
234239 buildTagCreatedByAppIdKey : $(ACNCI_BUILDTAG_CREATEDBYAPPID)
235240 buildTagCreatedByBuildIdKey : $(ACNCI_BUILDTAG_CREATEDBYBUILDID)
236- createCondition : |
237- and(succeeded(),
238- or(not(variables.OUT_RESULT_LENGTH),
239- lt(variables.OUT_RESULT_LENGTH, 1)))
240- updateCondition : False
241241
242242- task : AzureCLI@2
243243 name : artifact_storage
0 commit comments