Skip to main content

query_packs

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

Overview

Namequery_packs
TypeResource
Idazure.log_analytics.query_packs

Fields

The following fields are returned by SELECT queries:

An Log Analytics QueryPack definition.

NameDatatypeDescription
idstringAzure resource Id
namestringAzure resource name
locationstringResource location
propertiesobjectProperties that define a Log Analytics QueryPack resource.
tagsobjectResource tags
typestringAzure resource type

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresourceGroupName, subscriptionId, queryPackNameReturns a Log Analytics QueryPack.
list_by_resource_groupselectresourceGroupName, subscriptionIdGets a list of Log Analytics QueryPacks within a resource group.
listselectsubscriptionIdGets a list of all Log Analytics QueryPacks within a subscription.
create_or_updateinsertresourceGroupName, subscriptionId, queryPackName, data__propertiesCreates (or updates) a Log Analytics QueryPack. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation.
deletedeleteresourceGroupName, subscriptionId, queryPackNameDeletes a Log Analytics QueryPack.
update_tagsexecresourceGroupName, subscriptionId, queryPackNameUpdates an existing QueryPack's tags. To update other fields use the CreateOrUpdate method.

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
queryPackNamestringThe name of the Log Analytics QueryPack resource.
resourceGroupNamestringThe name of the resource group. The name is case insensitive.
subscriptionIdstringThe ID of the target subscription.

SELECT examples

Returns a Log Analytics QueryPack.

SELECT
id,
name,
location,
properties,
tags,
type
FROM azure.log_analytics.query_packs
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
AND queryPackName = '{{ queryPackName }}' -- required
;

INSERT examples

Creates (or updates) a Log Analytics QueryPack. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation.

INSERT INTO azure.log_analytics.query_packs (
data__properties,
data__location,
data__tags,
resourceGroupName,
subscriptionId,
queryPackName
)
SELECT
'{{ properties }}' /* required */,
'{{ location }}',
'{{ tags }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ queryPackName }}'
RETURNING
id,
name,
location,
properties,
tags,
type
;

DELETE examples

Deletes a Log Analytics QueryPack.

DELETE FROM azure.log_analytics.query_packs
WHERE resourceGroupName = '{{ resourceGroupName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
AND queryPackName = '{{ queryPackName }}' --required
;

Lifecycle Methods

Updates an existing QueryPack's tags. To update other fields use the CreateOrUpdate method.

EXEC azure.log_analytics.query_packs.update_tags 
@resourceGroupName='{{ resourceGroupName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required,
@queryPackName='{{ queryPackName }}' --required
@@json=
'{
"tags": "{{ tags }}"
}'
;