Skip to main content

workspaces

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

Overview

Nameworkspaces
TypeResource
Idazure.log_analytics.workspaces

Fields

NameDatatypeDescription
created_datetextfield from the properties object
customer_idtextfield from the properties object
default_data_collection_rule_resource_idtextfield from the properties object
etagtextThe etag of the workspace.
featurestextfield from the properties object
force_cmk_for_querytextfield from the properties object
identitytextIdentity for the resource.
locationtextThe geo-location where the resource lives
modified_datetextfield from the properties object
private_link_scoped_resourcestextfield from the properties object
provisioning_statetextfield from the properties object
public_network_access_for_ingestiontextfield from the properties object
public_network_access_for_querytextfield from the properties object
resourceGroupNametextfield from the properties object
retention_in_daystextfield from the properties object
skutextfield from the properties object
subscriptionIdtextfield from the properties object
system_datatextfield from the properties object
tagstextResource tags.
workspaceNametextfield from the properties object
workspace_cappingtextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTresourceGroupName, subscriptionId, workspaceNameGets a workspace instance.
listSELECTsubscriptionIdGets the workspaces in a subscription.
list_by_resource_groupSELECTresourceGroupName, subscriptionIdGets workspaces in a resource group.
create_or_updateINSERTresourceGroupName, subscriptionId, workspaceNameCreate or update a workspace.
deleteDELETEresourceGroupName, subscriptionId, workspaceNameDeletes a workspace resource. To recover the workspace, create it again with the same name, in the same subscription, resource group and location. The name is kept for 14 days and cannot be used for another workspace. To remove the workspace completely and release the name, use the force flag.
updateUPDATEresourceGroupName, subscriptionId, workspaceNameUpdates a workspace.

SELECT examples

Gets the workspaces in a subscription.

SELECT
created_date,
customer_id,
default_data_collection_rule_resource_id,
etag,
features,
force_cmk_for_query,
identity,
location,
modified_date,
private_link_scoped_resources,
provisioning_state,
public_network_access_for_ingestion,
public_network_access_for_query,
resourceGroupName,
retention_in_days,
sku,
subscriptionId,
system_data,
tags,
workspaceName,
workspace_capping
FROM azure.log_analytics.vw_workspaces
WHERE subscriptionId = '{{ subscriptionId }}';

INSERT example

Use the following StackQL query and manifest file to create a new workspaces resource.

/*+ create */
INSERT INTO azure.log_analytics.workspaces (
resourceGroupName,
subscriptionId,
workspaceName,
properties,
identity,
etag,
tags,
location
)
SELECT
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ workspaceName }}',
'{{ properties }}',
'{{ identity }}',
'{{ etag }}',
'{{ tags }}',
'{{ location }}'
;

UPDATE example

Updates a workspaces resource.

/*+ update */
UPDATE azure.log_analytics.workspaces
SET
properties = '{{ properties }}',
identity = '{{ identity }}',
tags = '{{ tags }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND workspaceName = '{{ workspaceName }}';

DELETE example

Deletes the specified workspaces resource.

/*+ delete */
DELETE FROM azure.log_analytics.workspaces
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND workspaceName = '{{ workspaceName }}';