Hello Saravanan Krishnan, Welcome to microsoft Q&A, thankyou for posting your query here. Please check below reference code to automate the cluster creation using bicep.
param provisionedClustersName string
param customLocation string ='/subscriptions/xxxxx/resourceGroups/SB-WE-RG-HCIResourceBridge/providers/Microsoft.ExtendedLocation/customLocations/SB-DCHPELAB-AKS'
param adminGroupObjectIDs array = []
@secure()
param sshkey string
param location string = 'westeurope'
param resourceTags object = {
}
param controlPlaneNodeCount int
param controlPlaneNodesize string = 'Standard_A4_v2'
param controlPlaneOsType string = 'Linux'
param kubernetesVersion string = 'v1.22.11'
param loadBalancerNodeSize string = 'Standard_A4_v2'
param loadBalancerNodeCount int
param loadBalancerSku string = 'unstacked-haproxy'
param loadBalancerOsType string = 'Linux'
param podCidr string = '10.244.0.0/16'
param networkPolicy string = 'calico'
param vnetSubnetIds array = ['/subscriptions/xxxxx/resourceGroups/SB-WE-RG-HCIResourceBridge/providers/Microsoft.HybridContainerService/virtualNetworks/sb-dchpelab-aksvnet101']
param agentpoolname string = '${provisionedClustersName}-nodepool1'
param agentpoolCount int
param agentpoolVMsize string = 'Standard_A4_v2'
param agentpoolOsType string = 'Linux'
resource provisionedClustersName_resource 'Microsoft.HybridContainerService/ProvisionedClusters@2022-05-01-preview' = {
name: provisionedClustersName
location: location
extendedLocation: {
type: 'customLocation'
name: customLocation
}
tags: resourceTags
identity: {
type: 'SystemAssigned'
}
properties: {
aadProfile: {
adminGroupObjectIDs: adminGroupObjectIDs
}
linuxProfile: {
ssh: {
publicKeys: [
{
keyData: sshkey
}
]
}
}
controlPlane: {
count: controlPlaneNodeCount
osType: controlPlaneOsType
vmSize: controlPlaneNodesize
}
kubernetesVersion: kubernetesVersion
networkProfile: {
loadBalancerProfile: {
count: loadBalancerNodeCount
osType: loadBalancerOsType
vmSize: loadBalancerNodeSize
}
loadBalancerSku: loadBalancerSku
networkPolicy: networkPolicy
podCidr: podCidr
}
agentPoolProfiles: [
{
name: agentpoolname
count: agentpoolCount
vmSize: agentpoolVMsize
osType: agentpoolOsType
}
]
cloudProviderProfile: {
infraNetworkProfile: {
vnetSubnetIds: vnetSubnetIds
}
}
}
}
Please find the below link to refer and understand the template. https://learn.microsoft.com/en-us/azure/templates/microsoft.azurestackhci/clusters?pivots=deployment-language-bicep Hope this is helpful, please consider accepting the answer to help increase visibility of this question for other members of the Microsoft Q&A community. If not, please let us know what is still needed in the comments so the question can be answered. Thank you for helping to improve Microsoft Q&A!