'Error in ARM template deployment : Additional properties not allowed: userAssignedIdentities

I have a ARM template with below syntax, trying to add user assigned identity to AZ load test resource.

 "resources": [
            {
                "type": "Microsoft.LoadTestService/loadtests",
                "apiVersion": "2021-12-01-preview",
                "name": "[parameters('name')]",
                "location": "[parameters('location')]",
                "tags": "[parameters('tags')]",
                "identity": {
                    "type": "userAssigned",
                    "userAssignedIdentities": {
                            "/subscriptions/<subscriptionId>/resourceGroups/<RGNAME>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<identityName>": {}
                        }               
                }
            }
        ]

And I get below error during the deployment. Any suggestions on this error? I will remove the hardcoded resourceid part once I get pass preflight deployment.

New-AzResourceGroupDeployment: 1:02:15 PM - Error: Code=ObjectAdditionalProperties; Message=Additional properties not allowed: userAssignedIdentities. Paths in payload: '$.identity.userAssignedIdentities'


Solution 1:[1]

Per the latest documentation, the only acceptable values for the identity are either SystemAssigned, or None for the current api.

It does appear that the property is available on the older API version, 2021-09-01-preview, per this documentation.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1