是否有Azure API可用于执行此处概述的步骤:
我能找到的最接近的是:
https://docs.microsoft.com/en-us/rest/api/authorization/roleassignments
我使用Python SDK,该API的接口在这里 - https://github.com/Azure/azure-sdk-for-python/tree/master/azure-mgmt-authorization
此API似乎用于授予Azure订阅下的资源访问权限,而不是订阅本身...
1 回答
实际上,您想要的是Azure Python SDk中的REST API Role Assignments和
azure-mgmt-authorization
的API create(scope, role_assignment_name, properties=None, custom_headers=None, raw=False, **operation_config) . 请注意APis中的scope
属性/参数,它具有针对不同范围的许多不同格式,如下所示 . 例如,您需要使用/subscriptions/{subscription-id}/
进行订阅 .希望能帮助到你 .