Achraf Ben Alaya
No Result
View All Result
  • News
  • Blog
    • blazor
    • c#
    • Cloud
      • Azure
    • docker
    • sql
    • xamarin
    • Dapr
    • Tricks, Tips and Fixes
  • Cloud
  • Motivation
  • General Tips & Fix
  • Exam Preparation
    • AZ-104
    • AZ-400
  • About
    • Resume
SUBSCRIBE
  • News
  • Blog
    • blazor
    • c#
    • Cloud
      • Azure
    • docker
    • sql
    • xamarin
    • Dapr
    • Tricks, Tips and Fixes
  • Cloud
  • Motivation
  • General Tips & Fix
  • Exam Preparation
    • AZ-104
    • AZ-400
  • About
    • Resume
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
322
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

Switch to Azure Container Registry from Docker Hub
Azure

From Docker Hub, switch to Azure Container Registry & AKS

January 16, 2023
132
How to setup nginx reverse proxy && load balancer for aspnet core apps with Docker and azure kubernetes service (AKS)
Azure

How to configure an ingress controller using TLS/SSL for the Azure Kubernetes Service (AKS)

November 25, 2022
229
How to setup nginx reverse proxy && load balancer for aspnet core apps with Docker and azure kubernetes service (AKS)
Azure

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

November 23, 2022
102
How to setup nginx reverse proxy for aspnet core apps with and without  Docker compose
Azure

How to setup nginx reverse proxy for aspnet core apps with and without Docker compose

November 23, 2022
153
Win free certifications at the Microsoft Build Cloud Skills Challenge | May 2022 🎁
Blog

Win free certifications at the Microsoft Build Cloud Skills Challenge | May 2022 🎁

May 28, 2022
107
Generating report for SSL Certificates for Websites with PowerShell
Azure

Generating report for SSL Certificates for Websites with PowerShell

April 10, 2022
386
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

Boxing and Unboxing in C#

Boxing and Unboxing in C#

August 29, 2020
490
DevOps : Deploy infrastructure using Terraform and Azure DevOps pipelines

DevOps : Deploy infrastructure using Terraform and Azure DevOps pipelines

June 2, 2021
3.4k
Why you need to ensure updating your Xamarin.Android Application to Supports 64-Bit Devices and how to do that .

Why you need to ensure updating your Xamarin.Android Application to Supports 64-Bit Devices and how to do that .

April 21, 2020
322
Xamarin.forms,Blazor and Web API

Xamarin.forms,Blazor and Web API

December 3, 2020
927
Going Dapr

Going Dapr

August 17, 2021
228
How to make the most of each day

How to make the most of each day

February 2, 2021
166
Facebook Twitter LinkedIn Youtube
Switch to Azure Container Registry from Docker Hub

From Docker Hub, switch to Azure Container Registry & AKS

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

How to configure an ingress controller using TLS/SSL for the Azure Kubernetes Service (AKS)

November 25, 2022
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

Categories

  • Apps (1)
  • Azure (39)
  • blazor (2)
  • Blog (62)
  • c# (7)
  • Cloud (37)
  • Dapr (4)
  • docker (3)
  • Games (1)
  • General Tips & Fix (1)
  • Motivation (3)
  • motivation (2)
  • News (9)
  • Resume (1)
  • sql (4)
  • Tricks, Tips and Fixes (3)
  • xamarin (5)
No Result
View All Result
  • News
  • Blog
    • blazor
    • c#
    • Cloud
      • Azure
    • docker
    • sql
    • xamarin
    • Dapr
    • Tricks, Tips and Fixes
  • Cloud
  • Motivation
  • General Tips & Fix
  • Exam Preparation
    • AZ-104
    • AZ-400
  • About
    • Resume