Cannot create azure Log Analytics Workspace with User Managed Identity

Hi all,

I’m trying to create an Azure Analytics workspace with a User Managed Identity.

Creating the resource without specifying the identity works !
Configuration the identity fails with
collection/plugins/modules/azure_rm_loganalyticsworkspace.py", line 256, in exec_module
AttributeError: ‘NoneType’ object has no attribute ‘as_dict’

  • name: Create Log Analytics Workspace “{{ azure_log_1_1_name_id }}” in “{{ azure_resource_group_name_logs_1_id }}”
    azure.azcollection.azure_rm_loganalyticsworkspace:
    subscription_id: “{{ azure_subscription_id }}”
    tenant: “{{ azure_tenant_id }}”
    ad_user: “{{ azure_ad_user_id }}”
    password: “{{ azure_ad_user_password_id }}”
    location: “{{ azure_location_1_id }}”
    resource_group: “{{ azure_resource_group_name_logs_1_id }}”
    name: “{{ azure_log_1_1_name_id }}”
    # Identity is not working !
    identity:
    type: “UserAssigned”
    user_assigned_identity: “/subscriptions/{{ azure_subscription_id }}/resourceGroups/{{ azure_resource_group_name_secu_1_id }}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{{ azure_user_managed_identity_1_2_name_id }}”
    retention_in_days: 40

ansible [core 2.17.12]
config file = /etc/ansible/ansible.cfg
configured module search path = [‘/root/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]
ansible python module location = /usr/lib/python3/dist-packages/ansible
ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible
python version = 3.10.12 (main, May 27 2025, 17:12:29) [GCC 11.4.0] (/usr/bin/python3)
jinja version = 3.0.3
libyaml = True

Any idea ??

Regards,

HA