@Mahavir Saroj , Yes, you could use Azure Automation to schedule a runbook to run at regular interval to check for the policy assignment and assign it again if the assignment has been deleted. For details, see Azure Policy PowerShell.
You may also refer the following links for details on Azure Automation Runbook:
- Creating Azure Automation Runbook
- Manage schedules in Azure Automation However, this will not resolve much of the issue. If a user can delete the lock, policy assignment etc., how would you stop this or other users from deleting the Azure Automation Account OR the runbook from being executed? Therefore, the better solution in this case is Azure RBAC to ensure that only specific users have access to modify these things. For details of Azure Policy RBAC, see Azure Policy RBAC. Hope this helps. Please let me know if you have any questions.
If the answer helped, please click Accept answer so that it can help others in the community looking for help on similar topics.