There is similar discussion in the GitHub : https://github.com/MicrosoftDocs/azure-docs/issues/40633
You cannot resize the OS down, only up. So this is not possible.
If you want a Windows Server with a 40GB OS disk, we actually have a specific images for that in the Azure Marketplace. They all have [small disks] in the title
---------------------------------------------------------------------------------------------------------------------------------
If the proposed answer was useful please remember to "Upvote" and "Mark as Answer"