Views:

Description

Retrieves an oAuth token using the Azure AD v2.0 endpoint: https://login.microsoftonline.com/{0}/oauth2/v2.0/token where {0} is replaced by your Directory ID.

Signature

AzureADGetTokenV2('directoryid', SetRequestParams('params'))

Example 1 : Grant Type = client_credentials

AzureADGetTokenV2(
  '6e77330d-7376-4348-aacb-80aff5bee2d8',
  SetRequestParams('client_id', '557c67b7-b07b-4c6f-bd26-fa70f8c8f27c',
    'client_secret', 'I:mH%Eu888:IWa;FOf',
    'grant_type', 'client_credentials')
)

Example 2 : Grant Type = password

AzureADGetTokenV2(
  '6e77330d-7376-4348-aacb-80aff5bee2d8',
  SetRequestParams('resource', 'https://north52.api.crm4.dynamics.com',
    'username', 'billgates@north52.com',
    'password', 'mypassword',
    'client_id', '997c67b7-b07b-4c6f-bd26-fa70f8c8f27c',
    'client_secret', 'I:mH%Eu99O:IWa;FOf',
    'grant_type', 'password')
)

 Note:  To find your Directory ID:

  • Login to Azure
  • Click on Azure Active Directory
  • Click on Properties

Example 3 : Key Vault and Secrets

SmartFlow(

  SetVar('token',
    AzureADGetTokenV2('36bb5c97-2970-43e7-9378-4c3ef1ab0f2d', 
      SetRequestParams('scope', 'https://vault.azure.net/.default',
        'client_id', 'a2c8d8cd-0091-4aec-9701-5294cd9e3wh5',
        'client_secret', ')})%}?+/9{$@k-%$=>.({=-;g#N3>.{*#}}@;:o=@$.$]+#^=^%-6].^N>/}[',
        'grant_type', 'client_credentials'))),

  AzureKeyVaultGetSecret( GetVar('token'), 
    'https://north52keyvault1.vault.azure.net/secrets/north52keyvaulttest1secret/e40d68e5924f4cd2b8f6684faa837d9b?api-version=2016-10-01') ,

  GetVarJsonValue('value')
) 


 

Parameters

Name Type Description Required
fromdate xxxx xxxx xxxx
todate xxxx xxxx xxxx
interval xxxx xxxx xxxx