Forum Discussion
Issue while deploying Sentienl Rules
I know that when deleting a Sentinel rule, you need to wait a specific amount of time before it can be redeployed. However, in this tenant, we've been waiting for almost a month and are still getting the same deployment error ('was recently deleted. You need to allow some time before re-using the same ID. Please try again later. Click here for details'). I still want to use the same ID ect. Does anyone have any idea or similar issue why it's still not possible after waiting for about a month?
3 Replies
- AnkitBrass Contributor
Hi @StefanHartmann1
Normally, the soft-delete state for analytics rules lasts up to 14 days, but if the deletion was tied to a deployment via ARM/Bicep/Terraform, the ID can get “stuck” in the resource provider’s cache for much longer. In some cases, the only way to reuse the same ID is to open a Microsoft support ticket so they can manually clear it from the backend. If reusing the exact same ID is critical, I’d recommend raising a support case with the Microsoft.SecurityInsights resource provider details and rule name/ID — otherwise, changing the ruleId (GUID) in your template is the quickest workaround.
Feel free to reply if you have any issues!
- jdomCopper Contributor
Hi StefanHartmann1
I've seen this in instances where there are still traces relating to that original ID, not allowing overwriting.
Note that the ID is the Name, you can use this PS query below to see the state of the rule:
Get-AzSentinelAlertRule -ResourceGroupName <RG-Name> -WorkspaceName <LogAnalytics-Name> `
| where Name -eq "<Rule-ID>"And the equivalent removal PS: https://learn.microsoft.com/en-us/powershell/module/az.securityinsights/remove-azsentinelalertrule?view=azps-13.0.0
Outside of that you will have three options:- If the same GUID is not explicitly required, deploy the rule under a new ID.
- Raise a Microsoft support case
- Continue waiting.
Feel free to reply if you have any issues!
- emilio123Copper Contributor
None of these options work in a detection-as-code context where you need to delete and republish rules often, as is our case. This is terrible UX and architecture, I really hope Microsoft realizes the negative impacts is has on customers and fixes this problem.