Just like before, we will be using Azure PowerShell to create a new Azure Automation account within a resource group. Before creating a resource group and an automation account, a connection to Azure should be established. However, this time, the credentials used should not be the credentials used earlier. Instead, use the service application created in the previous step:
- The command to connect to Azure using the service application is as follows:
Login-AzureRmAccount -ServicePrincipal -CertificateThumbprint "003B0D26705C792DB60823DA5804A0897160C306" -ApplicationId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -Tenant "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
- Here, the applicationId is available after executing the New-AzureRmADApplication ...