Skip to content

Create an Azure AD app

Create an Azure AD app by using one of these methods:

  • Create the app in the Azure portal.
  • Create the app by using PowerShell.

Create an Azure AD app in the Azure portal

  1. Sign in to the Azure portal.
  2. Search for and select App registrations.
  3. Select New registration.
  4. Fill in the required information:
  5. Select Register.
  6. After you register your app, the Application ID is available from the Overview tab. Copy and save the Application ID for later use.
  7. Select Certificates & secrets.
  8. Select New client secret.
  9. In the Add a client secret window, enter a description, specify when you want the client secret to expire, and select Add.
  10. Copy and save the client secret value.

Note

After you leave this window, the client secret value is hidden, and you can't viewor copy it again.

Create an Azure AD app by using PowerShell

The following sample PowerShell script creates a new Azure AD app and a service principal. Before you run this script:

  • Install the latest version of PowerShell.
  • Install the Microsoft Graph PowerShell SDK.

After the script runs, make a note of the following information in the script output:

  • The client ID of the new app
  • The object ID of the new service principal
  • The value of the service principal secret

PowerShell

Powershell
# Sign in as a user who's allowed to create an app.
Connect-MgGraph -Scopes "Application.ReadWrite.All" 

# Create a new Azure AD web application.
$desktop = @{
    RedirectUris = "https://login.microsoftonline.com/common/oauth2/nativeclient"
    HomePageUrl = "https://localhost:44322"
}
$params = @{
    DisplayName = "DPS by Simova"
    Web = $($desktop)
}
$app = New-MgApplication @params
Write-Host "Client ID of new app: " $($app.AppId)

# Create a service principal.
$ServicePrincipalID=@{
  "AppId" = $($app.AppId)
  }
$sp = New-MgServicePrincipal -BodyParameter $($ServicePrincipalId)
Write-Host "Object ID of new service principal: " $($sp.Id)

# Create a key for the service principal.
$credential = Add-MgServicePrincipalPassword -ServicePrincipalId $($sp.Id)
Write-Host "Credential of new service principal: " $($credential.SecretText)

OnPrem

if you are deploying DPS to your own environment, you have to enter the Noted down information in the Customsettings.config file, therefore open the DPS Management Tool and select the the given deployment. In the Advanced Section you can enter the noted down data the specified nodes.