Skip to content

feat: Adds a script to get all vm sizes #338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JannoTjarks
Copy link
Member

Hi, this PR adds a powershell script, which enables me to get a list of all vm sizes. Im not sure, if this is from interest for others, but i will use it for a new PR, which updates the vm sizes :)

@wata727
Copy link
Member

wata727 commented Jun 16, 2024

Thank you for your contribution!

This kind of automation is very interesting, but ideally it would be nice to have it run automatically in CI (Imagine something like the watch workflow). At least, I'm not familiar with the Az PowerShell module so I don't know how to run this 😓

Have any good ideas?

@JannoTjarks
Copy link
Member Author

Hi :)
Sorry for my very late reply.

My idea would also be to run this maybe one time in the week to update the allowed vm sizes.

But for this we have two issues to handle:

  1. How can we dynamically update the Go slice, which's contains all the valid strings.
    -> My idea: We can write the valid vm sizes into a .csv (or something similar) file which will be parsed into the validVmSizes slice at compile-time.

  2. The Azure Powershell Modules requires an Authentication on a real azure tenant to get the currently available vm sizes.
    -> Is there any kind of test tenant available for this project? Or would it be possible to request this from Microsoft?

@wata727
Copy link
Member

wata727 commented Mar 12, 2025

How can we dynamically update the Go slice, which's contains all the valid strings.

I think a good approach would be to use Go template strings to automatically generate files. For instance, the list of taggable resources is generated as follows:

const templateBody = `
// Code generated by generator/main.go; DO NOT EDIT.
package tags
var Resources = []string{
{{- range .Resources }}
"{{ . }}",
{{- end }}
}
`

The Azure Powershell Modules requires an Authentication on a real azure tenant to get the currently available vm sizes.
Is there any kind of test tenant available for this project? Or would it be possible to request this from Microsoft?

Unfortunately we don't have a test tenant... We might be able to get some help from Microsoft, but I'm not sure if they have it.

Another interesting idea is to automate such maintenance tasks with AI (e.g. Copilot Agent, Devin, OpenHands, Cline, and so on). The AzureRM ruleset requires more manual maintenance tasks than other ruleset repositories, so I plan to experiment for a while to see if I can automate the tasks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants