Skip to content

AADIdentityAPIConnector

Parameters

Parameter Attribute DataType Description Allowed Values
DisplayName Required String The name of the API connector.
TargetUrl Write String The URL of the API endpoint to call.
Id Key String The unique identifier for an entity. Read-only.
AuthenticationConfiguration Write MSFT_MicrosoftGraphApiAuthenticationConfigurationBase The object which describes the authentication configuration details for calling the API.
Ensure Write String Present ensures the policy exists, absent ensures it is removed. Present, Absent
Credential Write PSCredential Credentials of the Admin
ApplicationId Write String Id of the Azure Active Directory application to authenticate with.
TenantId Write String Id of the Azure Active Directory tenant used for authentication.
ApplicationSecret Write PSCredential Secret of the Azure Active Directory tenant used for authentication.
CertificateThumbprint Write String Thumbprint of the Azure Active Directory application's authentication certificate to use for authentication.
CertificatePassword Write PSCredential Username can be made up to anything but password will be used for CertificatePassword
CertificatePath Write String Path to certificate used in service principal usually a PFX file.
ManagedIdentity Write Boolean Managed ID being used for authentication.
AccessTokens Write String[] Access token used for authentication.

Embedded Instances

MSFT_MicrosoftGraphApiAuthenticationConfigurationBase

Parameters

Parameter Attribute DataType Description Allowed Values
dataType Required String The type of the authentication configuration. #microsoft.graph.basicAuthentication, #microsoft.graph.pkcs12Certificate
Username Write String The username of the basic authentication configuration
Password Write PSCredential The password of the basic authentication configuration
CertificateList Write MSFT_AADIdentityAPIConnectionCertificate[] The certificates uploaded to the API connector

MSFT_AADIdentityAPIConnectionCertificate

Parameters

Parameter Attribute DataType Description Allowed Values
Pkcs12Value Write PSCredential Pkcs12Value of the certificate as a secure string in Base64 encoding
Thumbprint Required String Thumbprint of the certificate in Base64 encoding
Password Write PSCredential Password of the certificate as a secure string
IsActive Write Boolean Tells if the certificate is in use or not

Description

Azure AD Identity API Connector

Permissions

Graph

To authenticate with the Graph API, this resource requires the following permissions:

Delegated permissions

  • Read
  • APIConnectors.Read.All

  • Update

  • APIConnectors.ReadWrite.All

Application permissions

  • Read
  • APIConnectors.Read.All

  • Update

  • APIConnectors.ReadWrite.All

Examples

Example 1

This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline.

Configuration Example
{
    param
    (
        [Parameter()]
        [System.String]
        $ApplicationId,

        [Parameter()]
        [System.String]
        $TenantId,

        [Parameter()]
        [System.String]
        $CertificateThumbprint
    )

    Import-DscResource -ModuleName Microsoft365DSC

    Node localhost
    {
        AADIdentityAPIConnector 'AADIdentityAPIConnector-Example'
        {
            DisplayName           = "NewTestConnector";
            Id                    = "RestApi_NewTestConnector";
            AuthenticationConfiguration = MSFT_MicrosoftGraphApiAuthenticationConfigurationBase{
                dataType = '#microsoft.graph.basicAuthentication'
                Username = "anexas"
                Password = New-Object System.Management.Automation.PSCredential('api-user', (ConvertTo-SecureString "<api-password>" -AsPlainText -Force))
            };
            TargetUrl             = "https://graph.microsoft.com";
            Ensure                = "Present"
            ApplicationId         = $ApplicationId
            TenantId              = $TenantId
            CertificateThumbprint = $CertificateThumbprint
        }
    }
}

Example 2

This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline.

Configuration Example
{
    param
    (
        [Parameter()]
        [System.String]
        $ApplicationId,

        [Parameter()]
        [System.String]
        $TenantId,

        [Parameter()]
        [System.String]
        $CertificateThumbprint
    )

    Import-DscResource -ModuleName Microsoft365DSC

    Node localhost
    {
        AADIdentityAPIConnector 'AADIdentityAPIConnector-Example'
        {
            DisplayName           = "NewTestConnector";
            Id                    = "RestApi_NewTestConnector";
            AuthenticationConfiguration = MSFT_MicrosoftGraphApiAuthenticationConfigurationBase{
                dataType = '#microsoft.graph.basicAuthentication'
                Username = "anexas"
                Password = New-Object System.Management.Automation.PSCredential('api-user', (ConvertTo-SecureString "<api-password>" -AsPlainText -Force))
            };
            TargetUrl             = "https://graph.microsoft.com";
            Ensure                = "Present"
            ApplicationId         = $ApplicationId
            TenantId              = $TenantId
            CertificateThumbprint = $CertificateThumbprint
        }
    }
}

Example 3

This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline.

Configuration Example
{
    param
    (
        [Parameter()]
        [System.String]
        $ApplicationId,

        [Parameter()]
        [System.String]
        $TenantId,

        [Parameter()]
        [System.String]
        $CertificateThumbprint
    )

    Import-DscResource -ModuleName Microsoft365DSC

    Node localhost
    {
        AADIdentityAPIConnector 'AADIdentityAPIConnector-Example'
        {
            DisplayName           = "NewTestConnector";
            Id                    = "RestApi_NewTestConnector";
            Ensure                = "Absent"
            ApplicationId         = $ApplicationId
            TenantId              = $TenantId
            CertificateThumbprint = $CertificateThumbprint
        }
    }
}