Skip to main content

shared_keys

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

Overview

Nameshared_keys
TypeResource
Idazure.log_analytics.shared_keys

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
primarySharedKeystringThe primary shared key of a workspace.
secondarySharedKeystringThe secondary shared key of a workspace.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_shared_keysselectresource_group_name, workspace_name, subscription_idGets the shared keys for a workspace.
regenerateexecresource_group_name, workspace_name, subscription_idRegenerates the shared keys for a Log Analytics Workspace. These keys are used to connect Microsoft Operational Insights agents to the workspace.

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
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring
workspace_namestringThe name of the workspace. Required.

SELECT examples

Gets the shared keys for a workspace.

SELECT
primarySharedKey,
secondarySharedKey
FROM azure.log_analytics.shared_keys
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND workspace_name = '{{ workspace_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

Lifecycle Methods

Regenerates the shared keys for a Log Analytics Workspace. These keys are used to connect Microsoft Operational Insights agents to the workspace.

EXEC azure.log_analytics.shared_keys.regenerate 
@resource_group_name='{{ resource_group_name }}' --required,
@workspace_name='{{ workspace_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;