Microsoft.Azure.Commands.HDInsight.NewAzureHDInsightClusterCommand.GetApplicationId C# (CSharp) Method

GetApplicationId() private method

private GetApplicationId ( ) : System.Guid
return System.Guid
        private Guid GetApplicationId()
        {
            GraphRbacManagementClient graphClient = AzureSession.ClientFactory.CreateArmClient<GraphRbacManagementClient>(
                DefaultProfile.Context, AzureEnvironment.Endpoint.Graph);

            graphClient.TenantID = DefaultProfile.Context.Tenant.Id.ToString();

            Microsoft.Azure.Graph.RBAC.Models.ServicePrincipal sp = graphClient.ServicePrincipals.Get(ObjectId.ToString());

            var applicationId = Guid.Empty;
            Guid.TryParse(sp.AppId, out applicationId);
            Debug.Assert(applicationId != Guid.Empty);
            return applicationId;
        }
    }