The first command uses the Get-AzStorageAccount 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-AzStorageAccountKey cmdlet by using the pipeline operator to get the specified storage account key, and then stores it in the $StorageKey variable. This example retrieves the first key. To retrieve the other one, use Value[1] instead of Value[0].
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
The first command uses the Get-AzOperationalInsightsWorkspace cmdlet to get the workspace named MyWorkspace, and then stores it in the $Workspace variable.
The second command uses the Get-AzStorageAccount 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-AzStorageAccountKey cmdlet by using the pipeline operator to get the specified key, and then stores it in the $StorageKey variable. This example retrieves the first key. To retrieve the other one, use Value[1] instead of Value[0].
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.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Specifies the Azure resource of a storage account.
This can be retrieved by executing the Get-AzStorageAccount cmdlet and accessing the Id parameter of the result.
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.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.