powershell azure find autoscale settings for classic vm - azure

I have a lot of classic Azure services with classic VMs some have auto scale setting and some don't. Is there a way through powershell I can find out if a classic Azure services has AutoScale set or not. looking at Get-AzureService and Get-AzureVM does not seem to have this information

For now, classic service display in ARM resource group, so we can use this command Get-AzureRmAutoscaleSetting to list autoscale enable or no on-configure.
Get-AzureRmAutoscaleSetting -ResourceGroup jasonnew
If the cloud service autoscale is enable, we will get the result, if not, nothing will output.
Also, we can use Azure portal to get the information:

Related

How do you see the availabilty zones of an Azure Data Explorer Cluster?

It's mentioned in the Microsoft Docs that an Azure Data Explorer Cluster can be created with availablity zones, but not edited after creation.
We have an existing cluster where I am trying to see if it was created with availablity zones selected, however I cannot work out where to find this within the Azure Portal. Maybe a very dumb question but where can I go to check if my instance has availability zones set up?
Thanks
You see the availability zones of a particular Adx cluster either from portal, PowerShell cmdlets or through by using Azure management Rest API's.
Using Get-AzKustoCluster cmdlet to list the properties of the cluster.
get-azkustocluster -ResourceGroupName <ResourceGroupName> -Name <ClusterName> | select -Property Name,Zone
Cluster-Get REST API to get the information about cluster and it's properties.
https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}?api-version=2022-07-07
From Azure Portal in the overview page under instance count as shown in below image

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 change the number of target instances in an Azure Virtual Machine Scale Set?

I've created an Azure VMSS and used a target instance count of 1 during my testing. Now that I'm ready to go live for my customer, I really need to change the target instance count to at least 2 for HA reasons. Is there a way to do this via Azure CLI or other means without having to rebuild everything?
Is there a way to do this via Azure CLI or other means without having
to rebuild everything?
Yes, we can use Azure Resource Explorer to configure and update the autoscale setting for a scale set. Azure Resource Explorer is an easy way to manage Azure resources via Resource Manager templates. Here are my steps:
1. login Azure Resource Explorer.
2. switch Read Only to Read/Write.
3. select subscription and resource group, find the vmss and autoscalesettings, then edit it.
4. After edit is complete, select PUT.
5. Then we can find the result from Azure protal.
More information about configure and update the autoscale setting for a scale set, refer to the link.
You can change the capacity of a VM Scale set in the following ways:
Use the Azure portal - Click on your VM scale set and then select the Scaling blade. Use the slider bar.
Use the CLI 2.0 az vmss scale command.
Using Azure PowerShell 5.0.0 or later use this command:
Update-AzureRmVmss -ResourceGroupName myrg -VMScaleSetName myvmss -SkuCapacity 3

Finding azure Availability sets using Azure in classic mode

I am trying to find the availability sets in a Azure Cloud Service using powershell. The Cloud Service was created using classic model.
I am not sure if this is the right answer:
get-AzureService -ServiceName "myService"
That is correct. Get-AzureService returns with the information about the cloud services for the current subscription.
The Syntax is:
Get-AzureService -ServiceName "nameOfService"

It's possible to create App Service Plans using Azure Powershell?

As the title say, I need to create App Service Plans programmatilly, The scenario:
N azure websites will be created (dynamically, using azure powershell too)
If someday the Premium App Service Plan can't handle the quantity of websites (even with autoscaling by cpu usage), another service plan must be created to hold new sites.
It is possible? Or Am I going to the wrong way to accomplish this?
Unless your design doesn't permit it, when you create a new Premium App Service Plan, create it in a new resource group, as that will give it a greater chance to have enough capacity to scale.
Using Azure PowerShell version 1.1.0 you can use the following command to create new app service plans
New-AzureRmAppServicePlan -Location "South Central US" -ResourceGroupName DestinationAzureResourceGroup -Name NewAppServicePlan -Sku Premium

Resources