Azure / bicep-registry-modules

Bicep registry modules
MIT License
474 stars 331 forks source link

[Bug Report]: Elastic Pool minCapacity not set causes error 'The service level objective "S2M50" does not support the min capacity '0'' #2365

Open zydio opened 1 year ago

zydio commented 1 year ago

Describe the bug

BICEP deployments of Elastic Pools using CARML modules started to fail in the last few days, for what looks like an ARM (server side) issue, as we are using either v0.8.0 or v0.10.0 CARML official release and also without changing anything we started getting the error.

Modifying modules\Microsoft.Sql\servers\elasticPools\deploy.bicep to send a value of null for properties.minCapacity (not properties.perDatabaseSettings.minCapacity which works) solves the problem.

Note that it is currently impossible to send a null value for properties.minCapacity when the Elastic Pool is created when defining it with the properties of modules\Microsoft.Sql\servers\deploy.bicep because this file defaults the parameter to 0 when not provided (which causes the original error) and modules\Microsoft.Sql\servers\elasticPools\deploy.bicep would anyway set a default of 2 (inconsistent with the behavior of the other module) which is equally not accepted by ARM.

To reproduce

Run a deployment with an Elastic Pool, using CARML >= 0.8.0 and <= 0.10.0

Code snippet

module sqlServer 'CARML/modules/Microsoft.Sql/servers/deploy.bicep' = {
  scope: resourceGroup('issue-with-minCapacity-rg')
  name: '${uniqueString(deployment().name)}-SqlServer'
  params: {
    location: 'westeurope'
    name: 'issue-with-minCapacity-sql'
    administratorLogin: 'adminForTicket'
    administratorLoginPassword: 'An1P@sswordYouL1ke'
    minimalTlsVersion: '1.2'
    elasticPools: [{
      name: 'issue-with-minCapacity-ep'
      skuName: 'StandardPool'
      skuTier: 'Standard'
      skuCapacity: 50
      maxSizeBytes: 50*1024*1024*1024
      databaseMinCapacity: 10
      databaseMaxCapacity: 50
      maintenanceConfigurationId: '${subscription().id}/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_WestEurope_DB_1'
    }]
    databases: [{
      // An Elastic database in a Pool
      name: 'issue-with-minCapacity-db'
      skuName: 'ElasticPool'
      skuTier: 'Standard'
      skuCapacity: 0
      maxSizeBytes: 30*1024*1024*1024
      zoneRedundant: false
      elasticPoolId: '${subscription().id}/resourceGroups/issue-with-minCapacity-rg/providers/Microsoft.Sql/servers/issue-with-minCapacity-sql/elasticPools/issue-with-minCapacity-ep'
      requestedBackupStorageRedundancy: 'Local'
    }]
  }

Relevant log output

The service level objective "S2M50" does not support the min capacity '0'
AlexanderSehr commented 1 year ago

This must be investigated and fix as the module is then currently not deployable (without providing a custom value).

microsoft-github-policy-service[bot] commented 3 months ago

[!IMPORTANT] The "Needs: Triage :mag:" label must be removed once the triage process is complete!

[!TIP] For additional guidance on how to triage this issue/PR, see the BRM Issue Triage documentation.

AlexanderSehr commented 3 months ago

Hey @bryansan-msft, please note that I just migrated this issue from CARML (was we're working through all module issues on that end). As this may still be relevent, please take a look and triage/close the issue :)

microsoft-github-policy-service[bot] commented 3 months ago

[!WARNING] Tagging the AVM Core Team (@Azure/avm-core-team-technical-bicep) due to a module owner or contributor having not responded to this issue within 3 business days. The AVM Core Team will attempt to contact the module owners/contributors directly.

[!TIP]

  • To prevent further actions to take effect, the "Status: Response Overdue 🚩" label must be removed, once this issue has been responded to.
  • To avoid this rule being (re)triggered, the ""Needs: Triage :mag:" label must be removed as part of the triage process (when the issue is first responded to)!
microsoft-github-policy-service[bot] commented 3 months ago

[!WARNING] Tagging the AVM Core Team (@Azure/avm-core-team-technical-bicep) due to a module owner or contributor having not responded to this issue within 3 business days. The AVM Core Team will attempt to contact the module owners/contributors directly.

[!TIP]

  • To prevent further actions to take effect, the "Status: Response Overdue 🚩" label must be removed, once this issue has been responded to.
  • To avoid this rule being (re)triggered, the ""Needs: Triage :mag:" label must be removed as part of the triage process (when the issue is first responded to)!
microsoft-github-policy-service[bot] commented 3 months ago

[!CAUTION] This issue requires the AVM Core Team's (@Azure/avm-core-team-technical-bicep) immediate attention as it hasn't been responded to within 6 business days.

[!TIP]

  • To avoid this rule being (re)triggered, the "Needs: Triage :mag:" and "Status: Response Overdue :triangular_flag_on_post:" labels must be removed when the issue is first responded to!
  • Remove the "Needs: Immediate Attention :bangbang:" label once the issue has been responded to.
microsoft-github-policy-service[bot] commented 3 months ago

[!WARNING] Tagging the AVM Core Team (@Azure/avm-core-team-technical-bicep) due to a module owner or contributor having not responded to this issue within 3 business days. The AVM Core Team will attempt to contact the module owners/contributors directly.

[!TIP]

  • To prevent further actions to take effect, the "Status: Response Overdue 🚩" label must be removed, once this issue has been responded to.
  • To avoid this rule being (re)triggered, the ""Needs: Triage :mag:" label must be removed as part of the triage process (when the issue is first responded to)!
microsoft-github-policy-service[bot] commented 3 months ago

[!CAUTION] This issue requires the AVM Core Team's (@Azure/avm-core-team-technical-bicep) immediate attention as it hasn't been responded to within 6 business days.

[!TIP]

  • To avoid this rule being (re)triggered, the "Needs: Triage :mag:" and "Status: Response Overdue :triangular_flag_on_post:" labels must be removed when the issue is first responded to!
  • Remove the "Needs: Immediate Attention :bangbang:" label once the issue has been responded to.
microsoft-github-policy-service[bot] commented 2 months ago

[!WARNING] Tagging the AVM Core Team (@Azure/avm-core-team-technical-bicep) due to a module owner or contributor having not responded to this issue within 3 business days. The AVM Core Team will attempt to contact the module owners/contributors directly.

[!TIP]

  • To prevent further actions to take effect, the "Status: Response Overdue 🚩" label must be removed, once this issue has been responded to.
  • To avoid this rule being (re)triggered, the ""Needs: Triage :mag:" label must be removed as part of the triage process (when the issue is first responded to)!
microsoft-github-policy-service[bot] commented 2 months ago

[!CAUTION] This issue requires the AVM Core Team's (@Azure/avm-core-team-technical-bicep) immediate attention as it hasn't been responded to within 6 business days.

[!TIP]

  • To avoid this rule being (re)triggered, the "Needs: Triage :mag:" and "Status: Response Overdue :triangular_flag_on_post:" labels must be removed when the issue is first responded to!
  • Remove the "Needs: Immediate Attention :bangbang:" label once the issue has been responded to.
microsoft-github-policy-service[bot] commented 2 months ago

[!WARNING] Tagging the AVM Core Team (@Azure/avm-core-team-technical-bicep) due to a module owner or contributor having not responded to this issue within 3 business days. The AVM Core Team will attempt to contact the module owners/contributors directly.

[!TIP]

  • To prevent further actions to take effect, the "Status: Response Overdue 🚩" label must be removed, once this issue has been responded to.
  • To avoid this rule being (re)triggered, the ""Needs: Triage :mag:" label must be removed as part of the triage process (when the issue is first responded to)!
microsoft-github-policy-service[bot] commented 2 months ago

[!CAUTION] This issue requires the AVM Core Team's (@Azure/avm-core-team-technical-bicep) immediate attention as it hasn't been responded to within 6 business days.

[!TIP]

  • To avoid this rule being (re)triggered, the "Needs: Triage :mag:" and "Status: Response Overdue :triangular_flag_on_post:" labels must be removed when the issue is first responded to!
  • Remove the "Needs: Immediate Attention :bangbang:" label once the issue has been responded to.
microsoft-github-policy-service[bot] commented 2 months ago

[!CAUTION] This issue requires the AVM Core Team's (@Azure/avm-core-team-technical-bicep) immediate attention as it hasn't been responded to within 6 business days.

[!TIP]

  • To avoid this rule being (re)triggered, the "Needs: Triage :mag:" and "Status: Response Overdue :triangular_flag_on_post:" labels must be removed when the issue is first responded to!
  • Remove the "Needs: Immediate Attention :bangbang:" label once the issue has been responded to.