Skip to main content

favorites

Creates, updates, deletes, gets or lists a favorites resource.

Overview

Namefavorites
TypeResource
Idazure.application_insights.favorites

Fields

The following fields are returned by SELECT queries:

A favorite definition associated to the Application Insights component.

NameDatatypeDescription
CategorystringFavorite category, as defined by the user at creation time.
ConfigstringConfiguration of this particular favorite, which are driven by the Azure portal UX. Configuration data is a string containing valid JSON
FavoriteIdstringInternally assigned unique id of the favorite definition.
FavoriteTypestringEnum indicating if this favorite definition is owned by a specific user or is shared between all users with access to the Application Insights component.
IsGeneratedFromTemplatebooleanFlag denoting wether or not this favorite was generated from a template.
NamestringThe user-defined name of the favorite.
SourceTypestringThe source of the favorite definition.
TagsarrayA list of 0 or more tags that are associated with this favorite definition
TimeModifiedstringDate and time in UTC of the last modification that was made to this favorite definition.
UserIdstringUnique user id of the specific user that owns this favorite.
VersionstringThis instance's version of the data model. This can change as new features are added that can be marked favorite. Current examples include MetricsExplorer (ME) and Search.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresourceGroupName, subscriptionId, resourceName, favoriteIdGet a single favorite by its FavoriteId, defined within an Application Insights component.
updateupdateresourceGroupName, subscriptionId, resourceName, favoriteIdUpdates a favorite that has already been added to an Application Insights component.
deletedeleteresourceGroupName, subscriptionId, resourceName, favoriteIdRemove a favorite that is associated to an Application Insights component.
listexecresourceGroupName, subscriptionId, resourceNamefavoriteType, sourceType, canFetchContent, tagsGets a list of favorites defined within an Application Insights component.
addexecresourceGroupName, subscriptionId, resourceName, favoriteIdAdds a new favorites to an Application Insights component.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
favoriteIdstringThe Id of a specific favorite defined in the Application Insights component
resourceGroupNamestringThe name of the resource group. The name is case insensitive.
resourceNamestringThe name of the Application Insights component resource.
subscriptionIdstring (uuid)The ID of the target subscription. The value must be an UUID.
canFetchContentbooleanFlag indicating whether or not to return the full content for each applicable favorite. If false, only return summary content for favorites.
favoriteTypestringThe type of favorite. Value can be either shared or user.
sourceTypestringSource type of favorite to return. When left out, the source type defaults to 'other' (not present in this enum).
tagsarrayTags that must be present on each favorite returned.

SELECT examples

Get a single favorite by its FavoriteId, defined within an Application Insights component.

SELECT
Category,
Config,
FavoriteId,
FavoriteType,
IsGeneratedFromTemplate,
Name,
SourceType,
Tags,
TimeModified,
UserId,
Version
FROM azure.application_insights.favorites
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
AND resourceName = '{{ resourceName }}' -- required
AND favoriteId = '{{ favoriteId }}' -- required
;

UPDATE examples

Updates a favorite that has already been added to an Application Insights component.

UPDATE azure.application_insights.favorites
SET
data__Name = '{{ Name }}',
data__Config = '{{ Config }}',
data__Version = '{{ Version }}',
data__FavoriteType = '{{ FavoriteType }}',
data__SourceType = '{{ SourceType }}',
data__Tags = '{{ Tags }}',
data__Category = '{{ Category }}',
data__IsGeneratedFromTemplate = {{ IsGeneratedFromTemplate }}
WHERE
resourceGroupName = '{{ resourceGroupName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
AND resourceName = '{{ resourceName }}' --required
AND favoriteId = '{{ favoriteId }}' --required
RETURNING
Category,
Config,
FavoriteId,
FavoriteType,
IsGeneratedFromTemplate,
Name,
SourceType,
Tags,
TimeModified,
UserId,
Version;

DELETE examples

Remove a favorite that is associated to an Application Insights component.

DELETE FROM azure.application_insights.favorites
WHERE resourceGroupName = '{{ resourceGroupName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
AND resourceName = '{{ resourceName }}' --required
AND favoriteId = '{{ favoriteId }}' --required
;

Lifecycle Methods

Gets a list of favorites defined within an Application Insights component.

EXEC azure.application_insights.favorites.list 
@resourceGroupName='{{ resourceGroupName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required,
@resourceName='{{ resourceName }}' --required,
@favoriteType='{{ favoriteType }}',
@sourceType='{{ sourceType }}',
@canFetchContent={{ canFetchContent }},
@tags='{{ tags }}'
;