Closed arnas78 closed 2 weeks ago
I ran into the same issue with 2023-11-02-preview
. How it is done? Can you provide a link to the commit, please?
@KrisSimon If I remember correctly, I just updated the API version to 2023-05-01
and it started working.
Hi @arnas78 Thanks for your quick reply.
For me it works when creating an capp-svc-lb
inside the managed rg, but not if Azure deploy a kubernetes-internal
LoadBalancer. Then the custom name is just ignored. Tried with 2023-05-01
and 2023-11-02-preview
.
Can you please reopen this issue? 🙏
We have the same issue—the Resource Group name is ignored upon creation. We tried multiple versions starting from 2023-05-01, all to the latest (and we also updated the Bicep compiler). It works when created through the Azure portal.
Can you please reopen the issue? At least to find the reproduction steps...
Thank you!
@tichaczech - can you provide the latest bicep code you are using? At a glance, this sounds like an issue with the ContainerApps API, not Bicep, but want to confirm.
If it's working in the portal during their create flow, you can download the template they use for that setting by selecting "Download template for automation" on the "Review + Create" tab.
I see the same issue, I'm trying to create a new environment using 2024-03-01 with the Sweden Central region where I have specified the infrastructureResourceGroup
, but it's still trying to use a generated name (e.g. nicehill-e803ee94
).
Here's part of the bicep that I'm using to create the environment:
resource managedEnvironment 'Microsoft.App/managedEnvironments@2024-03-01' = {
name: 'me-my-project-dev-001'
location: location
tags: tags
properties: {
vnetConfiguration: {
internal: true
infrastructureSubnetId: subnet.id
}
appLogsConfiguration: {
destination: 'log-analytics'
logAnalyticsConfiguration: {
customerId: logAnalytics.properties.customerId
sharedKey: logAnalytics.listKeys().primarySharedKey
}
}
infrastructureResourceGroup: 'rg-my-project-infra-dev-001'
}
}
I got it working by tweaking the Bicep a bit, not exactly sure which parameter fixed the issue for me, but, if it helps:
resource managedEnvironment 'Microsoft.App/managedEnvironments@2024-03-01' = {
name: 'me-my-project-dev-001'
location: location
tags: tags
properties: {
vnetConfiguration: {
internal: true
infrastructureSubnetId: subnet.id
}
appLogsConfiguration: {
destination: 'log-analytics'
logAnalyticsConfiguration: {
customerId: logAnalytics.properties.customerId
sharedKey: logAnalytics.listKeys().primarySharedKey
}
}
infrastructureResourceGroup: 'rg-my-project-infra-dev-001'
zoneRedundant: false
workloadProfiles: [
{
workloadProfileType: 'Consumption'
name: 'Consumption'
}
]
peerAuthentication: {
mtls: {
enabled: false
}
}
peerTrafficConfiguration: {
encryption: {
enabled: false
}
}
}
}
Hi @arnas78, this issue has been marked as stale because it was labeled as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 3 days of this comment. Thanks for contributing to bicep! :smile: :mechanical_arm:
Bicep version Bicep CLI version 0.18.4
Describe the bug During Managed Environment resource deployment, bicep module ignores the infrastructureResourceGroup parameter that can be used while using API version 2022-11-01-preview. Before deploying the Managed Environment resource, a what-if command is ran for the bicep module with it's parameters, but during the actual deployment, it gets ignored and after checking the details of the Managed Environment resource, it can be seen that infrastructureResourceGroup parameter is set to null.
To Reproduce Bicep module code (module from Azure/ResourceModules with a few changes):
Module deployment what-if output:
Additional context After successful deployment, infrastructureResourceGroup is set to null and newly created MC Resource Group name is still randomly generated and not the one provided in properties.infrastructureResourceGroup. This parameter feature is required to make the newly created Managed Cluster Resource Group name follow the naming convention used throughout the project.