我们正在MS Azure中构建一个多租户SaaS应用程序,允许客户将自己的Azure租户带到我们这里,以便我们可以审核其数据 . 为了获得此权限,我们采用标准同意流程,客户租户的全局管理员应授予我们应用的权限 .
如果我们与租户合作's data such as sharepoint files or users/groups, but recently we'已经要求读取客户的 Azure Subscription 中的审计日志(例如创建/删除VM的事件,使用存储帐户进行操作等),则此方法可以 . 为了实现这一点,我们使用Azure Monitor API(以前的Azure Insights API):https://msdn.microsoft.com/en-us/library/azure/dn931943.aspx .
问题是Microsoft提供的同意框架似乎没有一种机制来分配角色来访问Azure Subscription的数据 . 尝试使用我们的主体读取数据时,我们收到以下错误:
客户'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',对象ID为'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',无权执行'microsoft.insights / eventtypes / values / read'over scope'/订阅/ XXXXXXXXXXXX-XXXXXXXX-XXXXXXXXXXXX” .
截至目前,我们在Azure门户网站(https://docs.microsoft.com/en-us/azure/resource-group-create-service-principal-portal,"Assign application to role"部分)中没有't found a way to fix the error except for manually adding the role 1393165 to our app in customer'订阅设置,但我们真的想避免手动程序 .
任何想法如何以更优雅的方式解决这个问题?
1 回答
有两种方法:
使用内置监视角色(https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-roles-permissions-security#built-in-monitoring-roles)
按照此处的指南进行基于应用程序的身份验证:https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-rest-api-walkthrough