你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
New-AzureRmOperationalInsightsStorageInsight
在工作区中创建存储 Insight。
警告
截至 2024 年 2 月 29 日,AzureRM PowerShell 模块已正式弃用。 为了确保持续获得支持和更新,建议用户从 AzureRM 迁移到 Az PowerShell 模块。
尽管 AzureRM 模块仍可能正常运行,但它不再维护或受支持,但会根据用户的自由裁量权和风险继续使用任何继续使用模块。 有关过渡到 Az 模块的指导,请参阅我们的迁移资源。
语法
New-AzureRmOperationalInsightsStorageInsight
[-ResourceGroupName] <String>
[-WorkspaceName] <String>
[-Name] <String>
[-StorageAccountResourceId] <String>
[-StorageAccountKey] <String>
[[-Tables] <String[]>]
[[-Containers] <String[]>]
[-Force]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzureRmOperationalInsightsStorageInsight
[-Workspace] <PSWorkspace>
[-Name] <String>
[-StorageAccountResourceId] <String>
[-StorageAccountKey] <String>
[[-Tables] <String[]>]
[[-Containers] <String[]>]
[-Force]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
New-AzureRmOperationalInsights存储Insight cmdlet 在现有工作区中创建新的 存储 Insight。
示例
示例 1:按名称创建 存储 Insight
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")
第一个命令使用 Get-AzureRm存储Account cmdlet 获取名为 Contoso存储 的存储帐户,然后将其存储在 $存储 变量中。 第二个命令将 $存储 中的存储帐户传递给 Get-AzureRm存储AccountKey cmdlet,方法是使用管道运算符获取指定的存储帐户密钥,然后将其存储在 $存储Key 变量中。 最后一个命令在名为 MyWorkspace 的工作区中创建名为 My存储Insight 的存储见解。 此存储见解使用指定存储帐户资源中 WADWindowsEventLogsTable 表中的数据。
示例 2:使用工作区对象创建 存储 Insight
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")
第一个命令使用 Get-AzureRmOperationalInsightsWorkspace cmdlet 获取名为 MyWorkspace 的工作区,然后将其存储在$Workspace变量中。 第二个命令使用 Get-AzureRm存储Account cmdlet 获取指定的存储帐户,然后将其存储在 $存储 变量中。 第三个命令使用管道运算符获取指定密钥,将 $存储 中的存储帐户传递到 Get-AzureRm存储AccountKey cmdlet,然后将其存储在 $存储Key 变量中。 最后一个命令在$Workspace中定义的工作区中创建名为 My存储Insight 的存储见解。 存储 Insight 使用指定存储帐户资源中 WADWindowsEventLogsTable 表中的数据。
参数
-Confirm
提示你在运行 cmdlet 之前进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | False |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Containers
指定包含数据的容器列表。
类型: | String[] |
Position: | 7 |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-DefaultProfile
用于与 azure 通信的凭据、帐户、租户和订阅
类型: | IAzureContextContainer |
别名: | AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Force
强制运行命令而不要求用户确认。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Name
指定 存储 Insight 的名称。
类型: | String |
Position: | 3 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-ResourceGroupName
指定包含工作区的 Azure 资源组的名称。
类型: | String |
Position: | 1 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-StorageAccountKey
指定存储帐户的访问密钥。
类型: | String |
Position: | 5 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-StorageAccountResourceId
指定存储帐户的 Azure 资源。 这可以通过执行 Get-AzureRm存储Account cmdlet 并访问结果的 ID 参数来检索。
类型: | String |
Position: | 4 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Tables
指定提供数据的表的列表。
类型: | String[] |
Position: | 6 |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-WhatIf
显示运行该 cmdlet 时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | False |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Workspace
指定新 存储 Insight 的工作区。
类型: | PSWorkspace |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-WorkspaceName
指定现有工作区的名称。
类型: | String |
Position: | 2 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
输入
参数:工作区(ByValue)
String[]