Achraf Ben Alaya
No Result
View All Result
  • News
  • Blog
    • blazor
    • c#
    • Cloud
      • Azure
    • docker
    • sql
    • xamarin
    • Tricks, Tips and Fixes
  • Cloud
  • Motivation
  • General Tips & Fix
  • About
SUBSCRIBE
  • News
  • Blog
    • blazor
    • c#
    • Cloud
      • Azure
    • docker
    • sql
    • xamarin
    • Tricks, Tips and Fixes
  • Cloud
  • Motivation
  • General Tips & Fix
  • About
No Result
View All Result
Achraf Ben Alaya
No Result
View All Result
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
0
You forget to shutdown your virtual machine on your way home ? send an email and save your time
0
SHARES
37
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

Microsoft Ignite Cloud Skills Challenge March 2021
Blog

Microsoft Ignite Cloud Skills Challenge March 2021

March 2, 2021
61
Hello Microsoft Graph !
Azure

Hello Microsoft Graph !

February 25, 2021
24
Azure Automation :  How to create PowerShell Runbook
Azure

Azure Automation : How to create PowerShell Runbook

February 4, 2021
26
Welcome to Azure Resource Mover service
Azure

Welcome to Azure Resource Mover service

February 2, 2021
57
Background Tasks With Hangfire And .Net 5
Blog

Background Tasks With Hangfire And .Net 5

January 25, 2021
130
The Differences Between Blazor Server And Blazor  WebAssembly
blazor

The Differences Between Blazor Server And Blazor WebAssembly

January 10, 2021
105
Next Post
Hello Microsoft Graph !

Hello Microsoft Graph !

Leave a Reply Cancel reply

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

Recommended

How to make the most of each day

How to make the most of each day

February 2, 2021
49
Microsoft Teams

What’s new in Microsoft Teams

September 4, 2020
81
Azure Policy for governance

Azure Policy for governance

August 29, 2020
138
Animations with Lottie in Xamarin Forms

Animations with Lottie in Xamarin Forms

April 26, 2020
202
Blazor Write C# instead of JavaScript to Build a Client-Side Single-Page App

Blazor Write C# instead of JavaScript to Build a Client-Side Single-Page App

April 19, 2020
42
Background Tasks With Hangfire And .Net 5

Background Tasks With Hangfire And .Net 5

January 25, 2021
130
Facebook Twitter LinkedIn Youtube
Microsoft Ignite Cloud Skills Challenge March 2021

Microsoft Ignite Cloud Skills Challenge March 2021

March 2, 2021
Hello Microsoft Graph !

Hello Microsoft Graph !

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

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

February 6, 2021

Categories

  • Apps (1)
  • Azure (18)
  • blazor (2)
  • Blog (36)
  • c# (6)
  • Cloud (17)
  • docker (2)
  • Games (1)
  • General Tips & Fix (1)
  • motivation (1)
  • Motivation (3)
  • News (7)
  • sql (3)
  • Tricks, Tips and Fixes (1)
  • xamarin (5)

No Result
View All Result
  • News
  • Blog
    • blazor
    • c#
    • Cloud
      • Azure
    • docker
    • sql
    • xamarin
    • Tricks, Tips and Fixes
  • Cloud
  • Motivation
  • General Tips & Fix
  • About