Does anyone know if Azure charges me only for the hours that the website was used or it charges the full price for a month? For example, if I go with Azure Basic B1 plan and my website was accessed only 2 hours in that month, do I get charged only for that 2 hours or do I pay the full 54$ price? Thanks!
I've purchased B1 plan but I don't know if I will be charged for the full price even if my website was barely used in a month.
You will be charged for the entire month.
Each Azure service has a different price model, Eg. Azure Function has a consumption tier. The App Service plans, including B1 plan charges whether or not someone accesses your site.
https://azure.microsoft.com/en-us/pricing/details/app-service/windows/
Can I suggest that you look at Containerising your site and hosting in Azure Container Apps. Set the replica to scale down to 0 and you'll find that after ~10 minutes of inactivity your app will scale to 0 and you'll stop paying the active vCPU rate and pay the idle usage rate. There's also a generous free tier.