Azure / bicep-registry-modules

Bicep registry modules
MIT License
505 stars 349 forks source link

[AVM Module Issue]: Unable to create Managed Resource Group shows. #3224

Open VenkataRKC opened 1 month ago

VenkataRKC commented 1 month ago

Check for previous/existing GitHub issues

Issue Type?

I'm not sure

Module Name

avm/res/app/managed-environment

(Optional) Module Version

0.7.0

Description

I am trying to create a ACA Environment using the module provided, i am not sure if it creates the Managed Resource Group when we use the workload profile type. I see the environment being created but dont see any managed resource group which starts with a ME_ . Appreciate your response. When i view the Json view of the ACA environment i see the infrastrucutureResourceGroup as null. "infrastructureResourceGroup": null,

(Optional) Correlation Id

No response

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

@VenkataRKC, thanks for submitting this issue for the avm/res/app/managed-environment module!

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

microsoft-github-policy-service[bot] commented 1 month 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)!
hundredacres commented 1 month ago

@VenkataRKC can I see some example code? When I deploy w/o passing a value for the infrastructureResourceGroupName param, I see a RG created with the ME_**** format.

VenkataRKC commented 1 month ago

@hundredacres thank you for the response, what is the scope that is used for deployment is it on the subscription level or resource group level ?. i used the resource module instead of AVM and seems to be working. I noticed that it has to do with scope.
When i execute the deployment with az deployment sub create -f <templatefile> -p <paramfile> it does not create the ME**** resource group, but i dont get any error the deployment succeeds and i dont see the ME** resource group. Where as if i execute the deployment with az deployment group create -g <resourceGroup> -f <templatefile> -p <paramfile> it created the ME_*** resource group. Please find the code. And also could you please confirm that when we use the "internal: true" flag do you see only one component getting created in the ME_**** resource group that is the Load Balancer ?. Appreciate your response.

targetScope = 'resourceGroup' @description('Required. Enter the name of this resource.') param name string @description('Required. Enter the Log Analytics Workspace Id') param logAnalyticsWorkspaceResourceId string

@description('Location for all resources.') param location string

@description('Optional. The Resource Group Name of the App Container Environment".') param infrastructureResourceGroupName string = ''

@description('Required. The Subnet ID of the Azure Container Environment".') param infrastructureSubnetId string = ''

@description('Optional. The Workload Profile details Defaults to Consumption".') param workloadProfiles array = []

@description('Tags in form of key-value pairs') param tags object

// ------------------ // VARIABLES // ------------------

var defaultWorkloadProfile = [ { workloadProfileType: 'Consumption' name: 'Consumption' } ]

var effectiveWorkloadProfiles = workloadProfiles != [] ? concat(defaultWorkloadProfile, workloadProfiles) : defaultWorkloadProfile

module managedEnvironment 'br/public:avm/res/app/managed-environment:0.7.0' ={ name: 'managedenvironment' params:{ name: name dockerBridgeCidr: '172.16.0.1/28' infrastructureResourceGroupName: empty(infrastructureResourceGroupName) ? take('ME${resourceGroup().name}${name}', 63) : infrastructureResourceGroupName infrastructureSubnetId: infrastructureSubnetId internal: true location: location platformReservedCidr: '172.17.17.0/24' platformReservedDnsIP: '172.17.17.17' workloadProfiles: effectiveWorkloadProfiles logAnalyticsWorkspaceResourceId: logAnalyticsWorkspaceResourceId tags: tags } }

// ------------------ // OUTPUTS // ------------------

@description('The Name of the Azure container app environment.') output containerAppsEnvironmentName string = managedEnvironment.outputs.name

@description('The Name of the ACE infrastrucutre Resource Group.') output containerAppsInfrastructureResourceGroup string = empty(infrastructureResourceGroupName) ? take('ME${resourceGroup().name}${name}', 63) : infrastructureResourceGroupName

@description('The resource ID of the Azure container app environment.') output containerAppsEnvironmentNameId string = managedEnvironment.outputs.resourceId

@description('The default domain of the Azure container app environment.') output containerAppsEnvironmentDefaultDomain string = managedEnvironment.outputs.defaultDomain

@description('The Azure container app environment\'s Load Balancer IP.') output containerAppsEnvironmentLoadBalancerIP string = managedEnvironment.outputs.staticIp