Template Validation is failing with a message "invalid copy batch size" while using batchsize decorator and empty array in for loop #4386
-
Hi , I am experiencing an issue which I have tried my best but not sure how this can be resolved. Could you please help me on the same. I'm doing the RBAC assignment code , as I need to assign multiple identities in to the specific role so looped it. But noticed that code fails if the array of objects which I have looped is empty. I have set an if condition to validate whether it is empty but still the template validation is failing because of this decorator @batchsize(1) when an array is empty. I set this because I need serial execution . To isolate it further I have commented the //@batchsize(1)* and then the code is working fine. if array called v_mgrbacproperties.contributor.AccessGrantedADObjectIds is null below code fails with below error. InvalidTemplate - Deployment template validation failed: 'The template 'copy' definition at line '1' and column '5817' has an invalid copy batch size. The copy batch size must be a non-negative integer value and cannot exceed the copy count '0'. Please see https://aka.ms/arm-copy for usage details. Inputs are
AccessGrantedADObjectIds: [
Now I have commented batchsize then the code works fine.
Could you please let me know how this can be resolved . Thank You. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
See #4319 - we have a fix for this that'll be deployed to the platform in the next ~3 weeks. |
Beta Was this translation helpful? Give feedback.
-
@anthony-c-martin - Thanks for replying quite fast and really appreciate that. I was doing little more digging and found these , Is that the reason for this issue please ?. thanks. As per the documentation . The value for batchSize can't exceed the value for count in the copy element If I pass empty array above condition won't be true , is that creating this issue .
|
Beta Was this translation helpful? Give feedback.
See #4319 - we have a fix for this that'll be deployed to the platform in the next ~3 weeks.