Azure Automation and Logic Apps:

Slides:



Advertisements
Similar presentations
Lower costs and improve predictability Automation Enable service owners to focus on work that adds business value Reduce error-prone manual activities.
Advertisements

Yet another Service Management Automation Session
Lower costs and improve predictability Automation Enable service owners to focus on work that adds business value Reduce error-prone manual activities.
Integrate into existing systems with PowerShell integration modules Extend by building PS modules to enable integrating into other systems Optimize.
CMDB Ticketing Billing Management Systems Web based Runbook Authoring: Service Administrator can create runbooks to automate all aspects of cloud.
WMU GNL Automation How to make my IT life easier CHRISTOPHER KEYAERT CONSULTANT AT INOVATIV CLOUD AND DATACENTER MANAGEMENT MVP.
System Center 2012 R2 Windows Azure Pack Service Management Automation 101.
Automate Microsoft Azure Ross Sponholtz Mark Ghazai.
DCIM325. PREVIEW workflow Write-HelloWorld { param ( # Optional parameter of type string. # The default value of Name will be World [parameter(Mandatory=$false)]
Learningcomputer.com SQL Server 2008 – Administration, Maintenance and Job Automation.
IT 456 Seminar 5 Dr Jeffrey A Robinson. Overview of Course Week 1 – Introduction Week 2 – Installation of SQL and management Tools Week 3 - Creating and.
4/24/2017 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
Automated Deployment Framework Using TFS and Custom PowerShell cmdlets to create an automated deployment framework.
Automating Operational and Management Tasks in Microsoft Operations Management Suite and Azure
Mirek Sztajno SQL Server Security PM
Module 1 Introduction to SQL Server® 2008 R2 and its Toolset.
Azure Automation Tao Yang & Pete Zerger ARC311 Microsoft Ignite 2015
DATABASE DEVELOPMENT WITH VISUAL STUDIO 2010 Chris Dahlberg 1.
Microsoft Public Cloud Services Automation Excellence Marcel Zehner | Cloud Believer Innovation itnetX
Andy Roberts Data Architect
Copyright © New Signature Who we are: Focused on consistently delivering great customer experiences. What we do: We help you transform your business.
From Zero to Automation HeroFrom Zero to Automation Hero A MNSCug production Steve Jesok Ameriprise – Senior Systems Engineer Ryan Andorfer.
AZ PASS User Group Azure Data Factory Overview Josh Sivey, Solution Partner October
Long Live Azure Automation!Long Live Azure Automation! Cloud-first Configuration Management and Automation Beth Cooper Program Manager.
Putting Your Head in the Cloud Working with SQL Azure David Postlethwaite 18/06/2016David Postlethwaite.
Introduction Service Management Automation
Connecting Power BI to On-Premise Dynamics CRM/GP Data
Backups for Azure SQL Databases and SQL Server instances running on Azure Virtual Machines Session on backup to Azure feature (manual and managed) in SQL.
Building AD-SQL-APP Server on AZURE
Working with Logic App Cloud Adapters, Functions, and Storage
Stress Free Deployments with Octopus Deploy
Data Platform and Analytics Foundational Training
Azure Management and Security
Achieve more in less time using the new SQL PowerShell
Configure and Manage Your Hybrid Cloud Environment at Scale
Azure Functions and Automation: The SQL Agent in the Cloud
Example of a page header
Microsoft Ignite /17/ :54 PM BRK2092
Basic Work-Flow with SQL Server Standard
Deploying and Configuring SSIS Packages
Configuration Management with Azure Automation DSC
Azure Primed Randy Pagels Sr. Developer Technology Specialist
The New Breed: OMS, Flow, and Power BI Integration
Solving ETL Bottlenecks with SSIS Scale Out
From SSAS to Azure Analysis Services - Lessons learned
Microsoft IT process automation – an unexpected journey
Server Management and Automation Windows Server 2012 R2
Dev Test on Windows Azure Solution in a Box
Microsoft Ignite NZ October 2016 SKYCITY, Auckland.
Building ETL/ELT Workloads with Azure Data Factory V2
Azure Data Factory + SSIS: Migrating your ETLs to the Cloud
SharePoint Online Hybrid – Configure Outbound Search
SSIS in the Cloud Integration Runtime in Azure Data Factory V2
Cloud Data Replication with SQL Data Sync
Azure Data Factory + SSIS: Migrating your ETLs to the Cloud
Technical Capabilities
Azure Data Factory + SSIS: Migrating your ETLs to the Cloud
Power BI with Analysis Services
Getting Hands-On with Azure Logic Apps
Microsoft Virtual Academy
Service Template Creation from the Ground Up
Service Template Creation from the Ground Up
Azure Data Factory + SSIS: Migrating your ETLs to the Cloud
Michelle Haarhues Keeping up with SSMS.
TN19-TCI: Integration and API management using TIBCO Cloud™ Integration
Building Windows Store Apps with Windows Azure Mobile Services
Automation in a hybrid world
Discovering the full power of parameters in Power BI
ZORAN BARAC DATA ARCHITECT at CIN7
SQL Server on Containers
Presentation transcript:

Azure Automation and Logic Apps: Your SQL Agent in the cloud

Azure Automation and Logic Apps Your SQL Agent in the cloud Intelligent Cloud Conference 30/5-2018 Christian Winther Kristensen Consulting Manager & Principal Architect, Kapacity cwk@kapacity.dk

Event Sponsors Expo Sponsors Expo Light Sponsors

Azure Logic Apps How many have used it?

What is Azure Logic Apps? Automate business processes in the cloud and on-prem Systems integration MS Flow for developers in Azure Can be triggered by events or schedules Has many connectors (200+), e.g. SQL Server, Sharepoint and e-mail

Why Logic Apps as orchestrator? Simple and user-friendly GUI Low cost SSIS in Azure is too expensive + not using SSIS for data transform No VM with SQL Server No Azure SQL DB Managed Instance with SQL Agent Needs other event triggers than date & time You do not want to make everything in runbooks (PowerShell) and/or ADF Start jobs and pipelines from Logic Apps

A lot of template flows

Hybrid scenarios? Use on-prem data gateway and supported connectors https://docs.microsoft.com/en- us/azure/logic-apps/logic-apps- gateway-connection

Logic Apps Demo!

Lessons learned… Biggest limitation is that actions as a general rule has a 2 minute duration before timeout Possible solution: Use PowerShell runbook instead - invoked from Logic Apps ”Automation create job” action

Trigger by event Also can be triggered by a change in a SQL table New row Changed column value Hint: you can use a stored procedure to change a value  trigger a Logic App flow

Trigger by SQL Stored Procedure example CREATE TABLE [etl].[LogicApp]( [RV] [timestamp] NOT NULL, [DWModifiedDate] [datetime] NOT NULL ) ON [PRIMARY] GO CREATE PROCEDURE [etl].[Trigger_LogicAppETLflow] AS BEGIN SET NOCOUNT ON UPDATE [etl].[LogicApp] SET [DWModifiedDate] = GETDATE() END

Azure Automation Who uses azure automation?

Azure Automation delivers a cloud-based automation and configuration service that provides consistent management across your Azure and non-Azure environments. consists of process automation, update management, and configuration features. provides complete control during deployment, operations, and decommissioning of workloads and resources.

Main Features Process Automation  Runbooks PowerShell / PowerShell Workflow Graphical – PowerShell/Workflow Declarative Automation  PowerShell DSC (Desired State Configuration) Use Automation as a pull server Central location to view the state of all of your managed nodes Secure global asset store Certificates Credentials Variables Connections Modules Schedules Run on hybrid or in Azure

PowerShell Runbooks PowerShell runbooks are based on Windows PowerShell. You directly edit the code of the runbook using the text editor in the Azure portal. You can also use any offline text editor and import the runbook into Azure Automation.

PowerShell Runbooks vs. Workflows Advantages Implement all complex logic with PowerShell code without the additional complexities of PowerShell Workflow. Runbook starts faster than PowerShell Workflow runbooks since it doesn't need to be compiled before running. Limitations Must be familiar with PowerShell scripting. Can't use parallel processing to perform multiple actions in parallel. Can't use checkpoints to resume runbook in case of error. PowerShell Workflow runbooks and Graphical runbooks can only be included as child runbooks by using the Start-AzureAutomationRunbook cmdlet which creates a new job. 3 hour time limit for a runbook – long running workflows will restart at latest checkpoint

PowerShell for scaling SQL DB param( [parameter(Mandatory=$False)] [string] $SqlServer = "kapacity-cwk.database.windows.net", [int] $SqlServerPort = 1433, [string] $Database = "master", [string] $SqlCredentialAsset = "cwk" ) $SqlCredential = Get-AutomationPSCredential -Name $SqlCredentialAsset if ($SqlCredential -eq $null) { throw "Could not retrieve '$SqlCredentialAsset' credential asset. Check that you created this first in the Automation service." } # Get the username and password from the SQL Credential $SqlUsername = $SqlCredential.UserName $SqlPass = $SqlCredential.GetNetworkCredential().Password # Define the connection to the SQL Database $Conn = New-Object System.Data.SqlClient.SqlConnection("Server=tcp:$SqlServer,$SqlServerPort;Database=$Database;User ID=$SqlUsername;Password=$SqlPass;Trusted_Connection=False;Encrypt=True;Connection Timeout=30;") # Open the SQL connection $Conn.Open() # Define the SQL command to run. $Cmd=new-object system.Data.SqlClient.SqlCommand $Cmd.Connection = $Conn $Cmd.CommandText = "ALTER DATABASE [AdventureWorks] MODIFY (SERVICE_OBJECTIVE = 'S0') WAITFOR DELAY '00:02' " $Cmd.CommandTimeout=1200 # Execute the SQL command $Cmd.ExecuteNonQuery() # Close the SQL connection $Conn.Close()

Create Runbook Demo!

Automation Jobs A job is a run of a Runbook Jobs can be invoked from a schedule (or called from Logic Apps automation action)

Schedule Runbook

Processing Azure Analysis Services Install SQL Server powershell module

Processing Azure Analysis Services Remember to create a Azure AD service account user with admin access to AAS. # Providing the Server Details $ServerName = "asazure://northeurope.asazure.windows.net/cwkaasdemo" $DatabaseName = "awlt" #Getting the credential which we stored earlier. $AzureCred = Get-AutomationPSCredential -Name "svc_bi_automation" Add-AzureRmAccount -Credential $AzureCred | Out-Null #Full Processing the DB Invoke-ProcessASDatabase -databasename $DatabaseName -server $ServerName -RefreshType "Full" -Credential $AzureCred

Create Job Demo!

Combining Logic Apps with Azure Automation

Azure Automation actions Azure Automation connector and 3 actions (preview) Use the Create job action

Azure Automation Create job action Fill out subscription info, runbook name Wait for job = Yes This action can run for longer than 2 minutes – depending on runbook code timeout settings Eventual runbook parameters

Logic Apps calling Runbook Demo!

Logic apps run

More questions ? https://docs.microsoft.com/en-us/azure/logic-apps/ https://docs.microsoft.com/en-us/azure/automation/automation- intro https://docs.microsoft.com/en-us/azure/automation/automation- runbook-types