PowerShell ile Azure WebApp HTTP Log’larini Log Analytics Workspace Icerisine Gondermek

Bir WebApp uzerinde “AppServiceHTTPLogs” loglarini toplayarak Log Analytics Workspace icerisine gondermek istiyorsunuz. Bunu PowerShell nasil yaparsiniz? Boyle!

Set-AzDiagnosticSetting -ResourceId "/subscriptions/xxxxxxxxxx-xxxxx-xxxx-xxxxxxxx-/resourceGroups/RG1/providers/Microsoft.Web/sites/test7823492"
-Name AppLogs -Category AppServiceHTTPLogs -WorkspaceId "/subscriptions/XXXXXXX-XXXXXX-XXXXX-XXX/resourceGroups/DefaultResourceGroup-WEU/providers/Microsoft.OperationalInsights/workspaces/DefaultWorkspace-26c3cd8b-WEU"
-Enabled $true

Komutu calistirdiktan sonra App uzerindeki Diagnostics Setting bolumunden “AppLog” ismiyle aktive ettigimiz log ayarlarini goruntuleyebilirsiniz. Belirledigimiz Log Analytics Workspace bilgisi de yine portal icerisinde goruntulendi.

Leave a Reply

Your email address will not be published.