Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.23k stars 3.84k forks source link

Az.Functions Update FunctionApp that has system and user-assigned managed identity #15484

Open vrdse opened 3 years ago

vrdse commented 3 years ago

Description

If a Function App has both, a SystemAssigned and UserAssigned identity, Update-FunctionApp will fail, regardless of what's being updated.

Steps to reproduce

Azure Portal let's you configure both managed identity types at the same time. The configuration is shown in the resource JSON as

    "identity": {
        "type": "SystemAssigned, UserAssigned",
        [...]
    }

Once you have this configuration, run the following.

Update-AzFunctionApp -ResourceGroupName <resource-group> -Name <function-app> -Tag @{'test'='test'}

Environment data

Module versions

get-module -name Az.Functions,Az.Accounts | fl name, version

Name    : Az.Accounts
Version : 2.5.1

Name    : Az.Functions
Version : 3.1.0

Error output

Message        : Unknown IdentityType 'SystemAssigned, UserAssigned'
StackTrace     : 
Exception      : System.InvalidOperationException
InvocationInfo : {}
Line           :     throw $errorRecord

Position       : At C:\Users\...\Documents\PowerShell\Modules\Az.Functions\3.1.0\custom\HelperFunctions.ps1:807 char:5
                 +     throw $errorRecord
                 +     ~~~~~~~~~~~~~~~~~~
ghost commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @ahmedelnably, @fabiocav.

Issue Details
## Description If a Function App has both, a `SystemAssigned` and `UserAssigned` identity, `Update-FunctionApp` will fail, regardless of what's being updated. ## Steps to reproduce Azure Portal let's you configure both managed identity types at the same time. The configuration is shown in the resource JSON as ```JSON "identity": { "type": "SystemAssigned, UserAssigned", [...] } ``` Once you have this configuration, run the following. ```powershell Update-AzFunctionApp -ResourceGroupName -Name -Tag @{'test'='test'} ``` ## Environment data ``` ``` ## Module versions ```powershell get-module -name Az.Functions,Az.Accounts | fl name, version Name : Az.Accounts Version : 2.5.1 Name : Az.Functions Version : 3.1.0 ``` ## Error output ``` Message : Unknown IdentityType 'SystemAssigned, UserAssigned' StackTrace : Exception : System.InvalidOperationException InvocationInfo : {} Line : throw $errorRecord Position : At C:\Users\...\Documents\PowerShell\Modules\Az.Functions\3.1.0\custom\HelperFunctions.ps1:807 char:5 + throw $errorRecord + ~~~~~~~~~~~~~~~~~~ ```
Author: vrdse
Assignees: -
Labels: `Functions`, `Service Attention`, `customer-reported`, `needs-triage`, `question`
Milestone: -
KranthiPakala-MSFT commented 2 years ago

@vrdse Thanks for reporting this issue to us. A backlog item has been opened by @Francisco and being tracked internally. Will keep this thread posted once we have further updates.

Thanks again!

Francisco-Gamino commented 2 years ago

/cc @AnatoliB @stefanushinardi @michaelpeng36

Francisco-Gamino commented 2 years ago

@gzuber @panchagnula -- Do you know if the Az CLI is able to update an app that has both a system and user-assigned managed identity? Please let us know. Thanks.

panchagnula commented 2 years ago

@gzuber @panchagnula -- Do you know if the Az CLI is able to update an app that has both a system and user-assigned managed identity? Please let us know. Thanks.

@Francisco-Gamino yes azcli supports both system assigned & user-assigned.

navba-MSFT commented 2 years ago

@vrdse Apologies for the late reply. Could you please try to update the function app using Azure CLI command and test the behavior ?

@Francisco-Gamino I was able to repro the issue with Update-AzFunctionApp PS command. Could you please provide an update on when this would be fixed in Update-AzFunctionApp?

vrdse commented 2 years ago

@navba-MSFT Thank you for the suggestion, however the issue with Update-AzFunctionApp exists nonetheless and personally I don't need a workaround right now. Just wanted to let you know about this bug.

navba-MSFT commented 2 years ago

@vrdse Thanks for the feedback. We are investigating this. We will be updating this thread once we have more details on this.

cc @Francisco-Gamino