AzureGraph (version 1.0.0)

az_app: Registered app in Azure Active Directory

Description

Base class representing an AAD app.

Usage

az_app

Arguments

Format

An R6 object of class az_app, inheriting from az_object.

Fields

  • token: The token used to authenticate with the Graph host.

  • tenant: The Azure Active Directory tenant for this app.

  • type: always "application" for an app object.

  • properties: The app properties.

  • password: The app password. Note that the Graph API does not return passwords, so this will be NULL for an app retrieved via ms_graph$get_app().

Methods

  • new(...): Initialize a new app object. Do not call this directly; see 'Initialization' below.

  • delete(confirm=TRUE): Delete an app. By default, ask for confirmation first.

  • update(...): Update the app data in Azure Active Directory. For what properties can be updated, consult the REST API documentation link below.

  • do_operation(...): Carry out an arbitrary operation on the app.

  • sync_fields(): Synchronise the R object with the app data in Azure Active Directory.

  • list_group_memberships(): Return the IDs of all groups this app is a member of.

  • list_object_memberships(): Return the IDs of all groups, administrative units and directory roles this app is a member of.

  • list_owners(type=c("user", "group", "application", "servicePrincipal")): Return a list of all owners of this app. Specify the type argument to filter the result for specific object type(s).

  • create_service_principal(...): Create a service principal for this app, by default in the current tenant.

  • get_service_principal(): Get the service principal for this app.

  • delete_service_principal(confirm=TRUE): Delete the service principal for this app. By default, ask for confirmation first.

  • update_password(password=NULL, name="key1", password_duration=1): Updates the app password. Note that this will invalidate any existing password.

Initialization

Creating new objects of this class should be done via the create_app and get_app methods of the ms_graph class. Calling the new() method for this class only constructs the R object; it does not call the Microsoft Graph API to create the actual app.

Microsoft Graph overview, REST API reference

See Also

ms_graph, az_service_principal, az_user, az_group, az_object

Examples

Run this code
# NOT RUN {
gr <- get_graph_login()
app <- gr$create_app("MyNewApp")

# password reset
app$update_password()

# set a redirect URI
app$update(publicClient=list(redirectUris=I("http://localhost:1410")))

# add API permission (access Azure Storage as user)
app$update(requiredResourceAccess=list(
    list(
        resourceAppId="e406a681-f3d4-42a8-90b6-c2b029497af1",
        resourceAccess=list(
            list(
                id="03e0da56-190b-40ad-a80c-ea378c433f7f",
                type="Scope"
            )
        )
    )
))

# change the app name
app$update(displayName="MyRenamedApp")

# }

Run the code above in your browser using DataCamp Workspace