How can I trigger Defender for cloud sample alerts through Azure CLI or with Logic apps , NO GUI .

PrasadN 20 Reputation points
2024-07-11T19:30:00.3633333+00:00

I'm trying to set the sample alerts for defender for cloud , I know it's easy with GUI.

Just to click the sample alerts and select the sub and resources.

But i wanted to do that hands-off , for every 8 hours what're my options ..i want only Defender for cloud sample alerts as it is ..any work around? any inputs are appreciated.

Microsoft Defender for Cloud
Microsoft Defender for Cloud
An Azure service that provides threat protection for workloads running in Azure, on-premises, and in other clouds. Previously known as Azure Security Center and Azure Defender.
1,421 questions
{count} votes

Accepted answer
  1. Sandeep G-MSFT 19,761 Reputation points Microsoft Employee
    2024-07-15T07:21:43.07+00:00

    @PrasadN

    Thank you for posting this in Microsoft Q&A.

    There are some CLI commands that are used for security alerts. However, there is no specific command for creating security alert as per below article,

    https://learn.microsoft.com/en-us/cli/azure/security/alert?view=azure-cli-latest#commands

    But you can try this through logic apps,

    1. Open the Azure portal and create a new Logic App.
    2. Add a new trigger to the Logic App by selecting the "When a HTTP request is received" trigger.
    3. Add a new action to the Logic App by selecting the "Create an alert" action.
    4. Configure the "Create an alert" action to create a sample alert with the specified details.
    5. Save and run the Logic App.

    This will trigger a sample alert in Defender for Cloud.

    Let me know if you have any further questions.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

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