Hi @Jérôme,
I don't believe the Az.LogicApp
module supports setting a managed identity to the Logic App. If you still want to use PowerShell, then you'll have to go about in an ARM template fashion as explained in Enable system-assigned identity in an ARM template.
You should be able to use Invoke-AzRestMethod
command setting the path, i.e. /subscriptions/{subscription}/resourceGroups/{rg}/providers/Microsoft.Logic/workflows/{logicappname}/
to the logic app and POSTing the parameters of the identity as a body. I couldn't find a specific example of this, but another option you could try is using New-AzResource
to make the update. Same principal, you're manually updating the actual resource properties. It would look something like:
$identityId = (Get-AzUserAssignedIdentity -ResourceGroupName <ResourceGroupName> -Name <IdentityName>).Id
$logicAppResourceId = (Get-AzLogicApp -ResourceGroupName <ResourceGroupName> -Name <LogicAppName>).ResourceId
$identityType = "UserAssigned"
$identity = @{
type = $identityType
userAssignedIdentities = @{
$identityId = @{
clientId = "<ClientIdOfTheIdentity>"
principalId = "<PrincipalIdOfTheIdentity>"
}
}
}
New-AzResource -ResourceId $logicAppResourceId -Properties $identity -Force