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:

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. Known values are: "shared" and "user". (shared, user)
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
getselectresource_group_name, resource_name, favorite_id, subscription_idGet a single favorite by its FavoriteId, defined within an Application Insights component.
listselectresource_group_name, resource_name, subscription_idfavoriteType, sourceType, canFetchContent, tagsGets a list of favorites defined within an Application Insights component.
updateupdateresource_group_name, resource_name, favorite_id, subscription_idUpdates a favorite that has already been added to an Application Insights component.
deletedeleteresource_group_name, resource_name, favorite_id, subscription_idRemove a favorite that is associated to an Application Insights component.
addexecresource_group_name, resource_name, favorite_id, subscription_idAdds 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
favorite_idstringThe Id of a specific favorite defined in the Application Insights component. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
resource_namestringThe name of the Application Insights component resource. Required.
subscription_idstring
canFetchContentbooleanFlag indicating whether or not to return the full content for each applicable favorite. If false, only return summary content for favorites. Default value is None.
favoriteTypestringThe type of favorite. Value can be either shared or user. Known values are: "shared" and "user". Default value is None.
sourceTypestringSource type of favorite to return. When left out, the source type defaults to 'other' (not present in this enum). Known values are: "retention", "notebook", "sessions", "events", "userflows", "funnel", "impact", and "segmentation". Default value is None.
tagsarrayTags that must be present on each favorite returned. Default value is None.

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 resource_group_name = '{{ resource_group_name }}' -- required
AND resource_name = '{{ resource_name }}' -- required
AND favorite_id = '{{ favorite_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

UPDATE examples

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

UPDATE azure.application_insights.favorites
SET
Name = '{{ Name }}',
Config = '{{ Config }}',
Version = '{{ Version }}',
FavoriteType = '{{ FavoriteType }}',
SourceType = '{{ SourceType }}',
Tags = '{{ Tags }}',
Category = '{{ Category }}',
IsGeneratedFromTemplate = {{ IsGeneratedFromTemplate }}
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND resource_name = '{{ resource_name }}' --required
AND favorite_id = '{{ favorite_id }}' --required
AND subscription_id = '{{ subscription_id }}' --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 resource_group_name = '{{ resource_group_name }}' --required
AND resource_name = '{{ resource_name }}' --required
AND favorite_id = '{{ favorite_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

Adds a new favorites to an Application Insights component.

EXEC azure.application_insights.favorites.add 
@resource_group_name='{{ resource_group_name }}' --required,
@resource_name='{{ resource_name }}' --required,
@favorite_id='{{ favorite_id }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"Name": "{{ Name }}",
"Config": "{{ Config }}",
"Version": "{{ Version }}",
"FavoriteType": "{{ FavoriteType }}",
"SourceType": "{{ SourceType }}",
"Tags": "{{ Tags }}",
"Category": "{{ Category }}",
"IsGeneratedFromTemplate": {{ IsGeneratedFromTemplate }}
}'
;