Open aarthyramesh1988 opened 5 months ago
Hi, Is there any update to this? @alex-frankel
Sorry about the delay! The short answer is Bicep always re-deploys all resources by design so that we always seek out the goal state.
The longer answer:
For this specific pattern of capturing creation time, there is a set of system level properties that ARM tracks for you automatically called systemData
so that you shouldn't have to do this. Here's an example:
{
"location": "eastus",
"properties": {},
"systemData": {
"createdBy": "alfran@microsoft.com",
"createdByType": "User",
"createdAt": "2024-07-10T17:28:35.7655839Z",
"lastModifiedBy": "alfran@microsoft.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2024-07-10T17:28:36.3352979Z"
},
"id": "...",
"type": "Microsoft.Resources/templateSpecs",
"name": "..."
}
Unfortunately, it is up to each resource provider to implement this property and it looks like managed identities have not implemented it. I can try following up with the ARM team responsible for getting the RPs to onboard to this.
cc @ifeoluwaokunoren / @jennyhunter-msft
Just circling back as I mentioned I would, but confirmed that it is up to the RP to implement the systemData
property and there is no ETA for the ManagedIdentity RP implementing this. Unfortunately that means that there is not a great solution for keeping track of this metadata via the bicep deployment. Going to leave this open for reference but tagging the initial request with "Won't Fix" for clarity.
Is your feature request related to a problem? Please describe. In the resource deployments in bicep, we have added a tag with creation date as current datetime. So, in subsequent redeployments, the resources are recreated since the date has changed.
Describe the solution you'd like In terraform this can be handled with lifecycle block where the list of properties can be ignored. Please can this be implemented in bicep; it is a pain that we can't ignore such changes and it leads to recreation of resources every time.