questions about use of Azure and how billing works

Jörgen Ståhl 20 Reputation points
2025-04-04T13:15:29.7966667+00:00

Question about use of subscription in Azure.

Hi, I have some questions about use of Azure and how billing works, if I as a private person have a subscription, pay as you go, and it is solely for testing purpose so following scenario will be used.

Scenario: I create a resource group with some virtual servers, network and SQL server with some databases. I want to create a Powershell script, so I can create these resources quickly and when I am done testing, I will remove the whole resource group with al its resources. Let say they are up and running for 4 hours, during testing then removed again.

Questions:

-          Will I have to pay for creation of these resources every time I run this powershell script?

-          Will I be billed for these 4 hours, these resources are up and running?

-          Are there any subscription fee, every month, even if I do not have any resources at all running?

Azure Cost Management
Azure Cost Management
A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
3,609 questions
0 comments No comments
{count} votes

Accepted answer
  1. Michael Taylor 60,326 Reputation points
    2025-04-04T14:01:55.96+00:00

    Caveat: Pricing is based upon each resource so you cannot easily answer broad questions like this without knowing specifically what resources you intend to create. All your questions can be answered, in general, by using the Azure Price Calculator and following the links for each resource you want to create to get more information about the pricing model. Each resource is different.

    Caveat 2: This is my opinion, based upon my experience with Azure.

    • There is no inherent cost for creating a resource that I'm aware of. You can create a resource as many times as you want. However there may be costs with the network ingress/egress calls that happen and other "creation" related things.
    • Yes you will be billed. VMs are charged for the hours they are on. But there are additional costs with VMs as well that you need to take into account. The disk(s) you use to store the VM on are an additional cost and are per month. AFAIK if you create a VM and then remove it you'll get charged for the disk for the month. If you create a new VM then you'll get charged again. MS has no real way of knowing that you're recreating the same VM over and over again.

    On top of that you pay for the transactions (in batches) to the storage. If you're recreating the VM each time you'll have more transactions as you'll be doing more IO to get the VM installed. You also pay for network egress calls. None of this is easily calculatable since we have no way of knowing what ultimately you'll be doing.

    • For an Azure subscription itself, no. However if you create resources and then remove them it is pretty common to leave things laying around. Some Azure services do charge even if you're not using them. VMs, for example, incur the storage cost even if the VM isn't running. The VM itself only charges if it is running. SQL databases also cost money every month even if you're not using them.

    For dev/testing I would recommend you look into using the free/shared tiers of services. The performance isn't great but you're just testing anyway. The cost will be lower. Another aspect to consider is your subscription and credits. MS tends to offer credits for some services and subscriptions tend to offer even more. For example I would recommend you look into a VS subscription if you don't have one. The initial upfront cost is high ($3,000??) for a year but renewals are cheap ($800?) and you get monthly Azure credit which may help offset your costs.

    Another thing to consider is not "wiping" your resources. If you're testing creation scripts then ideally they should be configured to handle the case of a resource already existing. If you have to set up 3 resources and the first 2 work but the last one fails then you're wasting a lot of time and money having to clean up and set up the 2 resources you know work. I would recommend you don't recreate resources once you have them scripted and working. Once all your resources are installing correctly then you can consider wiping them all and doing a final test to ensure they all recreate properly. It would be less costly (in time and money) if you simply reconfigured a VM over recreating it.

    Your specific pricing is hard to answer since your specific subscription and credits may vary from everyone else's. The pricing should be used as a ballpark estimate and not as an absolute low/high value.

    2 people found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.