Azure / bicep

Bicep is a declarative language for describing and deploying Azure resources
MIT License
3.2k stars 742 forks source link

Never-ending deployment for App Service Environment | ASE | Microsoft.Web/hostingEnvironments #2645

Closed h2floh closed 3 years ago

h2floh commented 3 years ago

Bicep version Bicep CLI version 0.3.255 (589f0375df)

Describe the issue Microsoft.Web/hostingEnvironments will stuck in the deployment and won't finish after several hours (waited for 8hours). Normal behavior is deployment in above 2 hours (still long, but completes).

Describe the bug We found out that the string value selection offered by bicep for internalLoadBalancingMode option won't be translated to the number representation in the ARM template. However the ARM Template is accepted and starts deployment. If we ignore the warning and enter the number representation in the bicep description deployment succeeds.

To Reproduce Steps to reproduce the behavior:

//VNET
var location = 'westus'

resource v_net 'Microsoft.Network/virtualNetworks@2020-07-01' = {
  name: 'vnet'
  location: location
  properties: {
    addressSpace: {
      addressPrefixes: [
        '21.1.0.0/16'
      ]
    }
    subnets: [
      {
        name: 'snet-ase'
        properties: {
          addressPrefix: '21.1.1.0/24'
          // Needed for ASE
          serviceEndpoints: [
              {
                service: 'Microsoft.EventHub'
                locations:[
                  '*'
                ]
              }
              {
                service: 'Microsoft.Sql'
                locations:[
                  '*'
                ]
              }
              {
                service: 'Microsoft.Storage'
                locations:[
                  '*'
                ]
              }
            ]
          privateEndpointNetworkPolicies: 'Enabled'
          privateLinkServiceNetworkPolicies: 'Enabled'
        }
      }
    ]
  }   
}
// ASE Hosting Environment
var appServiceEnvironmentName = 'ase-deploy-notfinishing'

resource hostingEnvironment 'Microsoft.Web/hostingEnvironments@2020-06-01' = {
  name: appServiceEnvironmentName
  kind: 'ASEV2'
  location: location
  tags: {}
  properties: {
    virtualNetwork: {
      id: v_net.properties.subnets[0].id
    }
    internalLoadBalancingMode: 'Web,Publishing'
    location: location
    workerPools:[]
    name: appServiceEnvironmentName
  }
}

https://github.com/Azure/azure-quickstart-templates/blob/master/quickstarts/microsoft.web/web-app-asev2-ilb-create/azuredeploy.json

Ignoring Bicep warnings and using number instead, deployment completes: image

alex-frankel commented 3 years ago

@h2floh - do you have a consistent repro for this issue? The web team looked into this and are not able to reproduce the issue. It should work with both "3" or "Web, Publishing" and the team confirmed this behavior, so it may have been an intermittent issue?

h2floh commented 3 years ago

@alex-frankel I will test the bicep file I posted under To reproduce next week and post an update here.

h2floh commented 3 years ago

Hi @alex-frankel , ok tested it again. This time with Bicep CLI version 0.4.63 (7ebed03284) and can not reproduce the issue anymore. Seems to have been an intermittent issue like you described.