Hello @Ashok Kumar Kandasamy
Firstly, please note that as of my knowledge Azure Cloud Services (Web and Worker Roles) are considered a classic deployment model and are not fully supported in Azure Resource Manager (ARM) templates or Biceps.
For this query, I will provide you with an example of how to create an Internal Load Balancer (ILB) and link it to a Virtual Network using Bicep.
Here is an example Bicep code that creates a Cloud Service (Extended Support) with an internal load balancer and links it to a virtual network:
param deploymentName string
param location string
param vnetResourceGroupName string
param vnetName string
param subnetName string
resource cloudService 'Microsoft.ClassicCompute/domainNames@2021-02-01' = {
name: 'myCloudService'
location: location
properties: {
label: 'myCloudService'
description: 'My Cloud Service'
internalLoadBalancerSettings: {
subnetNames: [
subnetName
]
}
}
}
resource vnetLink 'Microsoft.ClassicCompute/domainNameVirtualNetworkLinks@2021-02-01' = {
name: 'myVnetLink'
location: location
properties: {
vnetResourceId: resourceId(vnetResourceGroupName, 'Microsoft.Network/virtualNetworks', vnetName)
addressSpace: {
addressPrefixes: [
'10.0.0.0/16'
]
}
subnets: [
{
name: subnetName
properties: {
addressPrefix: '10.0.0.0/24'
}
}
]
}
}
output cloudServiceFqdn string = cloudService.properties.fqdn
In this example, the cloudService
resource creates a Cloud Service (Extended Support) with an internal load balancer and links it to the specified subnet. The vnetLink
resource creates a virtual network link between the Cloud Service and the specified virtual network.
Note that you will need to provide values for the deploymentName
, location
, vnetResourceGroupName
, vnetName
, and subnetName
parameters when deploying this Bicep code. The vnetResourceGroupName
, vnetName
, and subnetName
parameters specify the virtual network and subnet that the Cloud Service should be linked to.
Also, keep in mind that Cloud Services (Extended Support) are a classic Azure service, so you will need to use the Microsoft.ClassicCompute
namespace in your Bicep code
More details:
As for the supportability part of Bicep in Azure Cloud Services, you can also use Azure App Service to deploy web applications and Azure Virtual Machines to deploy worker roles instead.
Azure App Service provides a platform for hosting web applications that is fully managed by Azure, while Azure Virtual Machines provide a flexible platform for running custom workloads.
If this does answer your question, please accept it as the answer as a token of appreciation.