Presented at NetPonto Porto 09/September/2017, by José Maia, at Farfetch.
A talk about how to use Azure Resource Manager to follow good DevOps practices.
1. Azure Templates for Consistent
Deployment
José Maia, Software Engineer @ NumbersBelieve
2. Who am I
• José Maia.
• Software engineer developing the
OMNIA platform at
NumbersBelieve, a company of the
PRIMAVERA BSS family.
• Responsibilities are in the devops
and open source areas.
3. Automation and DevOps
• Core principle of DevOps is to automate everything.
• One of the big areas is release / delivery automation.
• Some tools follow an infrastructure as code strategy:
– Writing things down in a machine language allows repeatable, consistent deployments;
– Chef / Puppet, Docker-Compose files, …
4. Azure Resource Manager
• When Microsoft created the new Azure portal,they also
rewrote a lot of their APIs.
• This system uses JSONs to represent cloud
resources, organized in resource groups.
• All of MS’s tools to interface with Azure use
this logic:
• AzureRM powershell commands
• Azure cross platform CLI
• The SDKs
5. ARM Templates
• ARM templates are “just” a way to define a resource group in a
single JSON.
• This file can be used to repeatedly deploy that set of resources
and associated configurations.
• Google and Amazon both have analogous Infrastructure as
Code templates, in JSON/YAML.
6. ARM template structure
• parameters – define entry parameters from your template
(passed from a file or input directly)
• Example:
7. ARM template structure
• variables– define global variables, to be used throughout the
template. Can reference the parameters.
• Example:
9. ARM template structure
• outputs – Output any content you want, for other tools (e.g.
nested templates)
• Example:
10. ARM Templates Usage scenarios
• Anyone who deploys to Azure regularly
– to customers directly
– to quickly create separate environments for development
• Examples
– Docker
– Azure Marketplace
– My company! (Case study at the end)
11. Demo: a real example
• We want to deploy a sample ASP.NET 4 application, with Web
Jobs, to Azure. (https://docs.microsoft.com/en-us/azure/app-
service-web/websites-dotnet-webjobs-sdk-get-started)
• It has a SQL database, Azure blob storage, and Azure queues.
• How do we build a template for this? Demo time!
13. Deploying an ARM template
• Powershell
• Azure CLI
• Slingshot (MS project to deploy from github/bitbucket)
• Directly on the Azure Portal
Let's deploy our demo app!
15. ARM Weak spots
• Documentation
– ‘Helped’ by GitHub exemples (https://github.com/Azure/azure-
quickstart-templates)
• IDE
– VS doesn’t help as much as we are used to
– Some APIs being ‘hidden’ doesn’t help
• Only works on Azure
– Can still be a part of a multi-cloud strategy
16. Our “case study”
• The OMNIA platform is a low code cloud platform for
developing business apps.
• In 2016, we released it to all the PRIMAVERA BSS partners
• All installations performed by the PRIMAVERA BSS cloud team
with the template.
17. Our “case study”
• We have migrated structure several times and kept updating
the template.
– Architecture changed from cloud services to web apps
– Replacing Service Bus with Azure Queues
– Removing a separate Web App
• 10-20 production installations, plus a couple staging /
demonstration ones