It depends on how you're creating the VM's.
- If you're creating them via the portal then there is an option to enable shutdown.
- If you're using bicep/terraform/iac then you can use the DevTestLab schedule
- You could also use Azure Policy for consistent shutdown creation, which would work regardless of creation method. https://techcommunity.microsoft.com/t5/azure-governance-and-management/azure-policy-enable-autoshutdown-on-azure-vm/m-p/3300129