What is an STG Region in Azure? - azure

Found in locations/regions appended by STG when running az vm list-skus --size "Standard_A" --resource-type "virtualMachines" --output table. Example SouthCentralUSSTG.
Not sure what does it mean. Is this a valid region to be used in azure location?

I have tried to list the all-region in azure i didn't found any region like STG AFAIK, it's not valid to use in azure

Related

Choose classic cloud service VM size according deployment region

I'm deploying classic cloud service in different regions using ARM templates, till now was using same VM type(Standard_D2_v2) for all deployments, but found out that this VM is not available in all regions where I'm going to deploy. What are options to choose VM type according deployment region?
Some regions do not have those available sizes. Can you change the VM sizes to the below
Standard_B1ls1. You might also have to check the cost if you using Micorosoft Azure
There might be an issue for that size in that region you are trying to deploy or it may not be available for you. So, you might be getting this error:
The operation '{Operation ID}' failed: 'The requested VM tier is currently not available in Region ({Region ID}) for this subscription. Please try another tier or deploy to a different location.'.
To Check the sizes available for your subscription in that region you can use azure Powershell or azure CLI with the below commands :
az vm list-skus --location southcentralus --output table -- Azure CLI
Get-AzComputeResourceSku | where {$_.Locations -icontains "centralus"} -- Azure Powershell
After getting the output if in restriction you find NotAvailableForSubscription means you cannot use that vm size.

How to tell if my VM is Gen1 or Gen2 in Azure?

I would like to figure out if my Azure VM (Windows + Linux) is Gen1 or Gen2. Ideally I want to get this to work via az cli or from the actual server itself. I have tried az vm list -g RG-Name -d but it does not really display this information. Does anyone know how to obtain this ?
Good question. The hyperVgeneration property in the VM's instance view information exposes this detail about the VM, wherein V1 indicates Generation 1 VMs and V2 indicates Generation 2 VMs.
Using the az vm get-instance-view, you could try:
az vm get-instance-view -g <rg-name> -n <vm-name>
and look for the hyperVgeneration property in the response:
{
...
"instanceView": {
"maintenanceRedeployStatus": null,
"computerName": "gen2-BA",
...
"hyperVgeneration": "V2",
...
"osName": "Windows Server 2019 Datacenter",
"osVersion": "Microsoft Windows NT 10.0.17763.0",
},
...
}
Going one step ahead, if you want to query your Subscription for Gen1/Gen2 VMs, you can execute the following Azure CLI command:
az vm get-instance-view --ids $(az vm list --query "[].id" -o tsv) --query '[].{VMName:name, OS:storageProfile.osDisk.osType, SKU:storageProfile.imageReference.sku, HyperVgeneration:instanceView.hyperVgeneration}' -o table
The response would be similar to:
Although the Gen2 VMs' SKU names also hint towards the Gen1 vs Gen2 distinction, hyperVgeneration should be the exact property to look for.

ARM template validation failed

I tried various regions still same problem, here the error message :
Error Message : Code=InvalidTemplateDeployment; Message=The template
deployment failed with error: 'The resource with id:
'/subscriptions/----------------------/providers/Microsoft.Compute/virtualMachines/ARM_VM-001'
failed validation with message: 'The requested size for resource
'/subscriptions/--------------/resourceGroups/AzureResourceGroup1-2/providers/Microsoft.Compute/virtualMachines/ARM_VM-001'
is currently not available in location 'westus' zones '' for
subscription '-----------'.
Please try another size or deploy to a different location or zones.
See https://aka.ms/azureskunotavailable for details.'.'.
The deployment validation failed
Since not all SKU are available in all regions in Azure, you can use CLI to figure out whether the SKU you are looking for is available or not.
az vm list-skus --location <region> --query "[].{name:name}" -o table
You can use the above Azure CLI command to determine if the VM Size you are looking for is available in the given region (westus in your case).
you can provide the Size also and get a more narrowed down result as well
az vm list-skus --location <region> --size Standard_ --query "[].{name:name}" -o table
the above will provide all the Standard sizes avaliable in
if you want to find if a specific size is available in a specific region, try the below command
az vm list-skus --location southcentralus --size Standard_DS14-8_v2 --output table
This link > [https://learn.microsoft.com/en-us/cli/azure/vm?view=azure-cli-latest] has list of CLI commands you can execute for operations relating to VMs
Hope this helps.

How do I specify a specific resource group I want to update in azure CLI?

I am following the CLI from the official azure doc.
Specifically, I am looking for a way to add a tag to a storage account in Azure through CLI. It looks like az storage account update allows me to do that.
But how do I specify the name of the storage group? Can anyone provide me with an example?
After some trial and error, I have found that below line worked for me:
az storage account update --name storage_account_name --tags 'tag_name=tag_value'
Why don't you try this:
az resource update --set tags.'<tagName>'='<tagValue>' -g <your_rg> -n <your_sa> --resource-type "Microsoft.Storage/storageAccounts"
As seen here: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources
Or this:
az storage account update --name <your_sa> --resource- group <your_rg> --tags “<tagkey>= <tagvalue>”

How to get a list of available vm sizes in an azure location

I want to deploy a VM in microsoft's azure with a new size.
Usually I use a json template for the vm with size 'Standard_DS3'
Now I would like to have another one with size a3 'A3', but this causes an error
statusMessage:{"error":{"code":"InvalidParameter","target":"vmSize","message":"The value of parameter vmSize is invalid."}}
So I was wondering where can I find valid vm sizes for deployments in a location and the correct name for the deployment with a template file?
One can list all vm-sizes available in specific location(e.g westus) from Azure CLI 2.0 using following command
az vm list-sizes --location "westus"
Since you mentioned json templates in your question then I assume that you are using Azure Resource Manager to provision resources. If that's the case, you can use the following REST API endpoint to list all available virtual machine sizes in a region.
https://management.azure.com/subscriptions/{subscription-id}/providers/Microsoft.Compute/locations/{location}/vmSizes?api-version={api-version}
This information is accessible using Azure CLI, i.e.: az vm list-sizes --location "eastus"
You can also reference Microsoft documentation to see the list of virtual machine sizes. Sounds like you need to use the "Large" size in your template to provision an A3 Standard VM.
This isn´t always true. I´ve got into a situation where this command gives me a VM size that wasn´t truely avalaible for my location. This is a known issue of the Azure CLI.
Here is the statement from Azure support:
Cause: It is known that the command az vm list-sizes can expose sizes that are actually unavailable and we are working on that situation.
Resolution: The best option is to mitigate this is to cross check the information provided by that query with the restrictions that you have in the subscription that can be analyzed by the command az vm list-skus. For your scenario, you can see the SKU restrictions in West Europe by using the following:
az vm list-skus --location WestEurope --output table
You can use Get-AzureRmVMSize commandlet in PowerShell. This doesn't change too often and I have a .NET library which contains a snapshot of those https://github.com/aloneguid/microsoft-azure-strongtyped

Resources