Skip to content

Commit 2f7118f

Browse files
Merge pull request #246144 from toddfoust/patch-25
Migration via powershell supported now
2 parents de5deb4 + 88cc3c2 commit 2f7118f

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)