Share via

Logging Azure CLI commands

Andrew Ryan 1 Reputation point
2022-07-20T11:33:53.493+00:00

Hello,

Is there anyway to log or view logs for Azure CLI commands that have been executed. For example if I use the CLI while in the portal and execute some commands is there somewhere that information is logged.

If not can CLI command logging be enabled somewhere?

Thanks.

Andrew

Microsoft Security | Microsoft Sentinel
0 comments No comments

1 answer

Sort by: Most helpful
  1. David Broggy 6,801 Reputation points MVP
    2022-07-23T04:20:33.73+00:00

    Hi Andrew,
    The AZ commands and Azure CLI are interpreters for the actual Azure resource calls.
    As such what gets logged isn’t the actual command but the interpretation of such that performs the actual function in Azure.
    So when you use the Azure CLI to make a change in Azure, that change should be logged and received by Sentinel using the Azure log data connector.
    I’m not aware of anything that will provide you key logger level logging for the Azure cli.
    Hope that helps.

    Was this answer helpful?

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.