Skip to content

Management mode missing when updating managed app definition #29997

@damiangelis

Description

@damiangelis

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

https://pastebin.com/YrG7FDcp

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')]"
                    }
                ]
            }
        }
    ]
}

Metadata

Metadata

Assignees

Labels

ARMaz resource/group/lock/tag/deployment/policy/managementapp/account management-groupAuto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamOKR CandidateThis label is used to track how many GitHub issues we have resolved for OKR purpose.Similar-Issuecustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions