How to register an Office 365 Application in Azure

2019-07-27 11:40发布

问题:

For easy deployment, I want to automate app registration process office 365 Azure AD. Manuel process is complex and time consuming to apply certificates and granting certain permissions on calendar or active directory or Graph.

I want to simplify the whole registration and deployment process so that process goes smoothly.

manual process link click here

回答1:

I got the following command to new Microsoft online ServicePrincipal

C:\PS>$cer = New-Object System.Security.Cryptography.X509Certificates.X509Certificate
              $cer.Import("C:\temp\myapp.cer")
              $binCert = $cer.GetRawCertData()
              $credValue = [System.Convert]::ToBase64String($binCert);
              New-MsolServicePrincipal -ServicePrincipalNames @("MyApp/myApp.com") 
                                       -DisplayName "My Application" 
                                       -Type asymmetric -Value $credValue

New service principal object created.

You need to connect to MsolService

$Credential = Get-Credential
Connect-MsolService -Credential $Credential