-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Describe the bug
I'm being unable to update a service catalog managed application definition with Azure CLI.
This is the command:
az managedapp definition update --authorizations "4aa80ae7-d586-49ad-9d05-968633f49551:8e3af657-a8ff-443c-a75c-2fe8c4bcb635" --description "This is a test" --display-name "Alnus Ama - Edit" --lock-level "ReadOnly" --name "alnusama" --resource-group "alnus-ama" --package-file-uri "https://alnusamaassets.blob.core.windows.net/appcontainer/app.zip"Command execution fails as it's trying to override the application managed mode "Managed" with "<null>", as can be seen in the error details below.
Related command
az managedapp definition update
Errors
(ApplicationDefinitionApplicationManagementPolicyLockConflict) Modifying application management policy on existing application definition is not allowed, current application management mode is 'Managed' while request contains different mode ''.
Code: ApplicationDefinitionApplicationManagementPolicyLockConflict
Message: Modifying application management policy on existing application definition is not allowed, current application management mode is 'Managed' while request contains different mode ''.
Issue script & Debug output
Expected behavior
Command should keep application managed mode to "Managed".
Environment Summary
azure-cli 2.64.0
core 2.64.0
telemetry 1.1.0
Dependencies:
msal 1.30.0
azure-mgmt-resource 23.1.1
Additional context
This is the template export of the service catalog managed application definition, where it can be seen the managed policy mode "Managed":
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"applicationDefinitions_alnusama_name": {
"defaultValue": "alnusama",
"type": "String"
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.Solutions/applicationDefinitions",
"apiVersion": "2021-07-01",
"name": "[parameters('applicationDefinitions_alnusama_name')]",
"location": "eastus",
"properties": {
"notificationPolicy": {
"notificationEndpoints": [
{
"uri": "[concat('https://', parameters('applicationDefinitions_alnusama_name'), 'api.azurewebsites.net/api/webhook-listener')]"
}
]
},
"lockingPolicy": {
"allowedActions": []
},
"deploymentPolicy": {
"deploymentMode": "Incremental"
},
"authorizations": [
{
"principalId": "4aa80ae7-d586-49ad-9d05-968633f49551",
"roleDefinitionId": "8e3af657-a8ff-443c-a75c-2fe8c4bcb635"
}
],
"isEnabled": true,
"lockLevel": "ReadOnly",
"managementPolicy": {
"mode": "Managed"
},
"displayName": "Alnus AMA",
"description": "This is a test",
"artifacts": [
{
"name": "ApplicationResourceTemplate",
"type": "Template",
"uri": "https://amastorageprodus.blob.core.windows.net/applicationdefinitions/B635C_A68CB0E1B28449E19051F8D5C6485A3D_47D8F6796620BD259E01A435529751799D80ABE931737514FE95C217762B8122/aa2935f96d3c49539ce587380c771656/applicationResourceTemplate.json"
},
{
"name": "CreateUiDefinition",
"type": "Custom",
"uri": "[concat('https://management.azure.com/subscriptions/a68cb0e1-b284-49e1-9051-f8d5c6485a3d/resourceGroups/alnus-ama/providers/Microsoft.Solutions/applicationDefinitions/', parameters('applicationDefinitions_alnusama_name'), '/applicationArtifacts/CreateUiDefinition?api-version=2017-09-01')]"
},
{
"name": "MainTemplateParameters",
"type": "Custom",
"uri": "[concat('https://management.azure.com/subscriptions/a68cb0e1-b284-49e1-9051-f8d5c6485a3d/resourceGroups/alnus-ama/providers/Microsoft.Solutions/applicationDefinitions/', parameters('applicationDefinitions_alnusama_name'), '/applicationArtifacts/MainTemplateParameters?api-version=2017-09-01')]"
}
]
}
}
]
}