Adding roles to the same resource from multiple modules causes unpredictable crashes
Bicep version Bicep CLI version 0.15.31 (3ba6e06a8d)
Describe the bug Error code: { "status": "Failed", "error": { "code": "Conflict", "message": "Can't update instance SubscriptionId: ***, ResourceGroup: , ResourceName : dt- state from Updating to Updating" } }
Short background info; We deploy microservices to get data from different sources and push it into our Azure Digital Twins instance and we deploy these microservices in parallel through Bicep. However, when we deploy two function apps that both need data write access on our digital twin, it may or may not throw this error. While simultaneous resource deployment is completely handled by Bicep, this appears not to be the case for role deployments.
Our only current solution is to have everything deploy serially which greatly increases deploy time, or completely abstract role deployments making the whole flow a lot less organized
To Reproduce Steps to reproduce the behavior: Rather specific case to just give some code to reproduce, but pushing two modules with function apps that both give their own function app access to the same digital twins instance can cause it (but as mentioned not guaranteed)
Additional context Best fix would be if the role deployment first checks if the state of the resource is updating, and if it is updating wait for it to be done before it starts to deploy the new role.
@ogiel This might be a by design behavior of the RP if deploying two resources at the same time. Could you share your Bicep template?
Hi @ogiel, this issue has been marked as stale because it was labeled as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 3 days of this comment. Thanks for contributing to bicep! :smile: :mechanical_arm: