Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

New-AzOperationalInsightsLinkedStorageAccount

Create linked storage account for workspace

Syntax

Default (Default)

New-AzOperationalInsightsLinkedStorageAccount
 [-ResourceGroupName] <String>
 [-WorkspaceName] <String>
 [-DataSourceType] <String>
 [-StorageAccountId] <String[]>
 [-Force]
 [-DefaultProfile <IAzureContextContainer>]
 [-WhatIf]
 [-Confirm]
 [<CommonParameters>]

Description

Create linked storage account for workspace

Examples

Example 1

$account = Get-AzStorageAccount -ResourceGroupName "rg-name" -Name "storage-account"

New-AzOperationalInsightsLinkedStorageAccount -ResourceGroupName "rg-name" -WorkspaceName "workspace-name" -DataSourceType CustomLogs -StorageAccountId $account.Id
Id : /subscriptions/{subscription}/resourceGroups/{rg-name}/providers/Microsoft.OperationalInsights/workspaces/{workspace-name}/linkedStorageAccounts/CustomLogs
Name : customlogs
Type : Microsoft.OperationalInsights/workspaces/linkedStorageAccounts
DataSourceType : CustomLogs
StorageAccountIds : {/subscriptions/{subscription}/resourceGroups/{rg-name}/providers/Microsoft.Storage/storageAccounts/{storage-account}}

Add linked storage for workspace

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

-DataSourceType

Data Source Type should be one of 'CustomLogs', 'AzureWatson'.

Parameter properties

Type:String
Default value:None
Accepted values:CustomLogs, AzureWatson, Query, Alerts
Supports wildcards:False
DontShow:False

Parameter sets

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

-Force

Don't ask for confirmation.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-ResourceGroupName

The resource group name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-StorageAccountId

list of storage account Id.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-WhatIf

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

-WorkspaceName

The workspace name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

Outputs

PSLinkedStorageAccountsResource


Feedback

Was this page helpful?