將服務主體新增至伺服器管理員角色Add a service principal to the server administrator role

若要將無人看管的 PowerShell 工作自動化,服務主體必須擁有受控 Analysis Services 伺服器的伺服器管理員權限。To automate unattended PowerShell tasks, a service principal must have server administrator privileges on the Analysis Services server being managed. 本文說明如何將服務主體新增至 Azure AS 伺服器上的伺服器管理員角色。This article describes how to add a service principal to the server administrators role on an Azure AS server.

開始之前Before you begin

完成這項工作前,您必須在 Azure Active Directory 中註冊服務主體。Before completing this task, you must have a service principal registered in Azure Active Directory.

建立服務主體 - Azure 入口網站 Create service principal - Azure portal
建立服務主體 - PowerShellCreate service principal - PowerShell

所需的權限Required permissions

若要完成這項工作,您必須擁有 Azure AS 伺服器的伺服器管理員權限。To complete this task, you must have server administrator permissions on the Azure AS server.

將服務主體加入至伺服器管理員角色Add service principal to server administrators role

  1. 在 SSMS 中,連線至 Azure AS 伺服器。In SSMS, connect to your Azure AS server.

  2. 在 [伺服器屬性] > [安全性] 中,按一下 [新增]。In Server Properties > Security, click Add.

  3. 在 [選取使用者或群組] 中,以名稱搜尋您註冊的應用程式,選取它,然後按一下 [新增]。In Select a User or Group, search for your registered app by name, select, and then click Add.

    搜尋服務主體帳戶

  4. 確認服務主體帳戶識別碼,然後按一下 [確定]。Verify the service principal account ID, and then click OK.

    搜尋服務主體帳戶

注意

使用 Azure PowerShell cmdlet 的伺服器作業,服務主體的執行排程器也必須屬於擁有者中的資源角色azure 角色型存取控制 (RBAC)For server operations using Azure PowerShell cmdlets, service principal running scheduler must also belong to the Owner role for the resource in Azure Role-Based Access Control (RBAC).