Achraf Ben Alaya
No Result
View All Result
  • Home
  • News
  • Blog
    • blazor
    • c#
    • Cloud
      • Azure
    • docker
    • sql
    • xamarin
    • Dapr
    • Tricks, Tips and Fixes
    • General Tips & Fix
  • AI
  • Cloud
  • Motivation
  • Courses
  • About
    • Resume
    • Privacy Policy
SUBSCRIBE
  • Home
  • News
  • Blog
    • blazor
    • c#
    • Cloud
      • Azure
    • docker
    • sql
    • xamarin
    • Dapr
    • Tricks, Tips and Fixes
    • General Tips & Fix
  • AI
  • Cloud
  • Motivation
  • Courses
  • About
    • Resume
    • Privacy Policy
No Result
View All Result
Achraf Ben Alaya
No Result
View All Result
ADVERTISEMENT
Home Blog

You forget to shutdown your virtual machine on your way home ? send an email and save your time

achraf by achraf
February 6, 2021
in Blog, Cloud
4 min read
0
You forget to shutdown your virtual machine on your way home ? send an email and save your time
0
SHARES
532
VIEWS
Share on FacebookShare on Twitter

Introduction

You forgot to shutdown a virtual machine on your way home or to a date ?

don’t freak out ! there are many ways to save this moment when your heart is about to stop .

One of the ways is to install the Microsoft Azure application and follow with it .


Link for the application on  play store :  link

Link for the application on app store : Link 

Now we are going to see another solution ,which is sending an email .
In this demo we are going to use Logic app service  .

Azure Logic Apps :

Azure Logic Apps is a cloud service that helps you schedule, automate, and orchestrate tasks, business processes, and workflows when you need to integrate apps, data, systems, and services across enterprises or organizations. Logic Apps simplifies how you design and build scalable solutions for app integration, data integration, system integration, enterprise application integration (EAI), and business-to-business (B2B) communication, whether in the cloud, on premises, or both.

For example, here are just a few workloads you can automate with logic apps:

  • Process and route orders across on-premises systems and cloud services.
  • Send email notifications with Office 365 when events happen in various systems, apps, and services.
  • Move uploaded files from an SFTP or FTP server to Azure Storage.
  • Monitor tweets for a specific subject, analyze the sentiment, and create alerts or tasks for items that need review.

How do logic apps work?

Every logic app workflow starts with a trigger, which fires when a specific event happens, or when new available data meets specific criteria. Many triggers provided by the connectors in Logic Apps include basic scheduling capabilities so that you can set up how regularly your workloads run. For more complex scheduling or advanced recurrences, you can use a Recurrence trigger as the first step in any workflow. Learn more about schedule-based workflows.

Each time that the trigger fires, the Logic Apps engine creates a logic app instance that runs the actions in the workflow. These actions can also include data conversions and workflow controls, such as conditional statements, switch statements, loops, and branching. For example, this logic app starts with a Dynamics 365 trigger with the built-in criteria “When a record is updated”. If the trigger detects an event that matches this criteria, the trigger fires and runs the workflow’s actions. Here, these actions include XML transformation, data updates, decision branching, and email notifications.

With businesses moving toward digitization, logic apps help you connect legacy, modern, and cutting-edge systems more easily and quickly by providing prebuilt APIs as Microsoft-managed connectors. That way, you can focus on your apps’ business logic and functionality. You don’t have to worry about building, hosting, scaling, managing, maintaining, and monitoring your apps. Logic Apps handles these concerns for you. Plus, you pay only for what you use based on a consumption pricing model.

Let’s Do It (DEMO)

First of all , let’s create a simple logic app by following the follow instructions below :

Now , what’s the action that will do our job here ? (the job is to start or to stop a virtual machine that you may forget to stop while you were going home to see your family because you miss them after a long dat at work ).

Ps : To learn The Proper way To Shutdown Azure VM and the difference between stopped and Deallocated you can read from this LINK

Now this action we talked about is called a “Trigger ” to cause (something) to start or happen that is a trigger , in our case a trigger is : receiving an email .

First of all we are going to choose the trigger action which is “when a new email arrives(v3)” and we are going

to make a couple of parameters :

– the folder ,in our case the inbox
– From : here you can choose your own email or another email ,like a collogue or anyone who can do this to the machine
and keep other parameters as they are.

Switch

here we are choosing the subject , which is the subject of the email that is going to be received.

We have 2 cases , one to turn ON the machine and one to Stopped (deallocated) (you can add more like for restart , stop….)

 

In the first case I put “turnoff01” as a subject , later you need to choose your subscription
the resource group that contain the virtual machine and the virtual machine too .

In the second case I put “turnon01” as a subject and it start the machine

As you can see in the Overview , we can see sending the email have triggered the logic app , and in my case the
call to stop and to start the machine was done successfully

ShareTweet
Previous Post

Azure Automation : How to create PowerShell Runbook

Next Post

Hello Microsoft Graph !

Related Posts

AI

Model Context Protocol (MCP): The Future of AI Integration

April 21, 2025
110
Azure

Step-by-Step Guide: Azure Front Door + Storage Account Static Website + Custom Domain with Terraform

March 11, 2025
232
Network Security & Route Tables – Checking NSGs, route tables, and service endpoints for a targeted VNET or Subnet
Azure

Network Security & Route Tables – Checking NSGs, route tables, and service endpoints for a targeted VNET or Subnet

February 3, 2025
137
Understanding Generative AI and RAG Benefits
AI

Understanding Generative AI and RAG Benefits

January 12, 2025
96
Azure Communication Services Email Sending Simplified: From Setup to Execution and Monitoring
Azure

Azure Communication Services Email Sending Simplified: From Setup to Execution and Monitoring

December 8, 2024
1.6k
PowerShell Automation for Azure Networks: Detailed VNET and Subnet Analysis
Azure

PowerShell Automation for Azure Networks: Detailed VNET and Subnet Analysis

November 2, 2024
502
Next Post
Hello Microsoft Graph !

Hello Microsoft Graph !

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Terraform

Certifications

Microsoft certified trainer (MCT)

Recommended

How to setup nginx reverse proxy && load balancer for aspnet core apps with Docker and azure kubernetes service (AKS)

How to setup nginx reverse proxy && load balancer for aspnet core apps with Docker and azure kubernetes service (AKS)

November 23, 2022
871
Create a Linux VM with infrastructure in Azure using Terraform

Create a Linux VM with infrastructure in Azure using Terraform

August 30, 2020
2.3k
Configure postman / newman API tests in Azure DevOps

Configure postman / newman API tests in Azure DevOps

October 25, 2021
3.5k
Part 5-A : Using Azure DevOps, Automate Your CI/CD Pipeline and Your Deployments

Part 5-C : Using Azure DevOps, Automate Your CI/CD Pipeline and Your Deployments

May 2, 2023
647
Swagger & OpenAPI and Versioning for ASP.NET Core

Swagger & OpenAPI and Versioning for ASP.NET Core

December 8, 2020
1.5k
Azure Elastic Job Tutorial: Automate Your SQL Jobs Efficiently

Azure Elastic Job Tutorial: Automate Your SQL Jobs Efficiently

June 23, 2024
135
Facebook Twitter LinkedIn Youtube

Model Context Protocol (MCP): The Future of AI Integration

April 21, 2025

Step-by-Step Guide: Azure Front Door + Storage Account Static Website + Custom Domain with Terraform

March 11, 2025
Network Security & Route Tables – Checking NSGs, route tables, and service endpoints for a targeted VNET or Subnet

Network Security & Route Tables – Checking NSGs, route tables, and service endpoints for a targeted VNET or Subnet

February 3, 2025

Categories

  • AI (2)
  • Apps (1)
  • Azure (63)
  • blazor (2)
  • Blog (91)
  • c# (7)
  • Cloud (65)
  • Courses (3)
  • Dapr (4)
  • docker (4)
  • Games (1)
  • General Tips & Fix (1)
  • Home (1)
  • Kubernetes Service (AKS) (1)
  • motivation (2)
  • Motivation (3)
  • News (9)
  • Resume (1)
  • sql (4)
  • Terrafrom (1)
  • Tricks, Tips and Fixes (4)
  • xamarin (5)
No Result
View All Result
  • Home
  • News
  • Blog
    • blazor
    • c#
    • Cloud
      • Azure
    • docker
    • sql
    • xamarin
    • Dapr
    • Tricks, Tips and Fixes
    • General Tips & Fix
  • AI
  • Cloud
  • Motivation
  • Courses
  • About
    • Resume
    • Privacy Policy

ADVERTISEMENT