ARM template validation failed - azure

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.

Related

Failing to update the cluster

For one of the test AKS clusters I am trying to update, it gives the following error.
Error: SkuNotAvailable.
Message: The requested VM size for resource "Following SKUs have failed for capacity restrictions:
Standard_D4s_v4' is currently not available in location 'SouthAfricaNorth'. Please try another size or deploy to a different location or different size.
I have checked and found that the quota is available in the subscription for this SKU and region selected.
Now cluster and pools went in to failed status
As far as I know, this error "SkuNotAvailable" is either a capacity issue in the region or that your SUBSCRIPTION doesn't have access to that specific size
You could once verify that by running the below Azure cli command
az vm list-skus --location centralus --size Standard_D --all --output table
If a SKU isn't available for your subscription in a location or zone that meets your business needs, submit a SKU request to Azure Support.
If the subscription doesn't have access, please reach out to azure subscription and quota mgmt support team through as support case to check and make sure it's available to use the particular size on your subscription in case they cannot enable that for any reason, there will be an appropriate explanation.
At this point there is nothing can be done at the AKS side.

Unable to parse parameter: promoteorqurantineFunctionName

I'm deploying an Azure function app as a part of security implementation into and I'm getting the above mentioned error as mentioned in Title section. Here is the powershell script i am running
az deployment group create
--name fss-promote-or-quarantine-plugin-deployment
--resource-group $RESOURCE_GROUP_NAME
--template-uri https://raw.githubusercontent.com/trendmicro/cloudone-filestorage
plugins/master/post-scan-actions/azure-python-promote-or-quarantine/template.json
-p promoteOrQuarantineFunctionName=$FUNCTION_NAME
scanningStorageAccountResourceID=$BLOB_STORAGE_ACCOUNT_RESOURCE_ID
scanResultTopicResourceID=$SCAN_RESULT_TOPIC_RESOURCE_ID
promoteStorageAccountConnectionString="$PROMOTE_STORAGE_ACCOUNT_CONNECTION_STRING"
promoteMode=move
quarantineStorageAccountConnectionString="$QUARANTINE_STORAGE_ACCOUNT_CONNECTION_STRING"
quarantineMode=move
Screenshot of the error that I'm getting:
I have tried by giving the space between the parameter names and values and it given the same error:
This cmdlet creates the storage account, taken from the GitHub ARM Article.
As #Mathias R. Jessen said, there should be no space between the parameter names and arguments passed in the CLI Cmdlets:

What is an STG Region in 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

How can i get Azure metrics using the az command in Powershell?

How can i get the Azure metrics , failed requests , app performance, CPU usage and Memory usage ?
There is the az monitor metrics list --resource
[--aggregation {Average, Count, Maximum, Minimum, None, Total}]
[--dimension]
[--end-time]
[--filter]
[--interval]
[--metadata]
[--metrics]
[--namespace]
[--offset]
[--orderby]
[--resource-group]
[--resource-namespace]
[--resource-parent]
[--resource-type]
[--start-t
I have tried to use t as follows
az monitor metrics list --resource "AppServiceName"
but get and error:
az : usage error: --resource ID | --resource NAME --resource-group NAME --resource-type
TYPE [--resource-parent PARENT] [--resource-namespace NAMESPACE]
Old now - but the resource ID required takes a few forms for example
/subscriptions/b6ff2c43-9c91-4c25-bf05-62fdea862e7b/resourceGroups/My-RSG/providers/Microsoft.Web/serverfarms/mywhatever.
This is found in the properties seciton of the portal for example.
you can then run in azure cli
az monitor metrics list --resource /subscriptions/b6ff2c43-9c91-4c25-bf05-62fdea862e7b/resourceGroups/My-RSG/providers/Microsoft.Web/serverfarms/mywhatever.

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