以编程方式将Azure CSP订阅分配给您的客户 [英] Assign Azure CSP subscriptions to your customers programmatically

查看:47
本文介绍了以编程方式将Azure CSP订阅分配给您的客户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为客户创建了AZURE CSP订阅.

当我以合作伙伴管理员用户身份登录到特定的客户目录时(客户->单击客户的下拉菜单-> Microsoft Azure管理门户链接),我可以看到订阅.
但是,当我尝试以客户域/目录的管理员身份登录时,看不到它.当我搜索它时,我发现了该链接

使用此访问令牌使用

I have created an AZURE CSP subscription for a customer.

When I log in to the particular customer directory as a partner admin user (Customers -> Click the dropdown for a customer -> Microsoft Azure Management Portal link), I am able to see the subscription.
But when I try to login as the admin of the customer domain/directory, I am not able to see it. When I searched about it, I came across the link https://docs.microsoft.com/en-us/partner-center/assign-azure-subscriptions

Is there any way to do the step Assign Azure subscriptions to your customers through API.

解决方案

You could use Azure Rest API Role Assignments - Create or Role Assignments - Create By Id.

You can see that there is a Try It feature in the page but we cannot make it work with an CSP admin, because if we sign in with an CSP admin, the access token will be issued for the CSP admin's tenant rather than customer's tenant by default.

To call Azure rest API, you need an access token for Azure. Please refer to this document.

Here is my sample for your reference:

Get the access token for Azure service in Postman. Sign in with your CSP admin to generate the access token. Remember that you should put the customer's tenant id in Auth URL: https://login.microsoftonline.com/{custopmer's tenant id}/oauth2/v2.0/authorize and Access Token URL: https://login.microsoftonline.com/{custopmer's tenant id}/oauth2/v2.0/token

Use this access token to assign Azure subscription using Role Assignments - Create.

这篇关于以编程方式将Azure CSP订阅分配给您的客户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆