Skip to content

Commit 88cc3c2

Browse files
authored
Migration via powershell supported now
Need to update this article with the details that we do now support migrating classic components to workspace-based component via the powershell cmdlet. Here is the 8.0.0 release where we first started supporting this in that cmdlet - https://github.com/Azure/azure-powershell/blob/v8.0.0-May2022/src/ApplicationInsights/exports/Update-AzApplicationInsights.ps1
1 parent eebf14f commit 88cc3c2

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

articles/azure-monitor/app/convert-classic-resource.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,19 @@ For the full Azure CLI documentation for this command, see the [Azure CLI docume
157157

158158
### Azure PowerShell
159159

160-
The `Update-AzApplicationInsights` PowerShell command doesn't currently support migrating a classic Application Insights resource to workspace based. To create a workspace-based resource with PowerShell, use the following Azure Resource Manager templates and deploy them with PowerShell.
160+
Starting with version 8.0 or higher of [Azure PowerShell](https://learn.microsoft.com/powershell/azure/what-is-azure-powershell), you can use the `Update-AzApplicationInsights` PowerShell command to migrate a classic Application Insights resource to workspace based.
161+
162+
To use this cmdlet, you need to specify the name and resource group of the Application Insights resource that you want to update. Use the `IngestionMode` and `WorkspaceResoruceId` parameters to migrate your classic instance to workspace-based. For more information on the parameters and syntax of this cmdlet, see [Update-AzApplicationInsights](https://learn.microsoft.com/powershell/module/az.applicationinsights/update-azapplicationinsights).
163+
164+
#### Example
165+
166+
```powershell
167+
# Get the resource ID of the Log Analytics workspace
168+
$workspaceResourceId = (Get-AzOperationalInsightsWorkspace -ResourceGroupName "rgName" -Name "laName").ResourceId
169+
170+
# Update the Application Insights resource with the workspace parameter
171+
Update-AzApplicationInsights -Name "aiName" -ResourceGroupName "rgName" -IngestionMode LogAnalytics -WorkspaceResourceId $workspaceResourceId
172+
```
161173

162174
### Azure Resource Manager templates
163175

0 commit comments

Comments
 (0)