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:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
networkSecurityPerimeterobjectInformation about a network security perimeter (NSP).
profileobject:vartype profile: ~azure.mgmt.loganalytics.models.NetworkSecurityProfile
provisioningIssuesarrayList of provisioning issues, if any.
provisioningStatestringKnown values are: "Succeeded", "Creating", "Updating", "Deleting", "Accepted", "Failed", and "Canceled". (Succeeded, Creating, Updating, Deleting, Accepted, Failed, Canceled)
resourceAssociationobject:vartype resource_association: ~azure.mgmt.loganalytics.models.ResourceAssociation
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_nspselectresource_group_name, workspace_name, network_security_perimeter_configuration_name, subscription_idGets a network security perimeter configuration.
getselectresource_group_name, workspace_name, subscription_idGets a workspace instance.
list_by_resource_groupselectresource_group_name, subscription_idGets workspaces in a resource group.
listselectsubscription_idGets the workspaces in a subscription.
create_or_updateinsertresource_group_name, workspace_name, subscription_id, locationCreate or update a workspace.
updateupdateresource_group_name, workspace_name, subscription_idUpdates a workspace.
create_or_updatereplaceresource_group_name, workspace_name, subscription_id, locationCreate or update a workspace.
deletedeleteresource_group_name, workspace_name, subscription_idforceDeletes 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.
list_nspexecresource_group_name, workspace_name, subscription_idGets a list of NSP configurations for specified workspace.
failbackexecresource_group_name, workspace_name, subscription_idDeactivates failover for the specified workspace. The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be checked using the operationId returned in the response.
reconcile_nspexecresource_group_name, workspace_name, network_security_perimeter_configuration_name, subscription_idReconcile network security perimeter configuration for Workspace resource.
failoverexecresource_group_name, location, workspace_name, subscription_idActivates failover for the specified workspace. The specified replication location must match the location of the enabled replication for this workspace. The failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be checked using the operationId returned in the response.

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
locationstringThe location name. Required.
network_security_perimeter_configuration_namestringThe name for a network security perimeter configuration. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring
workspace_namestringThe name of the workspace. Required.
forcebooleanDeletes the workspace without the recovery option. A workspace that was deleted with this flag cannot be recovered. Default value is None.

SELECT examples

Gets a network security perimeter configuration.

SELECT
id,
name,
networkSecurityPerimeter,
profile,
provisioningIssues,
provisioningState,
resourceAssociation,
systemData,
type
FROM azure.log_analytics.workspaces
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND workspace_name = '{{ workspace_name }}' -- required
AND network_security_perimeter_configuration_name = '{{ network_security_perimeter_configuration_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create or update a workspace.

INSERT INTO azure.log_analytics.workspaces (
tags,
location,
properties,
identity,
etag,
resource_group_name,
workspace_name,
subscription_id
)
SELECT
'{{ tags }}',
'{{ location }}' /* required */,
'{{ properties }}',
'{{ identity }}',
'{{ etag }}',
'{{ resource_group_name }}',
'{{ workspace_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
etag,
identity,
location,
properties,
systemData,
tags,
type
;

UPDATE examples

Updates a workspace.

UPDATE azure.log_analytics.workspaces
SET
properties = '{{ properties }}',
identity = '{{ identity }}',
tags = '{{ tags }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND workspace_name = '{{ workspace_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
etag,
identity,
location,
properties,
systemData,
tags,
type;

REPLACE examples

Create or update a workspace.

REPLACE azure.log_analytics.workspaces
SET
tags = '{{ tags }}',
location = '{{ location }}',
properties = '{{ properties }}',
identity = '{{ identity }}',
etag = '{{ etag }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND workspace_name = '{{ workspace_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND location = '{{ location }}' --required
RETURNING
id,
name,
etag,
identity,
location,
properties,
systemData,
tags,
type;

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

Lifecycle Methods

Gets a list of NSP configurations for specified workspace.

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