Azure REST API:如何获取SQL Server用户/管理员 [英] Azure REST API: How to get SQL Server users/admin

查看:61
本文介绍了Azure REST API:如何获取SQL Server用户/管理员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Azure门户中,导航到SQL Server时,我可以看到/编辑它的用户和AD Admin.

是否有一种获取/列出所有用户的方法?通过API的SQL Server管理员?
通过通过AD Admin,我的意思是用户通过以下方式进行设置:

解决方案

用户:

广告管理员:通过powershell -请参阅使用PowerShell为Azure SQL Server设置Azure AD管理员".似乎有一个参考,表明有通过REST API公开此内容的意图,但文档中似乎没有该内容.让我看看我们能做些什么.


编辑:列出特定SQL Server的所有角色分配的powershell命令为:

Get-AzureRmRoleAssignment -ResourceGroupName<您的资源组名称>-ResourceType Microsoft.Sql/servers -ResourceName<您的服务器名称>-IncludeClassicAdministrators

使用REST命令可以实现类似的方法.

要注意的重要事项:这仅枚举Azure权限集,此处没有枚举SQL Server级别的RBAC.

In the Azure Portal, when navigating to a SQL Server, I can see/edit it's users and AD Admin.

Is there a way to get/list all users & admin(s) of SQL Server via API?
Looking thru the Azure API Reference I couldn't find any such API.

Edit: By SQL Users I mean users set via: By AD Admin I mean the user set via:

解决方案

Users: via powershell or via REST - see "List role assignments at a specific scope"

AD Administrator: via powershell- see "Provision an Azure AD administrator for Azure SQL Server by using PowerShell". There seems to be a reference that would indicate an intent to expose this via the REST API, but it seems to be missing from the documentation. Let me see what we can do about that.


Edit: The powershell command that would list all Role assignments for a specific SQL server would be:

Get-AzureRmRoleAssignment -ResourceGroupName <your resource group name> -ResourceType Microsoft.Sql/servers -ResourceName <your server name> -IncludeClassicAdministrators

A similar approach is possible with the REST commands.

Important to note: This only enumerates the Azure permission set, and no RBAC on the SQL Server level is enumerated here.

这篇关于Azure REST API:如何获取SQL Server用户/管理员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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