Note
This plugin is part of the azure.azcollection collection (version 1.10.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
.
To use it in a playbook, specify: azure.azcollection.azure_rm_adapplication
.
New in version 1.6.0: of azure.azcollection
The below requirements are needed on the host that executes this module.
Parameter | Choices/Defaults | Comments | ||
---|---|---|---|---|
ad_user string | Active Directory username. Use when authenticating with an Active Directory user rather than service principal. | |||
adfs_authority_url string added in 0.0.1 of azure.azcollection | Azure AD authority url. Use when authenticating with Username/password, and has your own ADFS authority. | |||
allow_guests_sign_in boolean |
| A property on the application to indicate if the application accepts other IDPs or not or partially accepts. | ||
api_profile string added in 0.0.1 of azure.azcollection | Default: "latest" | Selects an API profile to use when communicating with Azure services. Default value of latest is appropriate for public clouds; future values will allow use with Azure Stack. | ||
app_id string | Application ID. | |||
app_roles list / elements=dictionary | Declare the roles you want to associate with your application. | |||
allowed_member_types list / elements=string / required | Specifies whether this app role can be assigned to users and groups allowed_member_types=User. To other application's allowed_member_types=Application. Or both User and Appplication . | |||
description string | The description for the app role. This is displayed when the app role is being assigned. if the app role functions as an application permission, during consent experiences. | |||
display_name string | Display name for the permission that appears in the app role assignment and consent experiences. | |||
is_enabled boolean |
| When creating or updating an app role, this must be set to true (which is the default). To delete a role, this must first be set to false. At that point, in a subsequent call, this role may be removed. | ||
value string | Specifies the value to include in the roles claim in ID tokens and access tokens authenticating an assigned user or service principal. Must not exceed 120 characters in length. Allowed characters include ! Any other character, including the space character, are not allowed. | |||
auth_source string added in 0.0.1 of azure.azcollection |
| Controls the source of the credentials to use for authentication. Can also be set via the ANSIBLE_AZURE_AUTH_SOURCE environment variable.When set to auto (the default) the precedence is module parameters -> env -> credential_file -> cli .When set to env , the credentials will be read from the environment variablesWhen set to credential_file , it will read the profile from ~/.azure/credentials .When set to cli , the credentials will be sources from the Azure CLI profile. subscription_id or the environment variable AZURE_SUBSCRIPTION_ID can be used to identify the subscription ID if more than one is present otherwise the default az cli subscription is used.When set to msi , the host machine must be an azure resource with an enabled MSI extension. subscription_id or the environment variable AZURE_SUBSCRIPTION_ID can be used to identify the subscription ID if the resource is granted access to more than one subscription, otherwise the first subscription is chosen.The msi was added in Ansible 2.6. | ||
available_to_other_tenants boolean |
| The application can be used from any Azure AD tenants. | ||
cert_validation_mode string added in 0.0.1 of azure.azcollection |
| Controls the certificate validation behavior for Azure endpoints. By default, all modules will validate the server certificate, but when an HTTPS proxy is in use, or against Azure Stack, it may be necessary to disable this behavior by passing ignore . Can also be set via credential file profile or the AZURE_CERT_VALIDATION environment variable. | ||
client_id string | Azure client ID. Use when authenticating with a Service Principal. | |||
cloud_environment string added in 0.0.1 of azure.azcollection | Default: "AzureCloud" | For cloud environments other than the US public cloud, the environment name (as defined by Azure Python SDK, eg, AzureChinaCloud , AzureUSGovernment ), or a metadata discovery endpoint URL (required for Azure Stack). Can also be set via credential file profile or the AZURE_CLOUD_ENVIRONMENT environment variable. | ||
credential_description string | The description of the password. | |||
display_name string | The display name of the application. | |||
end_date string | Date or datetime after which credentials expire(e.g. '2017-12-31'). Default value is one year after current time. | |||
homepage string | The url where users can sign in and use your app. | |||
identifier_uris list / elements=string | Space-separated unique URIs that Azure AD can use for this app. | |||
key_type string |
| The type of the key credentials associated with the application. | ||
key_usage string |
| The usage of the key credentials associated with the application. | ||
key_value string | The value for the key credentials associated with the application. | |||
log_mode string | Parent argument. | |||
log_path string | Parent argument. | |||
native_app boolean |
| An application which can be installed on a user's device or computer. | ||
oauth2_allow_implicit_flow boolean |
| Whether to allow implicit grant flow for OAuth2. | ||
optional_claims list / elements=dictionary | Declare the optional claims for the application. | |||
additional_properties string | Additional properties of the claim. If a property exists in this collection, it modifies the behavior of the optional claim specified in the name property. | |||
essential boolean |
| If the value is true, the claim specified by the client is necessary to ensure a smooth authorization experience for the specific task requested by the end user. The default value is false. | ||
name string / required | The name of the optional claim. | |||
source string | The source (directory object) of the claim. There are predefined claims and user-defined claims from extension properties. If the source value is null, the claim is a predefined optional claim. If the source value is user, the value in the name property is the extension property from the user object. | |||
password string | App password, aka 'client secret'. | |||
profile string | Security profile found in ~/.azure/credentials file. | |||
reply_urls list / elements=string | Space-separated URIs to which Azure AD will redirect in response to an OAuth 2.0 request. The value does not need to be a physical endpoint, but must be a valid URI. | |||
required_resource_accesses list / elements=dictionary | Resource scopes and roles the application requires access to. Should be in manifest json format. | |||
resource_access list / elements=dictionary | The description of the app role. | |||
id string | The unique identifier for one of the oauth2PermissionScopes or appRole instances that the resource application exposes. | |||
type string | Specifies whether the id property references an oauth2PermissionScopes or an appRole. Possible values are Scope or Role. | |||
resource_app_id string | The unique identifier for the resource that the application requires access to. This should be equal to the appId declared on the target resource application. | |||
secret string | Azure client secret. Use when authenticating with a Service Principal. | |||
start_date string | Date or datetime at which credentials become valid, such as '2017-01-01'. Default value is current time. | |||
state string |
| Assert the state of Active Dirctory service principal. Use present to create or update a Password and use absent to delete. | ||
subscription_id string | Your Azure subscription Id. | |||
tenant string / required | The tenant ID. |
Note
az login
.See also
How to authenticate using the az login
command.
- name: Create ad application azure_rm_adapplication: tenant: "{{ tenant_id }}" display_name: "{{ display_name }}" - name: Create application with more parameter azure_rm_adapplication: tenant: "{{ tenant_id }}" display_name: "{{ display_name }}" available_to_other_tenants: False credential_description: "for test" end_date: 2021-10-01 start_date: 2021-05-18 identifier_uris: fredtest02.com - name: delete ad application azure_rm_adapplication: tenant: "{{ tenant_id }}" app_id: "{{ app_id }}" state: absent
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description | |
---|---|---|---|
output complex | awalys | Current state of the adapplication. | |
app_id string | always | The application ID. Sample: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | |
available_to_other_tenants boolean | always | The application can be used from any Azure AD tenants. | |
display_name string | always | Object's display name or its prefix. Sample: fredAKSCluster | |
homepage string | always | The url where users can sign in and use your app. | |
identifier_uris list / elements=string | always | Space-separated unique URIs that Azure AD can use for this app. | |
oauth2_allow_implicit_flow boolean | always | Whether to allow implicit grant flow for OAuth2. | |
object_id string | always | Object ID of the application Sample: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | |
optional_claims list / elements=string | always | The optional claims for the application. | |
reply_urls list / elements=string | always | Space-separated URIs to which Azure AD will redirect in response to an OAuth 2.0 request. |
© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/azure/azcollection/azure_rm_adapplication_module.html