Azure / Azure/bicep-types-az

Microsoft.App/managedEnvironments@2022-11-01-preview Managed Environment deployment fails after initial deployment

Open
#1,508 4 comments 0 reactions 0 assignees View on GitHub
Needs: Triage :mag:
Dominant language
TypeScript
Stars
108
Forks
44
Avg merge
18h 53m
Merged PRs (30d)
29

Description

Bicep version: 0.16.2

When deploying a container app to a managed container app environment configured to use a workload profile of 'Consumption', after the first deployment, subsequent deployments fail with the error

```
{
"status": "Failed",
"error": {
"code": "WorkloadProfileInUse",
"message": "Cannot remove workload profile(s): Consumption because it is being used by container apps"
}
}
```
Expected behaviour:

The container app environment deployment would either succeed or have its state updated depending on the template inputs and then succeed

Steps to reproduce:

- Create a bicep template that deploys: a managed container app environment using the Microsoft.App/managedEnvironments@2022-11-01-preview API, configured with a workload profile of 'Consumption', that runs a container app.
- deploy the template
- redeploy the template

bicep snippet:

```
resource managedEnvironment_name_resource 'Microsoft.App/managedEnvironments@2022-11-01-preview' = {
name: managedEnvironment_name
location: location
properties: {
vnetConfiguration: {
internal: true
infrastructureSubnetId: resourceId('Microsoft.Network/virtualNetworks/subnets', vnet_name_resource.name, ContainerAppSubnet)
}
appLogsConfiguration: {
destination: 'log-analytics'
logAnalyticsConfiguration: {
customerId: LogAnalytics_resource.properties.customerId
sharedKey: LogAnalytics_resource.listkeys().primarySharedKey
}
}
workloadProfiles: [
{
workloadProfileType: 'Consumption'
}
]
zoneRedundant: false
customDomainConfiguration: {}
}
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the provided Bicep template and reproduce the first deployment followed by a redeployment of Microsoft.App/managedEnvironments@2022-11-01-preview with a Consumption workload profile and container app. Compare the second deployment response with the reported WorkloadProfileInUse error; done means the environment state updates or the redeployment succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.