Azure Active Directory (Azure AD) is Microsoft's fully managed multi-tenant identity and access capabilities for app service. More organizations are now harnessing the security capabilities of Azure AD into the apps they create for an additional layer of authentication. This post will cover how to register an app to Azure AD via PowerShell to take advantage of this.
The Azure AD Module needs to be added to PowerShell prior to getting started. Execute the command below in PowerShell using elevated or Administrative status:
Once the Azure AD Module is installed, run the following command in the same PowerShell window to connect to the required Azure AD tenant:
NOTE: The required TenantId will be required in subscriptions with multiple tenants. The TenantId value can be found in the Azure Portal navigating to Azure Active Directory > Properties and is listed under Directory ID.
Azure Active Directory TenantId
Run the following command in the same PowerShell window to connect to the specific Azure AD TenantId (if required):
Connect-AzureAD -TenantId *Insert Directory ID here*
Step 1: Creating the Azure AD App Registration
Next the following cmdlet is run, now that required Azure AD tenant is connected to PowerShell, to capture the name of the application and the IdentifierURI.
With the required URIs now captured, it is time to add the application key. The key will be stored in the Azure Key Vault which ensures the it's security and disallows unauthorized access. Run the following command to invoke this process: