Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Add application-insights debug cli #281

Merged
merged 10 commits into from
Nov 11, 2020

Conversation

bmc-msft
Copy link
Contributor

@bmc-msft bmc-msft commented Nov 10, 2020

Quite frequently, I find myself needing to perform queries against an instance's application insights log. Rather than continually going into the portal, this exposes the query API via the CLI.

TODO:

  • Add recording the instance specific appId for application insights to the ARM template for the Azure Function
  • Add said appId to the onefuzz info get
  • Update the debug code to use said "appId" from info.get() instead of os.environ['APP_ID']

@bmc-msft bmc-msft marked this pull request as ready for review November 10, 2020 20:13
@bmc-msft
Copy link
Contributor Author

The following example use searches for the keyword "scaleset". Then using jmespath, prints the first message.

❯ onefuzz --endpoint https://pr-check-e250f3223ada4b2fb84a807c33063dfb.azurewebsites.net debug logs keyword scaleset --query 'PrimaryResult[0].message'
"Executed 'Functions.scaleset' (Succeeded, Id=bc1cb88e-9508-4e1f-b4b9-15d18ded3439, Duration=23ms)"
❯

src/cli/onefuzz/debug.py Show resolved Hide resolved
src/cli/onefuzz/debug.py Show resolved Hide resolved
@bmc-msft bmc-msft merged commit e638908 into microsoft:main Nov 11, 2020
@bmc-msft bmc-msft deleted the add-app-insight-debug-cli branch November 11, 2020 11:17
@ghost ghost locked as resolved and limited conversation to collaborators Apr 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants