Skip to content

Commit

Permalink
Fix Az.OperationalInsights Syntax Errors (#17733)
Browse files Browse the repository at this point in the history
* Fix Az.OperationalInsights Syntax Errors

* Fix Az.OperationalInsights Syntax Errors

Co-authored-by: Ziyue Zheng <[email protected]>
  • Loading branch information
v-yuzhichen and ziyuezh576 authored May 7, 2022
1 parent b37a887 commit 78a154c
Show file tree
Hide file tree
Showing 24 changed files with 28 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Get or list clusters, list clusters under resource group when "-ClusterName" was

### Example 1
```powershell
Get-AzOperationalInsightsCluster -ResourceGroupName {rg-name} -ClusterName {cluster-name}
Get-AzOperationalInsightsCluster -ResourceGroupName "rg-name" -ClusterName "cluster-name"
```

```output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Gets a workspace's Data export by name or all existing workspace's data exports.

### Example 1
```powershell
Get-AzOperationalInsightsDataExport -ResourceGroupName {rg-name} -WorkspaceName {workspace-name} -DataExportName {dataExportName}
Get-AzOperationalInsightsDataExport -ResourceGroupName "rg-name" -WorkspaceName "workspace-name" -DataExportName "dataExportName"
```

```output
Expand All @@ -59,7 +59,7 @@ Gets a workspace's Data export.

### Example 2
```powershell
Get-AzOperationalInsightsDataExport -ResourceGroupName {rg-name} -WorkspaceName {workspace-name}
Get-AzOperationalInsightsDataExport -ResourceGroupName "rg-name" -WorkspaceName "workspace-name"
```

Gets all workspace's Data exports.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Get or list linked service for workspace, list when "-LinkedServiceName" was not

### Example 1
```powershell
Get-AzOperationalInsightsLinkedService -ResourceGroupName {rg-name} -WorkspaceName {workspace-name} -LinkedServiceName cluster
Get-AzOperationalInsightsLinkedService -ResourceGroupName "rg-name" -WorkspaceName "workspace-name" -LinkedServiceName cluster
```

```output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Get linked storage account, list all linked storage accounts when "-DataSourceTy

### Example 1
```powershell
Get-AzOperationalInsightsLinkedStorageAccount -ResourceGroupName {rg-name} -WorkspaceName {workspace-name}
Get-AzOperationalInsightsLinkedStorageAccount -ResourceGroupName "rg-name" -WorkspaceName "workspace-name"
```

```output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Get the status of a long running azure asynchronous operation.

### Example 1
```powershell
Get-AzOperationalInsightsOperationStatus -Location {location} -OperationId {op_id}
Get-AzOperationalInsightsOperationStatus -Location "location" -OperationId "op_id"
```

gets a long running azure asynchronous operation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ This command creates an application-insights data source of a given application

### Example 2: Get workspace object and create application-insights data source by the application resource id
```powershell
Get-AzureRmOperationalInsightsWorkspace -Name "MyWorkspace" -ResourceGroupName "ContosoResourceGroup" | New-AzOperationalInsightsApplicationInsightsDataSource -ApplicationResourceId "/subscriptions/e791a474-ee54-46a2-bb06-5e058302d234/resourceGroups/ContosoResourceGroup/providers/microsoft.insights/components/MyAIApplication"
Get-AzOperationalInsightsWorkspace -Name "MyWorkspace" -ResourceGroupName "ContosoResourceGroup" | New-AzOperationalInsightsApplicationInsightsDataSource -ApplicationResourceId "/subscriptions/e791a474-ee54-46a2-bb06-5e058302d234/resourceGroups/ContosoResourceGroup/providers/microsoft.insights/components/MyAIApplication"
```

```output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Create cluster

### Example 1
```powershell
New-AzOperationalInsightsCluster -ResourceGroupName {rg-name} -ClusterName {cluster-name} -Location eastus -IdentityType SystemAssigned -SkuName CapacityReservation -SkuCapacity 1000
New-AzOperationalInsightsCluster -ResourceGroupName "rg-name" -ClusterName "cluster-name" -Location eastus -IdentityType SystemAssigned -SkuName CapacityReservation -SkuCapacity 1000
```

```output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ Creates data export for a workspace.

### Example 1
```powershell
New-AzOperationalInsightsDataExport -ResourceGroupName {rg-name} -WorkspaceName {workspace-name} -DataExportName {dataExportName} -TableNames {table_names} -ResourceId {resource}
New-AzOperationalInsightsDataExport -ResourceGroupName "rg-name" -WorkspaceName "workspace-name" -DataExportName "dataExportName" -TableName "table_name" -ResourceId "resource_id"
```

```output
Name : {dataExportName}
Id : /subscriptions/{subscription}/resourcegroups/{rg-name}/providers/microsoft.operationalinsights/workspaces/{workspace-name}/dataexports/{dataExportName}
DataExportId : {GUID}
TableNames : {table_names}
TableNames : {table_name}
ResourceId : /subscriptions/{subscription}/resourceGroups/{rg-name}/providers/Microsoft.EventHub/namespaces/{eventHub_namespace}
DataExportType : EventHub
EventHubName :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ Create linked storage account for workspace

### Example 1
```powershell
$account = Get-AzStorageAccount -ResourceGroupName {rg-name} -Name {account-name}
$account = Get-AzStorageAccount -ResourceGroupName "rg-name" -Name "storage-account"
New-AzOperationalInsightsLinkedStorageAccount -ResourceGroupName {rg-name} -WorkspaceName {workspace-name} -DataSourceType CustomLogs -StorageAccountIds $account.Id
New-AzOperationalInsightsLinkedStorageAccount -ResourceGroupName "rg-name" -WorkspaceName "workspace-name" -DataSourceType CustomLogs -StorageAccountId $account.Id
```

```output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ foreach ($FacilityName in $FacilityNames) {
-ResourceGroupName $ResourceGroupName `
-WorkspaceName $WorkspaceName `
-Name "Linux-syslog-$($Count)" `
-Facility $FacilityName `
-Facility $FacilityNames `
-CollectEmergency `
-CollectAlert `
-CollectCritical `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The **New-AzOperationalInsightsSavedSearch** cmdlet creates a new saved search w

### Example 1: Create a new saved search
```powershell
New-AzOperationalInsightsSavedSearch -ResourceGroupName "ContosoResourceGroup" -WorkspaceName "ContosoWorkspace" -SavedSearchId "ContosoSavedSearchId" -DisplayName "ContosoSavedSearchDisplayName" -Category "ContosoSavedSearchCategory" -Query "*" -Version $Version -Force
New-AzOperationalInsightsSavedSearch -ResourceGroupName "ContosoResourceGroup" -WorkspaceName "ContosoWorkspace" -SavedSearchId "ContosoSavedSearchId" -DisplayName "ContosoSavedSearchDisplayName" -Category "ContosoSavedSearchCategory" -Query "*" -Version 1 -Force
```

This command creates a new saved search.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ foreach ($EventLogName in $EventLogNames) {
-ResourceGroupName $ResourceGroupName `
-WorkspaceName $WorkspaceName `
-Name "Windows-event-$($Count)" `
-EventLogName $EventLogName `
-EventLogName $EventLogNames `
-CollectErrors `
-CollectWarnings `
-CollectInformation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,6 @@ New-AzOperationalInsightsWorkspace -ResourceGroupName "ContosoResourceGroup" -Na

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
```powershell
$OILinkTargets = Get-AzOperationalInsightsLinkTargets
$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

### -DefaultProfile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ Delete cluster, only apply to clusters with provisioning state "Succeeded"

### Example 1
```powershell
Remove-AzOperationalInsightsCluster -ResourceGroupName {rg-name} -ClusterName {cluster-name}
```

```output
true
Remove-AzOperationalInsightsCluster -ResourceGroupName "rg-name" -ClusterName "cluster-name"
```

Delete cluster
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Deletes a data export for a given worksace

### Example 1
```powershell
Remove-AzOperationalInsightsDataExport -ResourceGroupName {rg-name} -WorkspaceName {workspace-name} -DataExportName {dataExportName}
Remove-AzOperationalInsightsDataExport -ResourceGroupName "rg-name" -WorkspaceName "workspace-name" -DataExportName "dataExportName"
```

removed data export
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ Unlink service for workspace

### Example 1
```powershell
Remove-AzOperationalInsightsLinkedService -ResourceGroupName {rg-name} -WorkspaceName {workspace-name} -LinkedServiceName cluster
```

```output
true
Remove-AzOperationalInsightsLinkedService -ResourceGroupName "rg-name" -WorkspaceName "workspace-name" -LinkedServiceName cluster
```

Unlink linked service for workspace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ Delete linked storage account for workspace

### Example 1
```powershell
Remove-AzOperationalInsightsLinkedStorageAccount -ResourceGroupName {rg-name} -WorkspaceName {workspace-name} -DataSourceType CustomLogs
```

```output
True
Remove-AzOperationalInsightsLinkedStorageAccount -ResourceGroupName "rg-name" -WorkspaceName "workspace-name" -DataSourceType CustomLogs
```

Delete linked storage account with type "CustomLogs" for {workspace-name}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The **Remove-AzOperationalInsightsSavedSearch** cmdlet removes a saved search fr

### Example 1: Remove a saved search
```powershell
Remove-AzOperationalInsightsSavedSearch -ResourceGroupName "ContosoResourceGroup" -WorkspaceName "ContosoWorkspace" -SavedSearchId "ContosoSavedSearchId" -Force
Remove-AzOperationalInsightsSavedSearch -ResourceGroupName "ContosoResourceGroup" -WorkspaceName "ContosoWorkspace" -SavedSearchId "ContosoSavedSearchId"
```

This command removes a saved search from the workspace.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ link service for workspace

### Example 1
```powershell
Set-AzOperationalInsightsLinkedService -ResourceGroupName {rg-name} -WorkspaceName {workspace-name} -LinkedServiceName cluster -WriteAccessResourceId /subscriptions/{subscription}/resourceGroups/{rg-name}/providers/Microsoft.OperationalInsights/clusters/{cluster-name}
Set-AzOperationalInsightsLinkedService -ResourceGroupName "rg-name" -WorkspaceName "workspace-name" -LinkedServiceName cluster -WriteAccessResourceId "/subscriptions/{subscription}/resourceGroups/{rg-name}/providers/Microsoft.OperationalInsights/clusters/{cluster-name}"
```

```output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ Set linked storage account for workspace

### Example 1
```powershell
$account = Get-AzStorageAccount -ResourceGroupName {rg-name} -Name {account-name}
$account = Get-AzStorageAccount -ResourceGroupName "rg-name" -Name "storage-account"
Set-AzOperationalInsightsLinkedStorageAccount -ResourceGroupName {rg-name} -WorkspaceName {workspace-name} -DataSourceType CustomLogs -StorageAccountIds $account.Id
Set-AzOperationalInsightsLinkedStorageAccount -ResourceGroupName "rg-name" -WorkspaceName "workspace-name" -DataSourceType CustomLogs -StorageAccountId $account.Id
```

```output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The **Set-AzOperationalInsightsSavedSearch** cmdlet updates a saved search that

### Example 1: Sets a saved search with updated properties
```powershell
Set-AzOperationalInsightsSavedSearch -ResourceGroupName "ContosoResourceGroup" -WorkspaceName "ContosoWorkspace" -SavedSearchId "ContosoSavedSearchId" -DisplayName "ContosoSavedSearchDisplayName" -Category "ContosoSavedSearchCategory" -Query "Type=Event" -Version $Version -ETag "ContosoSavedSearchEtag"
Set-AzOperationalInsightsSavedSearch -ResourceGroupName "ContosoResourceGroup" -WorkspaceName "ContosoWorkspace" -SavedSearchId "ContosoSavedSearchId" -DisplayName "ContosoSavedSearchDisplayName" -Category "ContosoSavedSearchCategory" -Query "Type=Event" -Version 1 -ETag "ContosoSavedSearchEtag"
```

This command sets a saved search with updated properties.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The **Set-AzOperationalInsightsWorkspace** cmdlet changes the configuration of a

### Example 1: Modify a workspace by name
```powershell
Set-AzOperationalInsightsWorkspace -ResourceGroupName "ContosoResourceGroup" -Name "MyWorkspace" -Sku Standard -Tags @{ "Department" = "IT" }
Set-AzOperationalInsightsWorkspace -ResourceGroupName "ContosoResourceGroup" -Name "MyWorkspace" -Sku Standard -Tag @{ "Department" = "IT" }
```

This command modifies the SKU and tags of the workspace named MyWorkspace in the resource group named ContosoResourceGroup.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ update cluster

### Example 1
```powershell
Update-AzOperationalInsightsCluster -ResourceGroupName azps-test-group -ClusterName yabo-cluster10 -Location eastus -SkuName CapacityReservation -SkuCapacity 1200 -KeyVaultUri {uri} -KeyName {key-name} -KeyVersion {version}
Update-AzOperationalInsightsCluster -ResourceGroupName "rg-name" -ClusterName "cluster-name" -SkuName CapacityReservation -SkuCapacity 1200 -KeyVaultUri "uri" -KeyName "key-name" -KeyVersion "version"
```

```output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ Updates a data export.

### Example 1
```powershell
Update-AzOperationalInsightsDataExport -ResourceGroupName {rg-name} -WorkspaceName {workspace-name} -DataExportName {dataExportName} -TableNames {table_names} -Enable $true
Update-AzOperationalInsightsDataExport -ResourceGroupName "rg-name" -WorkspaceName "workspace-name" -DataExportName "dataExportName" -TableName "table_name" -Enable $true
```

```output
Name : {dataExportName}
Id : /subscriptions/{subscription}/resourcegroups/{rg-name}/providers/microsoft.operationalinsights/workspaces/{workspace-name}/dataexports/{dataExportName}
Type : Microsoft.OperationalInsights/workspaces/export
DataExportId : {GUID}
TableNames : {table_names}
TableNames : {table_name}
ResourceId : /subscriptions/{resource_subscription}/resourceGroups/{resource_rg}/providers/Microsoft.Storage/storageAc
counts/{storage_name}
DataExportType : StorageAccount
Expand Down

0 comments on commit 78a154c

Please sign in to comment.