< Back

New-AzureRmOperationalInsightsStorageInsight

Thu Apr 04, 2019 5:40 am

NAME New-AzureRmOperationalInsightsStorageInsight



SYNOPSIS

Creates a Storage Insight inside a workspace.





SYNTAX

New-AzureRmOperationalInsightsStorageInsight [-ResourceGroupName] <String> [-WorkspaceName] <String> [-Name] <String> [-StorageAccountResourceId]

<String> [-StorageAccountKey] <String> [[-Tables] <String[]>] [[-Containers] <String[]>] [-DefaultProfile <IAzureContextContainer>] [-Force]

[-Confirm] [-WhatIf] [<CommonParameters>]



New-AzureRmOperationalInsightsStorageInsight [-Workspace] <PSWorkspace> [-Name] <String> [-StorageAccountResourceId] <String> [-StorageAccountKey]

<String> [[-Tables] <String[]>] [[-Containers] <String[]>] [-DefaultProfile <IAzureContextContainer>] [-Force] [-Confirm] [-WhatIf]

[<CommonParameters>]





DESCRIPTION

The New-AzureRmOperationalInsightsStorageInsight cmdlet creates a new Storage Insight in an existing workspace.





PARAMETERS

-Containers <String[]>

Specifies the list of containers that contain the data.



Required? false

Position? 7

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Force [<SwitchParameter>]

Forces the command to run without asking for user confirmation.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

Specifies the name of the Storage Insight.



Required? true

Position? 3

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ResourceGroupName <String>

Specifies the name of an Azure resource group that contains a workspace.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-StorageAccountKey <String>

Specifies the access key for the storage account.



Required? true

Position? 5

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-StorageAccountResourceId <String>

Specifies the Azure resource of a storage account. This can be retrieved by executing the Get-AzureRmStorageAccount cmdlet and accessing the

Id parameter of the result.



Required? true

Position? 4

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Tables <String[]>

Specifies the list of tables that provide the data.



Required? false

Position? 6

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Workspace <PSWorkspace>

Specifies the workspace for the new Storage Insight.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-WorkspaceName <String>

Specifies the name of an existing workspace.



Required? true

Position? 2

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

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



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

PSWorkspace

Parameter 'Workspace' accepts value of type 'PSWorkspace' from the pipeline





OUTPUTS

Microsoft.Azure.Commands.OperationalInsights.Models.PSStorageInsight







NOTES









Example 1: Create a Storage Insight by name



PS C:\\>$Storage = Get-AzureRmStorageAccount -ResourceGroupName "ContosoResourceGroup" -Name "ContosoStorage"



PS C:\\>$StorageKey = ($Storage | Get-AzureRmStorageAccountKey).Key1



PS C:\\>New-AzureRmOperationalInsightsStorageInsight -ResourceGroupName "ContosoResourceGroup" -WorkspaceName "MyWorkspace" -Name

"MyStorageInsight" -StorageAccountResourceId $Storage.Id -StorageAccountKey $StorageKey -Tables @("WADWindowsEventLogsTable")



The first command uses the Get-AzureRmStorageAccount cmdlet to get the storage account named ContosoStorage, and then stores it in the $Storage

variable.



The second command passes the storage account in $Storage to the Get-AzureRmStorageAccountKey cmdlet by using the pipeline operator to get the

specified storage account key, and then stores it in the $StorageKey variable.



The final command creates a storage insight named MyStorageInsight in the workspace named MyWorkspace. This storage insight consumes data from the

WADWindowsEventLogsTable table in the specified storage account resource.





Example 2: Create a Storage Insight by using a workspace object



PS C:\\>$Workspace = Get-AzureRmOperationalInsightsWorkspace -ResourceGroupName "ContosoResourceGroup" -Name "MyWorkspace"



PS C:\\>$Storage = Get-AzureRmStorageAccount -ResourceGroupName "ContosoResourceGroup" -Name "ContosoStorage"



PS C:\\>$StorageKey = ($Storage | Get-AzureRmStorageAccountKey).Key1



PS C:\\>New-AzureRmOperationalInsightsStorageInsight -Workspace $Workspace -Name "MyStorageInsight" -StorageAccountResourceId $Storage.Id

-StorageAccountKey $StorageKey -Tables @("WADWindowsEventLogsTable")



The first command uses the Get-AzureRmOperationalInsightsWorkspace cmdlet to get the workspace named MyWorkspace, and then stores it in the

$Workspace variable.



The second command uses the Get-AzureRmStorageAccount cmdlet to get the specified storage account, and then stores it in the $Storage variable.



The third command passes the storage account in $Storage to the Get-AzureRmStorageAccountKey cmdlet by using the pipeline operator to get the

specified key, and then stores it in the $StorageKey variable.



The final command creates a storage insight named MyStorageInsight in the workspace defined in $Workspace. The Storage Insight consumes data from

the WADWindowsEventLogsTable table in the specified storage account resource.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... ageinsight

Azure Operational Insights Cmdlets

Get-AzureRmOperationalInsightsWorkspace