New-AzureRmOperationalInsightsWorkspace

Creates a workspace.

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

New-AzureRmOperationalInsightsWorkspace
   [-ResourceGroupName] <String>
   [-Name] <String>
   [-Location] <String>
   [[-Sku] <String>]
   [[-CustomerId] <Guid>]
   [[-Tag] <Hashtable>]
   [[-RetentionInDays] <Int32>]
   [-Force]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-AzureRmOperationalInsightsWorkspace cmdlet creates a workspace in the specified resource group and location.

Examples

Example 1: Create a workspace by name

PS C:\>New-AzureRmOperationalInsightsWorkspace -ResourceGroupName "ContosoResourceGroup" -Name "MyWorkspace" -Location "East US" -Sku "Standard"

This command creates a standard SKU workspace named MyWorkspace in the resource group named ContosoResourceGroup.

PS C:\>$OILinkTargets = Get-AzureRmOperationalInsightsLinkTargets

PS C:\>$OILinkTargets[0] | New-AzureRmOperationalInsightsWorkspace -ResourceGroupName "ContosoResourceGroup" -Name "MyWorkspace" -Sku "Standard"

The first command uses the Get-AzureRmOperationalInsightsLinkTargets cmdlet to get Operational Insights account link targets, and then stores them in the $OILinkTargets variable. The second command passes the first account link target in $OILinkTargets to the New-AzureRmOperationalInsightsWorkspace cmdlet by using the pipeline operator. The command creates a standard SKU workspace named MyWorkspace that is linked to the first Operational Insights account in $OILinkTargets.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CustomerId

Specifies the account to which this workspace will be linked. The Get-AzureRmOperationalInsightsLinkTargets cmdlet can also be used to list the potential accounts.

Type:Nullable<T>[Guid]
Position:4
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Force

Forces the command to run without asking for user confirmation.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Location

Specifies the location in which to create the workspace, for example, East US or West Europe.

Type:String
Position:2
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

Specifies the name of the workspace.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ResourceGroupName

Specifies the name of an Azure resource group. The workspace is created in this resource group.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-RetentionInDays

The workspace data retention in days. 730 days is the maximum allowed for all other Skus

Type:Nullable<T>[Int32]
Position:6
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Sku

Specifies the service tier of the workspace. Valid values are:

  • free
  • standard
  • premium
Type:String
Accepted values:free, standard, premium, pernode, standalone
Position:3
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Tag

The resource tags for the workspace.

Type:Hashtable
Position:5
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

Nullable<T>[[System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]

Hashtable

Nullable<T>[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]

Outputs

PSWorkspace