public function getContributorRoleAssignmentInfo($subscriptionId, $appObjectId, $contributorRoleId)
{
$result = null;
$path = '/subscriptions/' . $subscriptionId . '/providers/Microsoft.Authorization/roleAssignments';
$headers = ['Authorization' => 'Bearer ' . $this->getAccessToken()->token];
$request = $this->getClient()->prepareRequest($path, 'GET', self::RESOURCE_API_VERSION, Azure::URL_MANAGEMENT_WINDOWS, [], [], $headers);
$response = $this->getClient()->call($request);
$contributorRoleDefinitionId = "/subscriptions/" . $subscriptionId . "/providers/Microsoft.Authorization/roleDefinitions/" . $contributorRoleId;
if (!$response->hasError()) {
$responseObject = $response->getResult();
foreach ($responseObject as $roleAssignment) {
$roleAssignment = RoleAssignmentData::initArray($roleAssignment);
/* @var $roleAssignment RoleAssignmentData */
if (!empty($roleAssignment->properties->roleDefinitionId) && !empty($roleAssignment->properties->principalId) && $roleAssignment->properties->roleDefinitionId == $contributorRoleDefinitionId && $roleAssignment->properties->principalId == $appObjectId) {
$result = $roleAssignment;
break;
}
}
}
return $result;
}