met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON...

60
DEVOPS & AUTOMATION Azure Automation fun met ARM Templates & PowerShell mijn DevOps Cloud avonturen Esther Barthel

Transcript of met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON...

Page 1: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION

Azure Automation funmet ARM Templates & PowerShell

mijn DevOps Cloud avonturen

Esther Barthel

Page 2: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION

About Esther▪ 20 years of Technical Consulting

▪ Solutions Architect at cognition IT

▪ Design | Implement | Troubleshooting

▪ Community programs

▪ Citrix Technology Professional (CTP)

▪ Microsoft Most Valuable Professional (MVP)

▪ CUGC Women in Tech Mentorship program leader

▪ DevOps, automation

▪ REST APIs | JSON | PowerShell

@virtues_IT http://nl.linkedin.com/in/ebarthel http://www.virtues.it

Page 3: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

Agenda❑ Azure IaaS

❑ ARM Templates

❑ JSON formatting

❑ Az PowerShell

❑ Azure Automation

❑ Runbooks based on PowerShell

❑ Hybrid Workers

❑ Demo

Page 4: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION

DEVOPS &

AUTOMATION

Azure IaaS

Services & Objects

Page 5: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION Azure IaaS

Page 6: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION Azure IaaS

Page 7: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION Azure IaaS

Page 8: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION

DEVOPS &

AUTOMATION

ARM Templates

JSON & Expressions

Page 9: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION ARM Template

sources: https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-authoring-templates

https://docs.microsoft.com/en-us/azure/templates/ (Reference Guide!)

… structure of an Azure Resource Manager template.

The template consists of JSON and expressions that you can

use to construct values for your deployment.

Page 10: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION JavaScript Object Notation (JSON)

Syntax rules

■data is in name/value pairs

Page 11: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION JavaScript Object Notation (JSON)

Syntax rules

■data is separated by commas

Page 12: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION JavaScript Object Notation (JSON)

Syntax rules

■curly braces {} hold objects

Page 13: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION JavaScript Object Notation (JSON)

Syntax rules

■square brackets [] hold arrays

Page 14: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION JavaScript Object Notation (JSON)

Page 15: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION ARM Template

sources: https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-authoring-templates

https://docs.microsoft.com/en-us/azure/templates/ (Reference Guide!)

Page 16: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION ARM Template

Page 17: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION ARM Template

sources: https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-quickstart-create-templates-use-the-portal

Page 18: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION ARM Template

Page 19: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION ARM Template

Page 20: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION ARM Template

Page 21: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION ARM Template

Page 22: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION ARM Template

Page 23: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION ARM Template

Page 24: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION ARM Template

Page 25: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION ARM Template

Page 26: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION ARM Template

Page 27: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION ARM Template

Page 28: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION ARM Template

Page 29: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION

DEVOPS &

AUTOMATION

Az

Azure PowerShell Module

Page 30: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION Az

sources: https://docs.microsoft.com/en-us/powershell/azure/install-az-ps?view=azps-2.2.0

Page 31: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION Az

sources: https://docs.microsoft.com/en-us/powershell/azure/install-az-ps?view=azps-2.2.0

prefix the Install-Module cmdlet with PowerShellGet to prevent errors

Page 32: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION Az

Page 33: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION Az

sources: https://docs.microsoft.com/en-us/powershell/module/az.resources/?view=azps-2.2.0#resources

Page 34: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION Az – PowerShell

Plan to manage your app or service with Azure PowerShell?

Run your script with an AAD Service Principal, rather than your own credentials.

Page 35: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION Az – Service Principal

step 1: https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal

Page 36: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION Az – AppID, AppKey & TenantID

step 2: https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal

Page 37: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION Az

Page 38: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION Az

Page 39: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION Az

Page 40: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION

DEVOPS &

AUTOMATION

Azure Automation

Runbooks & Hybrid Workers

Page 41: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION Azure Automation

Page 42: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION Azure Automation

Page 43: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION Hybrid Worker

sources: https://docs.microsoft.com/en-us/azure/automation/automation-hybrid-runbook-worker

https://docs.microsoft.com/en-us/azure/automation/automation-windows-hrw-install

Page 44: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION PowerShell in Action

Page 45: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION

Page 46: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION Virtual Machine

Page 47: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION Virtual Machine

Page 48: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION Resources

Page 49: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION

DEVOPS &

AUTOMATION

The Scripts

Where to go next?

Page 50: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION GitHubCheck out the scripts and get started after the presentation

Sharing the Azure Automation fun and demo scripts with the

Community:

https://github.com/cognitionIT/AzureAutomation

Page 51: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION

Presented by:

Esther Barthel Solutions Architect

@virtuEs_IT

http://nl.linkedin.com/in/ebarthel

http://www.virtues.it

Page 52: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION

DEVOPS &

AUTOMATION

Bonus Scripts

Automatic Deployments

Page 53: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION Bonus: Automatically start a Runbook

Page 54: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION Bonus: Automatically start a Runbook

Page 55: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION PowerShell in Action

Page 56: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION PowerShell in Action

ARM Templates > Azure Automation > Bonus

Page 57: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION

DEVOPS &

AUTOMATION

The Links

Resources

Page 58: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION ResourcesMicrosoft Azure:

■ https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal

■ https://docs.microsoft.com/en-us/powershell/azure/create-azure-service-principal-azureps?view=azurermps-6.9.0

■ https://docs.microsoft.com/en-us/powershell/azure/overview?view=azurermps-6.9.0

■ https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-authoring-templates

GitHub:■ https://github.com/cognitionIT

■ https://github.com/cognitionIT/AzureAutomation

■ https://github.com/Azure/azure-quickstart-templates

Page 59: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION

Next session: 11:30 – 12:30

Overleven in de jungle van

DevOps tools

Joran Markx

Page 60: met ARM Templates & PowerShell - Experts Live Netherlands · Agenda Azure IaaS ARM Templates JSON formatting Az PowerShell Azure Automation Runbooks based on PowerShell Hybrid Workers

DEVOPS &

AUTOMATION

Please review my session in the

Yellenge App!

Thank You!

Feedback