azure.azcollection.azure_service_principal_attribute lookup – Look up Azure service principal attributes.

Note

This lookup plugin is part of the azure.azcollection collection (version 3.1.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install azure.azcollection. You need further requirements to be able to use this lookup plugin, see Requirements for details.

To use it in a playbook, specify: azure.azcollection.azure_service_principal_attribute.

New in azure.azcollection 1.12.0

Synopsis

  • Describes object id of your Azure service principal account.

Requirements

The below requirements are needed on the local controller node that executes this lookup.

  • msgraph-sdk

Keyword parameters

This describes keyword parameters of the lookup. These are the values key1=value1, key2=value2 and so on in the following examples: lookup('azure.azcollection.azure_service_principal_attribute', key1=value1, key2=value2, ...) and query('azure.azcollection.azure_service_principal_attribute', key1=value1, key2=value2, ...)

Parameter

Comments

azure_client_id

string

azure service principal client id.

azure_cloud_environment

string

azure cloud environment

azure_secret

string

azure service principal secret

azure_tenant

string

azure tenant

Examples

set_fact:
  object_id: "{{ lookup('azure_service_principal_attribute',
                         azure_client_id=azure_client_id,
                         azure_secret=azure_secret,
                         azure_tenant=azure_secret) }}"

Return Value

Key

Description

Return value

string

Returns object id of service principal.

Returned: success

Authors

  • Yunge Zhu (@yungezz)

Hint

Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.