Azure Resource Manager deployment gives 503 Server timeout error
Waqas Kayani
6
Reputation points
We are using Azure Resource Manager template to deploy resources in our Azure subscription, the template simply create virtual machine and required networking resources. That same template and its deployment had been working as expected for quite some time, but has started to fail recently with a 503 Server timeout error. Here's the template:
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "string",
"defaultValue": "useast2"
},
"VirtualNetworkId":{
"type": "string",
"value": "<vnet-resource-id>"
},
"subnetName": {
"type": "string",
"value": "<subnet-name>"
},
"identifier": {
"type": "string",
"value": "<identifier>"
},
"virtualMachineName": {
"type": "string",
"value": "<identifier>"
},
"adminPublicKey": {
"type": "string",
"defaultValue": "<public-key>",
"metadata": {
"description": "Specifies the SSH rsa public key file as a string. Use \"ssh-keygen -t rsa -b 2048\" to generate your SSH key pairs."
}
},
"virtualMachineSize": {
"type": "string",
"defaultValue": "Standard DS1 v2"
},
"adminUsername": {
"type": "string",
"defaultValue": "ubuntu"
}
},
"variables": {
"networkSecurityGroupName": "[concat(parameters('virtualMachineName'), '-SecurityGroup')]",
"nsgId": "[resourceId(resourceGroup().name, 'Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]",
"vnetId": "[parameters('VirtualNetworkId')]",
"vnetName": "[last(split(variables('vnetId'), '/'))]",
"subnetRef": "[concat(variables('vnetId'), '/subnets/', parameters('subnetName'))]",
"publicIpAddressName": "[concat(parameters('virtualMachineName'), '-PublicIPAddress')]",
"networkInterfaceName": "[concat(parameters('virtualMachineName'), '-NetworkInterface')]"
},
"resources": [
{
"name": "[variables('networkInterfaceName')]",
"type": "Microsoft.Network/networkInterfaces",
"apiVersion": "2021-03-01",
"location": "[parameters('location')]",
"dependsOn": [
"[concat('Microsoft.Network/networkSecurityGroups/', variables('networkSecurityGroupName'))]",
"[concat('Microsoft.Network/publicIpAddresses/', variables('publicIpAddressName'))]"
],
"properties": {
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"subnet": {
"id": "[variables('subnetRef')]"
},
"privateIPAllocationMethod": "Dynamic",
"publicIpAddress": {
"id": "[resourceId(resourceGroup().name, 'Microsoft.Network/publicIpAddresses', variables('publicIpAddressName'))]"
}
}
}
],
"networkSecurityGroup": {
"id": "[variables('nsgId')]"
}
}
},
{
"name": "[variables('networkSecurityGroupName')]",
"type": "Microsoft.Network/networkSecurityGroups",
"apiVersion": "2019-02-01",
"location": "[parameters('location')]",
"properties": {
"securityRules": [
{
"name": "SSH",
"properties": {
"priority": 1000,
"protocol": "Tcp",
"access": "Allow",
"direction": "Inbound",
"sourceAddressPrefix": "*",
"sourcePortRange": "*",
"destinationAddressPrefix": "*",
"destinationPortRange": "22"
}
},
{
"name": "AllowTraffic",
"properties": {
"priority": 1010,
"protocol": "Tcp",
"access": "Allow",
"direction": "Inbound",
"sourceAddressPrefix": "*",
"sourcePortRange": "*",
"destinationAddressPrefix": "*",
"destinationPortRange": "*"
}
}
]
}
},
{
"name": "[variables('publicIpAddressName')]",
"type": "Microsoft.Network/publicIpAddresses",
"apiVersion": "2019-02-01",
"location": "[parameters('location')]",
"properties": {
"publicIpAllocationMethod": "Static"
},
"sku": {
"name": "Basic"
}
},
{
"name": "[parameters('virtualMachineName')]",
"type": "Microsoft.Compute/virtualMachines",
"apiVersion": "2021-07-01",
"location": "[parameters('location')]",
"identity": {
"type": "SystemAssigned"
},
"dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', variables('networkInterfaceName'))]"
],
"properties": {
"hardwareProfile": {
"vmSize": "[parameters('virtualMachineSize')]"
},
"storageProfile": {
"osDisk": {
"createOption": "fromImage",
"deleteOption": "Delete",
"managedDisk": {
"storageAccountType": "StandardSSD_LRS"
},
"diskSizeGB": 30
},
"imageReference": {
"publisher": "canonical",
"offer": "0001-com-ubuntu-server-focal",
"sku": "20_04-lts-gen2",
"version": "latest"
}
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('networkInterfaceName'))]"
}
]
},
"osProfile": {
"computerName": "[parameters('virtualMachineName')]",
"adminUsername": "[parameters('adminUsername')]",
"linuxConfiguration": {
"disablePasswordAuthentication": true,
"ssh": {
"publicKeys": [
{
"path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]",
"keyData": "[parameters('adminPublicKey')]"
}
]
}
}
},
"diagnosticsProfile": {
"bootDiagnostics": {
"enabled": true
}
}
}
}
],
"outputs": {
"adminUsername": {
"type": "string",
"value": "[parameters('adminUsername')]"
}
}
}
ARM Create Deployment API was used from the documentation page try it option.
Here are the results of a sample deployment:
Response Body:
{
"error": {
"code": "ServerTimeout",
"message": "The request timed out. Diagnostic information: timestamp '20220327T155727Z', subscription id '6df48df0-802d-4891-9f31-7cc1879f3cb4', tracking id '485d1bc6-777f-4696-8f40-d347da31234d', request correlation id '485d1bc6-777f-4696-8f40-d347da31234d'."
}
}
Any help would be greatly appreciated.
Thanks,
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
Sign in to answer