Skip to main content

workspaces

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

Overview

Nameworkspaces
TypeResource
Idazure.log_analytics.workspaces

Fields

The following fields are returned by SELECT queries:

OK response definition.

NameDatatypeDescription
etagstringThe etag of the workspace.
identityobjectIdentity for the resource.
locationstringThe geo-location where the resource lives
propertiesobjectWorkspace properties.
systemDataobjectMetadata pertaining to creation and last modification of the resource.
tagsobjectResource tags.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresourceGroupName, workspaceName, subscriptionIdGets a workspace instance.
list_by_resource_groupselectresourceGroupName, subscriptionIdGets workspaces in a resource group.
listselectsubscriptionIdGets the workspaces in a subscription.
create_or_updateinsertresourceGroupName, workspaceName, subscriptionIdCreate or update a workspace.
updateupdateresourceGroupName, workspaceName, subscriptionIdUpdates a workspace.
deletedeleteresourceGroupName, workspaceName, subscriptionIdforceDeletes 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.

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
resourceGroupNamestringThe name of the resource group. The name is case insensitive.
subscriptionIdstringThe ID of the target subscription.
workspaceNamestringThe name of the workspace.
forcebooleanDeletes the workspace without the recovery option. A workspace that was deleted with this flag cannot be recovered.

SELECT examples

Gets a workspace instance.

SELECT
etag,
identity,
location,
properties,
systemData,
tags
FROM azure.log_analytics.workspaces
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND workspaceName = '{{ workspaceName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
;

INSERT examples

Create or update a workspace.

INSERT INTO azure.log_analytics.workspaces (
data__properties,
data__identity,
data__etag,
data__tags,
data__location,
resourceGroupName,
workspaceName,
subscriptionId
)
SELECT
'{{ properties }}',
'{{ identity }}',
'{{ etag }}',
'{{ tags }}',
'{{ location }}',
'{{ resourceGroupName }}',
'{{ workspaceName }}',
'{{ subscriptionId }}'
RETURNING
etag,
identity,
location,
properties,
systemData,
tags
;

UPDATE examples

Updates a workspace.

UPDATE azure.log_analytics.workspaces
SET
data__properties = '{{ properties }}',
data__identity = '{{ identity }}',
data__tags = '{{ tags }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}' --required
AND workspaceName = '{{ workspaceName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
RETURNING
etag,
identity,
location,
properties,
systemData,
tags;

DELETE examples

Deletes 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.

DELETE FROM azure.log_analytics.workspaces
WHERE resourceGroupName = '{{ resourceGroupName }}' --required
AND workspaceName = '{{ workspaceName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
AND force = '{{ force }}'
;