你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

ApplicationInsightsComponentResource.AddFavoriteAsync 方法

定义

将新收藏夹添加到 Application Insights 组件。

  • 请求路径/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}
  • 操作IdFavorites_Add
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.ApplicationInsights.Models.ApplicationInsightsComponentFavorite>> AddFavoriteAsync (string favoriteId, Azure.ResourceManager.ApplicationInsights.Models.ApplicationInsightsComponentFavorite favoriteProperties, System.Threading.CancellationToken cancellationToken = default);
abstract member AddFavoriteAsync : string * Azure.ResourceManager.ApplicationInsights.Models.ApplicationInsightsComponentFavorite * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.ApplicationInsights.Models.ApplicationInsightsComponentFavorite>>
override this.AddFavoriteAsync : string * Azure.ResourceManager.ApplicationInsights.Models.ApplicationInsightsComponentFavorite * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.ApplicationInsights.Models.ApplicationInsightsComponentFavorite>>
Public Overridable Function AddFavoriteAsync (favoriteId As String, favoriteProperties As ApplicationInsightsComponentFavorite, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of ApplicationInsightsComponentFavorite))

参数

favoriteId
String

Application Insights 组件中定义的特定收藏夹的 ID。

favoriteProperties
ApplicationInsightsComponentFavorite

需要指定以创建新收藏夹并将其添加到 Application Insights 组件的属性。

cancellationToken
CancellationToken

要使用的取消标记。

返回

例外

favoriteId 是一个空字符串,预期为非空。

favoriteIdfavoriteProperties 为 null。

适用于