Azure Calculator is great. But it lacks some features when working with a massive amount of items and VMs to allow for a more productive operation.
Among the features that were missing:
- Collapse All Items button
- Expand All Items button
- Batch Change Region
- Batch Change Reservation (On-demand to Reserved Instances)
This userscript is the consequence of those needs on a daily basis. Please contribute with your insights as well !
The script adds action buttons close to existing Save/Share/Export buttons.
The userscript is an extension to a browser plugin called TamperMonkey. It is designed to work on Chrome, Edge & Firefox web browsers.
Installation steps:
- Install Tampermonkey extension on your browser
- Add AzureCalculatorUtils.user.js to it. If Tampermonkey is correctly installed, it will ask for your permissions to install the userscript.
- If the Azure Calculator is already open, refresh the page.
1. When I click a button, the browser hangs for a few seconds. This is a normal behavior of Tampermonkey, with blocking threads. Every lineitem that needs to be changed/expanded/collapsed trigger api calls to Microsoft that take around 1s each. Depending on the amount of line items on the calculator we can have a long time waiting for the process to run (with even the browser asking to terminate or wait). Hang in there, it is running and even having to hold on for a while, it is way faster then expanding manually each line item, changing the region, and then collapsing it. For updated status, check the Javascript/Developer Console for status messages during the execution loop.
2. How do I know if the task is still running ? When you click a button, it will become blue. It will remain blue while the task is running, returning to white when finished.
3. I opened up a large estimate, and the buttons are not showing. The script waits for 10 seconds for the page to load and all default Microsoft API calls to be made to kick-in. Depending on the size of the estimate, it can take more than 10s for the calculator to be fully operational and the function that renders the button will timeout. In that case, just hit refresh on the browser and once the data was already loaded, they should show up normally.
Some features have already been identified to be missing:
- Show/Hide a modal spinner while running tasks
- Detailed on-screen status/progress
- You name it !
Please contribute!
Having trouble with the userscript? Open an Issue and we’ll help you sort it out.