az ad app

Manage applications with AAD Graph.

Commands

az ad app create

Create a web application, web API or native application.

az ad app credential

Manage an application's password or certificate credentials.

az ad app credential delete

Delete an application's password or certificate credentials.

az ad app credential list

List an application's password or certificate credential metadata. (The content of the password or certificate credential is not retrievable.).

az ad app credential reset

Reset an application's password or certificate credentials.

az ad app delete

Delete an application.

az ad app federated-credential

Manage application federated identity credentials.

az ad app federated-credential create

Create application federated identity credential.

az ad app federated-credential delete

Delete application federated identity credential.

az ad app federated-credential list

List application federated identity credentials.

az ad app federated-credential show

Show application federated identity credential.

az ad app federated-credential update

Update application federated identity credential.

az ad app list

List applications.

az ad app owner

Manage application owners.

az ad app owner add

Add an application owner.

az ad app owner list

List application owners.

az ad app owner remove

Remove an application owner.

az ad app permission

Manage an application's OAuth2 permissions.

az ad app permission add

Add an API permission.

az ad app permission admin-consent

Grant Application & Delegated permissions through admin-consent.

az ad app permission delete

Remove an API permission.

az ad app permission grant

Grant the app an API Delegated permissions.

az ad app permission list

List API permissions the application has requested.

az ad app permission list-grants

List Oauth2 permission grants.

az ad app show

Get the details of an application.

az ad app update

Update an application.

az ad app create

Create a web application, web API or native application.

For more detailed documentation, see https://docs.microsoft.com/graph/api/resources/application.

az ad app create --display-name
                 [--app-roles]
                 [--enable-access-token-issuance {false, true}]
                 [--enable-id-token-issuance {false, true}]
                 [--end-date]
                 [--identifier-uris]
                 [--is-fallback-public-client {false, true}]
                 [--key-display-name]
                 [--key-type {AsymmetricX509Cert, Password, Symmetric}]
                 [--key-usage {Sign, Verify}]
                 [--key-value]
                 [--optional-claims]
                 [--public-client-redirect-uris]
                 [--required-resource-accesses]
                 [--sign-in-audience {AzureADMultipleOrgs, AzureADMyOrg, AzureADandPersonalMicrosoftAccount, PersonalMicrosoftAccount}]
                 [--start-date]
                 [--web-home-page-url]
                 [--web-redirect-uris]

Examples

Create an application.

az ad app create --display-name mytestapp

Create an application that can fall back to public client with Microsoft Graph delegated permission Application.Read.All

az ad app create --display-name my-public --is-fallback-public-client --required-resource-accesses @manifest.json
("manifest.json" contains the following content)
[{
    "resourceAppId": "00000003-0000-0000-c000-000000000000",
    "resourceAccess": [
        {
            "id": "c79f8feb-a9db-4090-85f9-90d820caa0eb",
            "type": "Scope"
        }
   ]
}]

Create an application with a role

az ad app create --display-name mytestapp --identifier-uris https://mytestapp.websites.net --app-roles @manifest.json
("manifest.json" contains the following content)
[{
    "allowedMemberTypes": [
      "User"
    ],
    "description": "Approvers can mark documents as approved",
    "displayName": "Approver",
    "isEnabled": "true",
    "value": "approver"
}]

Create an application with optional claims

az ad app create --display-name mytestapp --optional-claims @manifest.json
("manifest.json" contains the following content)
{
    "idToken": [
        {
            "name": "auth_time",
            "essential": false
        }
    ],
    "accessToken": [
        {
            "name": "ipaddr",
            "essential": false
        }
    ],
    "saml2Token": [
        {
            "name": "upn",
            "essential": false
        },
        {
            "name": "extension_ab603c56068041afb2f6832e2a17e237_skypeId",
            "source": "user",
            "essential": false
        }
    ]
}

Required Parameters

--display-name

The display name of the application.

Optional Parameters

--app-roles

The collection of roles assigned to the application. With app role assignments, these roles can be assigned to users, groups, or service principals associated with other applications. Should be JSON file path or in-line JSON string. See examples below for details.

--enable-access-token-issuance

Specifies whether this web application can request an access token using the OAuth 2.0 implicit flow.

accepted values: false, true
--enable-id-token-issuance

Specifies whether this web application can request an ID token using the OAuth 2.0 implicit flow.

accepted values: false, true
--end-date

Date or datetime after which credentials expire (e.g. '2017-12-31T11:59:59+00:00' or '2017-12-31'). Default value is one year after current time.

--identifier-uris

Space-separated values. Also known as App ID URI, this value is set when an application is used as a resource app. The identifierUris acts as the prefix for the scopes you'll reference in your API's code, and it must be globally unique. You can use the default value provided, which is in the form api://, or specify a more readable URI like https://contoso.com/api.

--is-fallback-public-client

Specifies the fallback application type as public client, such as an installed application running on a mobile device. The default value is false which means the fallback application type is confidential client such as a web app.

accepted values: false, true
--key-display-name

Friendly name for the key.

--key-type

The type of the key credentials associated with the application.

accepted values: AsymmetricX509Cert, Password, Symmetric
default value: AsymmetricX509Cert
--key-usage

The usage of the key credentials associated with the application.

accepted values: Sign, Verify
default value: Verify
--key-value

The value for the key credentials associated with the application.

--optional-claims

Application developers can configure optional claims in their Azure AD applications to specify the claims that are sent to their application by the Microsoft security token service. For more information, see https://docs.microsoft.com/azure/active-directory/develop/active-directory-optional-claims. Should be JSON file path or in-line JSON string. See examples below for details.

--public-client-redirect-uris

Space-separated values. Specifies the URLs where user tokens are sent for sign-in, or the redirect URIs where OAuth 2.0 authorization codes and access tokens are sent.

--required-resource-accesses

Specifies the resources that the application needs to access. This property also specifies the set of delegated permissions and application roles that it needs for each of those resources. This configuration of access to the required resources drives the consent experience. Should be JSON file path or in-line JSON string. See examples below for details.

--sign-in-audience

Specifies the Microsoft accounts that are supported for the current application.

accepted values: AzureADMultipleOrgs, AzureADMyOrg, AzureADandPersonalMicrosoftAccount, PersonalMicrosoftAccount
--start-date

Date or datetime at which credentials become valid (e.g. '2017-01-01T01:00:00+00:00' or '2017-01-01'). Default value is current time.

--web-home-page-url

Home page or landing page of the application.

--web-redirect-uris

Space-separated values. Specifies the URLs where user tokens are sent for sign-in, or the redirect URIs where OAuth 2.0 authorization codes and access tokens are sent.

az ad app delete

Delete an application.

az ad app delete --id

Examples

Delete an application. (autogenerated)

az ad app delete --id 00000000-0000-0000-0000-000000000000

Required Parameters

--id

Identifier uri, application id, or object id.

az ad app list

List applications.

For low latency, by default, only the first 100 will be returned unless you provide filter arguments or use "--all".

az ad app list [--all]
               [--app-id]
               [--display-name]
               [--filter]
               [--identifier-uri]
               [--show-mine]

Optional Parameters

--all

List all entities, expect long delay if under a big organization.

--app-id

Application id.

--display-name

The display name of the application.

--filter

OData filter, e.g. --filter "displayname eq 'test' and servicePrincipalType eq 'Application'".

--identifier-uri

Graph application identifier, must be in uri format.

--show-mine

List entities owned by the current user.

az ad app show

Get the details of an application.

az ad app show --id

Examples

Get the details of an application with appId.

az ad app show --id 00000000-0000-0000-0000-000000000000

Get the details of an application with id.

az ad app show --id 00000000-0000-0000-0000-000000000000

Get the details of an application with identifier URI.

az ad app show --id api://myapp

Required Parameters

--id

Identifier uri, application id, or object id.

az ad app update

Update an application.

az ad app update --id
                 [--add]
                 [--app-roles]
                 [--display-name]
                 [--enable-access-token-issuance {false, true}]
                 [--enable-id-token-issuance {false, true}]
                 [--end-date]
                 [--force-string]
                 [--identifier-uris]
                 [--is-fallback-public-client {false, true}]
                 [--key-display-name]
                 [--key-type {AsymmetricX509Cert, Password, Symmetric}]
                 [--key-usage {Sign, Verify}]
                 [--key-value]
                 [--optional-claims]
                 [--public-client-redirect-uris]
                 [--remove]
                 [--required-resource-accesses]
                 [--set]
                 [--sign-in-audience {AzureADMultipleOrgs, AzureADMyOrg, AzureADandPersonalMicrosoftAccount, PersonalMicrosoftAccount}]
                 [--start-date]
                 [--web-home-page-url]
                 [--web-redirect-uris]

Examples

update a native application with delegated permission of "access the AAD directory as the signed-in user"

az ad app update --id e042ec79-34cd-498f-9d9f-123456781234 --required-resource-accesses @manifest.json
("manifest.json" contains the following content)
[{
    "resourceAppId": "00000002-0000-0000-c000-000000000000",
    "resourceAccess": [
        {
            "id": "a42657d6-7f20-40e3-b6f0-cee03008a62a",
            "type": "Scope"
        }
   ]
}]

declare an application role

az ad app update --id e042ec79-34cd-498f-9d9f-123456781234 --app-roles @manifest.json
("manifest.json" contains the following content)
[{
    "allowedMemberTypes": [
      "User"
    ],
    "description": "Approvers can mark documents as approved",
    "displayName": "Approver",
    "isEnabled": "true",
    "value": "approver"
}]

update optional claims

az ad app update --id e042ec79-34cd-498f-9d9f-123456781234 --optional-claims @manifest.json
("manifest.json" contains the following content)
{
    "idToken": [
        {
            "name": "auth_time",
            "essential": false
        }
    ],
    "accessToken": [
        {
            "name": "ipaddr",
            "essential": false
        }
    ],
    "saml2Token": [
        {
            "name": "upn",
            "essential": false
        },
        {
            "name": "extension_ab603c56068041afb2f6832e2a17e237_skypeId",
            "source": "user",
            "essential": false
        }
    ]
}

update an application's group membership claims to "All"

az ad app update --id e042ec79-34cd-498f-9d9f-123456781234 --set groupMembershipClaims=All

Required Parameters

--id

Identifier uri, application id, or object id.

Optional Parameters

--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

--app-roles

The collection of roles assigned to the application. With app role assignments, these roles can be assigned to users, groups, or service principals associated with other applications. Should be JSON file path or in-line JSON string. See examples below for details.

--display-name

The display name of the application.

--enable-access-token-issuance

Specifies whether this web application can request an access token using the OAuth 2.0 implicit flow.

accepted values: false, true
--enable-id-token-issuance

Specifies whether this web application can request an ID token using the OAuth 2.0 implicit flow.

accepted values: false, true
--end-date

Date or datetime after which credentials expire (e.g. '2017-12-31T11:59:59+00:00' or '2017-12-31'). Default value is one year after current time.

--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

--identifier-uris

Space-separated values. Also known as App ID URI, this value is set when an application is used as a resource app. The identifierUris acts as the prefix for the scopes you'll reference in your API's code, and it must be globally unique. You can use the default value provided, which is in the form api://, or specify a more readable URI like https://contoso.com/api.

--is-fallback-public-client

Specifies the fallback application type as public client, such as an installed application running on a mobile device. The default value is false which means the fallback application type is confidential client such as a web app.

accepted values: false, true
--key-display-name

Friendly name for the key.

--key-type

The type of the key credentials associated with the application.

accepted values: AsymmetricX509Cert, Password, Symmetric
default value: AsymmetricX509Cert
--key-usage

The usage of the key credentials associated with the application.

accepted values: Sign, Verify
default value: Verify
--key-value

The value for the key credentials associated with the application.

--optional-claims

Application developers can configure optional claims in their Azure AD applications to specify the claims that are sent to their application by the Microsoft security token service. For more information, see https://docs.microsoft.com/azure/active-directory/develop/active-directory-optional-claims. Should be JSON file path or in-line JSON string. See examples below for details.

--public-client-redirect-uris

Space-separated values. Specifies the URLs where user tokens are sent for sign-in, or the redirect URIs where OAuth 2.0 authorization codes and access tokens are sent.

--remove

Remove a property or an element from a list. Example: --remove property.list OR --remove propertyToRemove.

--required-resource-accesses

Specifies the resources that the application needs to access. This property also specifies the set of delegated permissions and application roles that it needs for each of those resources. This configuration of access to the required resources drives the consent experience. Should be JSON file path or in-line JSON string. See examples below for details.

--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=.

--sign-in-audience

Specifies the Microsoft accounts that are supported for the current application.

accepted values: AzureADMultipleOrgs, AzureADMyOrg, AzureADandPersonalMicrosoftAccount, PersonalMicrosoftAccount
--start-date

Date or datetime at which credentials become valid (e.g. '2017-01-01T01:00:00+00:00' or '2017-01-01'). Default value is current time.

--web-home-page-url

Home page or landing page of the application.

--web-redirect-uris

Space-separated values. Specifies the URLs where user tokens are sent for sign-in, or the redirect URIs where OAuth 2.0 authorization codes and access tokens are sent.