Azure / bicep-registry-modules

Bicep registry modules
MIT License
417 stars 277 forks source link

[AVM Module Issue]: Setting up 'AvailabilityZones' is not supported in Sku :'Developer' #2561

Open dewolfs opened 1 week ago

dewolfs commented 1 week ago

Check for previous/existing GitHub issues

Issue Type?

Feature Request

Module Name

avm/res/api-management/service

(Optional) Module Version

0.2.0

Description

Hi,

I want to deploy an APIM instance in the SKU "Developer". The Developer SKU defaults to 1 instance count.

When the following bicep code is used:

module apim 'br/public:avm/res/api-management/service:0.2.0' = {
  name: 'apim9999'
  params: {
    name: 'testapim9999'
    publisherEmail: publisherEmail
    publisherName: publisherName
    virtualNetworkType: 'Internal'
    subnetResourceId: subnetRef.id
    location: location
    sku: 'Developer'
    ....
  }
}

i get the error:

[{"code":"NotSupported","message":"Setting up 'AvailabilityZones' is not supported in Sku :'Developer'.

If I look at the module, the SKU parameter will always be 2 if I choose Developer. But technically that's not possible ?!

https://github.com/Azure/bicep-registry-modules/blob/c58ce674ad0876a44fc44983f1bb03b300b76eb7/avm/res/api-management/service/main.bicep#L85 https://github.com/Azure/bicep-registry-modules/blob/c58ce674ad0876a44fc44983f1bb03b300b76eb7/avm/res/api-management/service/main.bicep#L224

How to proceed to deploy APIM with the Developer SKU ?

(Optional) Correlation Id

No response

microsoft-github-policy-service[bot] commented 1 week 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.

avm-team-linter[bot] commented 1 week ago

@dewolfs, thanks for submitting this issue for the avm/res/api-management/service module!

[!IMPORTANT] A member of the @Azure/avm-res-apimanagement-service-module-owners-bicep or @Azure/avm-res-apimanagement-service-module-contributors-bicep team will review it soon!

dhayes-ccl commented 1 week ago

I'm having the same problem, The AVM flavour fails to deploy with an Availability Zones error, the direct resource version deploys properly

var subnetResourceId = resourceId(networkResourceGroup,'Microsoft.Network/virtualNetworks/subnets', vnetName, subnetName) var uniqueId = uniqueString(resourceGroup().id, 'apim') module apim 'br/public:avm/res/api-management/service:0.2.0' = { name: 'apimDeployment' params: { name: 'apim-apim${uniqueId}' publisherEmail: 'xxx' publisherName: 'xxx' sku:'Developer' skuCount:1 subnetResourceId: subnetResourceId virtualNetworkType:'Internal' zones:null additionalLocations:null disableGateway:true } }

// resource apimService 'Microsoft.ApiManagement/service@2021-01-01-preview' = { // name: 'apim-apim${uniqueId}' // location: resourceGroup().location // sku: { // name: 'Developer' // capacity: 1 // } // properties: { // publisherEmail: 'xxx' // publisherName: 'xxx' // virtualNetworkType: 'Internal' // virtualNetworkConfiguration: { // subnetResourceId: subnetResourceId // } // } // }

tony-box commented 1 week ago

Sorry for that, folks--definitely a bug. I am almost done with a fix and will be making a PR shortly.