New-AzOperationalInsightsWorkspace
Creates a workspace, or restore a soft-deleted workspace.
Note
This is the previous version of our documentation. Please consult the most recent version for up-to-date information.
Syntax
New-AzOperationalInsightsWorkspace
[-ResourceGroupName] <String>
[-Name] <String>
[-Location] <String>
[[-Sku] <String>]
[[-Tag] <Hashtable>]
[[-RetentionInDays] <Int32>]
[-Force]
[-DefaultProfile <IAzureContextContainer>]
[[-PublicNetworkAccessForIngestion] <String>]
[[-PublicNetworkAccessForQuery] <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The New-AzOperationalInsightsWorkspace cmdlet creates a workspace in the specified resource group and location. Or restore a soft-deleted workspace.
Examples
Example 1: Create a workspace by name
PS C:\>New-AzOperationalInsightsWorkspace -ResourceGroupName "ContosoResourceGroup" -Name "MyWorkspace" -Location "East US"
This command creates a standard SKU workspace named MyWorkspace in the resource group named ContosoResourceGroup.
Example 2: Create a workspace and link it to an existing account
PS C:\>$OILinkTargets = Get-AzOperationalInsightsLinkTargets
PS C:\>$OILinkTargets[0] | New-AzOperationalInsightsWorkspace -ResourceGroupName "ContosoResourceGroup" -Name "MyWorkspace"
The first command uses the Get-AzOperationalInsightsLinkTargets 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-AzOperationalInsightsWorkspace 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
Prompts you for confirmation before running the cmdlet.
| Type: | SwitchParameter |
| Aliases: | cf |
| Position: | Named |
| Default value: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with azure
| Type: | IAzureContextContainer |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Forces the command to run without asking for user confirmation.
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the location in which to create the workspace, for example, East US or West Europe.
| Type: | String |
| Position: | 2 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Specifies the name of the workspace.
| Type: | String |
| Position: | 1 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The network access type for accessing workspace ingestion. Value should be 'Enabled' or 'Disabled'
| Type: | String |
| Position: | 7 |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The network access type for accessing workspace query. Value should be 'Enabled' or 'Disabled'
| Type: | String |
| Position: | 8 |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the name of an Azure resource group. The workspace is created in this resource group.
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
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 |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Specifies the service tier of the workspace. For more information regarding which value to use please check https://docs.microsoft.com/azure/azure-monitor/platform/manage-cost-storage#legacy-pricing-tiers. Valid values are:
- free
- pergb2018
- pernode
- premium
- standalone
- standard
| Type: | String |
| Position: | 3 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
The resource tags for the workspace.
| Type: | Hashtable |
| Position: | 5 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
| Type: | SwitchParameter |
| Aliases: | wi |
| Position: | Named |
| Default value: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Inputs
Nullable<T>[[System.Guid, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]
Nullable<T>[[System.Int32, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]
Outputs
Notes
A new pricing model has been released. If you are a CSP that means that you have to use "standalone" for the sku. Behind the scenes, the sku will be changed to pergb2018. For more information, please see the following: https://docs.microsoft.com/azure/monitoring-and-diagnostics/monitoring-usage-and-estimated-costs#new-pricing-model