【发布时间】:2017-01-31 15:55:49
【问题描述】:
我们有一个 Office365 租户,但没有要同步的本地 AD(是的,我们普遍在 linux 上运行)。我们的用户“生活”在一个 oracle 数据库中。从那里它们被复制到我们使用的所有其他后端(OpenLDAP、MySQL、Kerberos ......现在甚至是 Azure)。
我们正在使用“Microsoft Azure Client Libraries for Python”并且能够创建和更新用户(我们必须扩展 UserUpdateParameters 类)。
但是当涉及到更新/设置用户邮件别名时(用户有多个本地部分,并且可能有多个域名部分),我们得到以下异常:
Traceback (most recent call last):
File "update.max_sgv.py", line 87, in <module>
uu = graphrbac_client.users.update(object_id, parameters)
File "/usr/local/lib/python2.7/dist-packages/azure/graphrbac/operations/users_operations.py", line 275, in update
raise models.GraphErrorException(self._deserialize, response)
azure.graphrbac.models.graph_error.GraphErrorException: Property 'proxyAddresses' is read-only and cannot be set.
有人知道如何使用 python(azure、msrest)来做到这一点吗?
顺便说一句:otherMails 不能解决问题。
无论如何,将它暴露给其他 API(例如 Power shell AD 扩展)而不是 Graph API 对我来说是不合理的。
感谢您抽出宝贵时间,也希望您提出建议。
马西莫·巴斯
【问题讨论】:
-
您能否在
update.max_sgv.py中发布您为用户执行更新操作的代码以及代码uu = graphrbac_client.users.update(object_id, parameters)的parameters值?根据我的经验,proxyAddresses似乎是作为请求数据存在于parameters变量中的属性。但是根据报错信息,proxyAddresses是只读的,only within the response body。
标签: python azure office365 microsoft-graph-api