Open MgrothEcovadis opened 2 months ago
Hey @MgrothEcovadis, thanks for raising this issue! Could you provide us with the correlation id of the failed delete so we can look further into what happened that caused this error?
cbc2aed4-c8e6-4ca0-a3ff-b47fad0e44a8
Best Regards
Hi @MgrothEcovadis -
Thanks for the correlation ID. As we continue to investigate, I'm curious - do you see any value in having a DenyAssignment protecting the Automation Job from a future write?
Hello @MgrothEcovadis, friendly reminder on the question above. Thanks!
@snarkywolverine does it mean that creating a deployment stack with an automation job in the template will cause an error or will it just be excluded from the deployment stack resource list?
I'm just trying to think through the options, and the ramifications of each.
For now, we're going to stick with Option 1. I'm marking this as 'needs upvote' as a way to solicit customer feedback. (I'll also update the title to allow other resources to also be addressed.
I don't know if denyWriteAndDelete taking into consideration in the case of Automation jobs. They're just execution of automation account runbook, only actions available are resume/stop/suspend. but if they're finished nothing can be done apart of checking the logs. The Automation jobs should be excluded from the deployment stack completely as the jobs are automatically removed after 30 days anyway.
Deployment stack cannot be removed if it includes Automation account jobs Remove-AzResourceGroupDeploymentStack: Long running operation failed with status 'failed'
error: The resource could not be deleted for an unknown reason.
An error occurred while deleting resources. These resources are still present in the stack but can be deleted manually.
To Reproduce Steps to reproduce the behavior:
Expected behavior automation account jobs will be excluded from the deployment stack or capable of being removed.
Repro Environment powershell az version: 12.2.0 Powershell Version: 7.4.5 automation job bicep version: Microsoft.Automation/automationAccounts/jobs@2023-11-01