Reputation: 1
Microsoft document says we can do it through the service def file. Is there any way we can do it via ARM template?
https://learn.microsoft.com/en-us/azure/cloud-services/schema-csdef-loadbalancerprobe
I tried adding probe property in json but I see the error - Invalid request format. Unable to parse request. Do we have any quick start template to help?
Upvotes: 0
Views: 93
Reputation: 2261
Adding health probe to a classic load balancer deployed as part of Azure cloud services extended support application.
As per the MSdoc when we are working around the Cloud Services (extended support) and creating load balancer probes we need to achieve this using .csdef
files not with ARM templets.
If you still want to use ARM templets and define this in .csdef
files.
deploy.json:
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"type": "Microsoft.Network/publicIPAddresses",
"apiVersion": "2021-02-01",
"name": "myPublicIP",
"location": "[resourceGroup().location]",
"properties": {
"publicIPAllocationMethod": "Dynamic"
}
},
{
"type": "Microsoft.Network/loadBalancers",
"apiVersion": "2021-02-01",
"name": "vkLoadBalancer",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Network/publicIPAddresses', 'myPublicIP')]"
],
"properties": {
"frontendIPConfigurations": [
{
"name": "myFrontEndConfig",
"properties": {
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses', 'myPublicIP')]"
}
}
}
],
"backendAddressPools": [
{
"name": "myBackEndPool"
}
],
"probes": [
{
"name": "myProbe",
"properties": {
"protocol": "Tcp",
"port": 80,
"intervalInSeconds": 5,
"numberOfProbes": 2
}
}
],
"loadBalancingRules": [
{
"name": "myLoadBalancingRule",
"properties": {
"frontendIPConfiguration": {
"id": "[concat(resourceId('Microsoft.Network/loadBalancers', 'vkLoadBalancer'), '/frontendIPConfigurations/myFrontEndConfig')]"
},
"backendAddressPool": {
"id": "[concat(resourceId('Microsoft.Network/loadBalancers', 'vkLoadBalancer'), '/backendAddressPools/myBackEndPool')]"
},
"probe": {
"id": "[concat(resourceId('Microsoft.Network/loadBalancers', 'vkLoadBalancer'), '/probes/myProbe')]"
},
"protocol": "Tcp",
"frontendPort": 80,
"backendPort": 80,
"idleTimeoutInMinutes": 4,
"enableFloatingIP": false,
"loadDistribution": "Default"
}
}
]
}
}
]
}
deployment succeeded:
Refer:
https://learn.microsoft.com/en-us/azure/cloud-services-extended-support/deploy-template
Upvotes: 0