将 App Center 组织连接到 Azure Active Directory

重要

Visual Studio App Center 于 2025 年 3 月 31 日停用,但分析和诊断功能除外,这些功能将继续受支持,直到 2026 年 6 月 30 日。 了解详细信息

将 AAD 租户连接到 App Center

若要将 App Center 组织连接到 Azure Active Directory,请单击组织,单击“ 管理”,然后单击“ Azure”。 在 Azure 页上,单击“ 连接 ”并登录到 Azure Active Directory(如果尚未登录)。

App Center:管理组织的与 Azure 的连接

将显示 Azure Active Directory 租户的列表。 选择所需的连接,然后单击“ 连接”。

App Center:连接租户

Azure Active Directory 服务主体

将 App Center 帐户连接到 Azure Active Directory 时,将在 AAD 租户中创建一个服务主体,该租户允许 App Center 读取用户和安全组。 使用最小权限创建服务主体。

检查 App Center 服务主体

可以通过提交 GET 请求https://graph.microsoft.com/beta/servicePrincipals来检查服务主体。 (需要 Directory.Read.All 权限才能查看服务主体。

App Center:GET 服务主体 查询

还可以使用 Get-AzADServicePrincipal 检索服务主体。

Get-AzADServicePrincipal -DisplayName 'App Center'

示例服务主体

下面是一个服务主体,用于将 App Center 连接到示例 Azure AD 租户。

  • displayName 属性为“App Center”
  • appID 属性为“6201c56d-46d7-4152-bdb6-e0c77193784b”,它是 Azure Active Directory 中 App Center 的 GUID
  • publisherName是“Microsoft服务”
{
      "id": "3bd7a1a6-a74a-f5ed-9721-51ecxxxxxxxx",
      "deletedDateTime": null,
      "accountEnabled": true,
      "appDisplayName": "App Center",
      "appId": "6201c56d-46d7-4152-bdb6-e0c77193784b",
      "applicationTemplateId": null,
      "appOwnerOrganizationId": "f3cdef31-a31e-c3c9-443a-5f57xxxxxxxx",
      "appRoleAssignmentRequired": false,
      "displayName": "App Center",
      "errorUrl": null,
      "homepage": null,
      "info": {
        "termsOfServiceUrl": null,
        "supportUrl": null,
        "privacyStatementUrl": null,
        "marketingUrl": null,
        "logoUrl": null
      },
      "loginUrl": null,
      "logoutUrl": null,
      "notificationEmailAddresses": [],
      "publishedPermissionScopes": [],
      "preferredSingleSignOnMode": null,
      "preferredTokenSigningKeyEndDateTime": null,
      "preferredTokenSigningKeyThumbprint": null,
      "publisherName": "Microsoft Services",
      "replyUrls": [],
      "samlMetadataUrl": null,
      "samlSingleSignOnSettings": null,
      "servicePrincipalNames": [
        "6201c56d-46d7-4152-bdb6-e0c77193784b",
        "https://applicationinsights.azure.com"
      ],
      "signInAudience": "AzureADMultipleOrgs",
      "tags": [],
      "addIns": [],
      "api": {
        "resourceSpecificApplicationPermissions": []
      },
      "appRoles": [],
      "keyCredentials": [],
      "passwordCredentials": []
}

删除 App Center 帐户

删除 App Center 帐户时,服务主体将保留在 Azure Active Directory 租户中。 若要删除它,可以运行 Remove-AzADServicePrincipal

Remove-AzADServicePrincipal -ServicePrincipalName 'App Center'