'Scaling of Cloud Service (Classic) via Powershell or Terraform
It's not possible to deploy the Cloud Service (classic) via terraform, So I have used Arm Template and Deploy Cloud Service (Classic). Following is the code.
resource "azurerm_resource_group_template_deployment" "classicCloudService" {
name = "testSyedClassic"
resource_group_name = var.resourceGroup
deployment_mode = "Incremental"
template_content = file("arm_template.json")
tags = local.resourceTags
}
Following is the ARM Template which I have used.
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"dnsName": {
"type": "string",
"defaultValue": "testClassicSyed"
},
"location": {
"type": "string",
"defaultValue": "westeurope"
}
},
"resources": [
{
"name": "[parameters('dnsName')]",
"apiVersion": "2015-06-01",
"location": "[parameters('location')]",
"type": "Microsoft.ClassicCompute/domainNames",
"properties": {}
}
],
"outputs": {}
}
As scaling options are missing in the ARM/TF Template. I want to scale like below, As this is only possible via Powershell. (As far as I know). But it's in old Azure Module.
CloudService
TaskWorkerRole: 1
WorkerRole1: 1
LongRunningTaskworkerRole: 1
DialogCloudService
TaskWorkerRole: 1
Webhook: 1
Set-AzureRole -ServiceName '<your_service_name>' -RoleName '<your_role_name>' -Slot <target_slot> -Count <desired_instances>
Can we use Set-AzRole or any other command to scale this? Or can we also do this via Terraform or Do we have any ARM Template for this?
Solution 1:[1]
Can we use Set-AzRole or any other command to scale this? Or can we also do this via Terraform or Do we have any ARM Template for this?
No we can not use set-AzRole ,Because The Azure Resource Manager and classic deployment models represent two different ways of deploying and managing your Azure solutions. To achieve that we can use the below PowerShell cmdlts to scale out the roles.
Set-AzureRole -ServiceName '<your_service_name>' -RoleName '<your_role_name>' -Slot <target_slot> -Count <desired_instances>
For more information please refer this MICROSOFT DOCUMENTATION|How to scale an Azure Cloud Service (classic) in PowerShell
Alternatively, if you want to use Portal please refer this MICROSOFT DOCUMENTATION|How to configure auto scaling for a Cloud Service (classic) in the portal
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | AjayKumarGhose-MT |

