ARM FTW
(Azure Resource Management For The Win)
@ITCAMPRO #ITCAMP18Community Conference for IT Professionals
Many thanks to our sponsors & partners!
GOLD
SILVER
PARTNERS
PLATINUM
POWERED BY
You!
magnus@loftysoft.com
~288 locations @ global.azurebootcamp.net
#GlobalAzure Bootcamp April 21, 2018!
Platform Services
Security &
Management
Infrastructure Services
Web Apps
with
Web Jobs
Mobile
Apps
API
Management
API
Apps
Logic
Apps
Notification
Hubs
Content Delivery
Network (CDN)
Media
Services
HDInsight Machine
Learning
Stream
Analytics
Data
Factory
Event
Hubs
Mobile
Engagement
Active
Directory
Multi-Factor
Authentication
Automation
Portal
Key Vault
Biztalk
Services
Hybrid
Connections
Service
Bus
Storage
Queues
Store /
Marketplace
Hybrid
Operations
Backup
StorSimple
Site
Recovery
Import/Export
SQL
Database
DocumentDB
Redis
Cache Search
Tables
SQL Data
Warehouse
Azure AD
Connect Health
AD Privileged
Identity
Management
Operational
Insights
Cloud
Services
Batch Remote App
Service
Fabric Visual Studio
Application
Insights
Azure SDK
Team Project
VM Image Gallery
& VM Depot
Azure
Functions
Challenges with managing resources
?
Infrastructure & Configuration as Code + Continuous Delivery
Azure Resource Manager
(ARM)
Consistent management layer
Resource
Provider
https://management.azure.com/subscriptions/{{subscriptionId}}/provide
rs?api-version={{apiVersion}}
?
REST API
What can you do with Azure Resource Manager?
Deploy app resources
What can you do with Azure Resource Manager?
Organize resources
What can you do with Azure Resource Manager?
Control access to resources
Resource Groups
Resource Groups: Start as empty “buckets”!
RESOURCE GROUP
Azure Resource
Management
Behold the simplest possible template!
Demo
Declarative templates
Idempotent
Multi-service, multi-region – easy!
Deploying with Azure Resource Manager
How do I place my Resources in Resource Groups?
Development
Test (multiple)
Staging
Production (multiple regions)
All of those environments…
Do I need one Template for each Environment?
:(
Use the same Template for all Environments!
Create one Parameter file for each Environment!
Template Parameter Files
Deploy many environments in one go!
Demo
Tooling for ARM
Tooling support for ARM
Horseless Carriage
VS Code
Demo
Learn it – Love it – it will give you wings!
Great Extensions that keep getting better!
Azure PowerShell
aka.ms/powershellopensource & on Linux(!)
Azure Command-Line Interface
aka. Azure CLI, aka. xplat-cli
Two OSS command line options for management of Azure.
var windowsVM =
azure.VirtualMachines.Define("myWindowsVM")
.WithRegion(Region.US_EAST)
.WithNewResourceGroup(rgName)
.WithNewPrimaryNetwork("10.0.0.0/28")
.WithPrimaryPrivateIpAddressDynamic()
.WithNewPrimaryPublicIpAddress("mywindowsvmdns")
.WithPopularWindowsImage(
KnownWindowsVirtualMachineImage
.WINDOWS_SERVER_2012_R2_DATACENTER)
.WithAdminUserName("tirekicker")
.WithPassword(password)
.WithSize(VirtualMachineSizeTypes.StandardD3V2)
.CreateAsync();
ARM from code with multiple SDKs.
resources.azure.com
The secret Azure-blue sauce
“Ain’t nothing going on but the REST!”
Magnus Mårtensson
github.com/azure/
azure-quickstart-templates
Demo: Resources to get you started!
ARM is an “enabler”
RBAC
Tags
Policies
etc.
Role Based Access Control
(RBAC)
Role Based Access Control
Allows secure access with granular permissions.
Assignable to users, groups, or service principals.
Built-in roles make it easy to get started.
Custom roles offer greater flexibility.
Access Inheritance and Resource Hierarchy
Role Based Access Control
Click on “the little people”!
Key Learnings from Enterprise Customers
Grant the whole department read access to all the app resources!
Department_Foo_Grp
App1_Readers_AG
Grant the team contributor access to the their resources!
Team_Bar_Grp
Service1_Contributors_AG
Tagging Resources
Visibility, metadata of cloud assets
Growing Service Catalog
Cost Control
Geo-Compliance issues
…
Challenges with all of those easy to deploy services
Demo: Tag included in an ARM Template
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2015-06-15",
"name": "mystorage4321",
"location": "[resourceGroup().location]",
"tags": {
"Department": "RnD"
},
"properties":
{
"accountType": "Standard_LRS"
}
}
]
Filtering to all resources with a certain tag.
Finding out who owns what resource?
Grouping your costs for the Excel people!
Tags are used for…
Policies for your Azure
Let’s you define customized rules
which governs the shape
of your resources.
What is a Resource Policy?
Enforce naming convention on resources.
Limit which types and instances can be deployed.
Specify which regions can be used.
Require tag for department chargeback.
...
What type of Policy?
{
"if" : {
<condition> | <logical operator>
},
"then" : {
"effect" : "deny | audit | append"
}
}
Policy Definition structure
{
"if" : {
"not" : {
"field" : "location",
"in" : ["westeurope", "northeurope"]
}
},
"then" : {
"effect" : "deny"
}
}
Policy – Geo Compliance: Ensure resource locations
{
"if" : {
"not" : {
"field" : "tags",
"containsKey" : "costCenter"
}
},
"then" : {
"effect" : "deny"
}
}
Policy – Chargeback: Require departmental tags
{
"if": {
"allOf": [
{
"field": "tags",
"exists": "true"
},
{
"field": "tags.costCenter",
"exists": "false"
}
]
},
"then": {
"effect": "append",
"details": [
{
"field": "tags.costCenter",
"value": "RnD"
}
]
}
}
Chargeback modify resources by appending departmental tag.
What happens after a policy evaluation?
A request may be blocked or modified.
An audit event is generated.
An alert can be generated based on events.
Auditing
A simplified Policy Evaluation Result
{
"authorization": {
"action": "Microsoft.Resources/deployments/validate/action",
"caller": "magnus@loftysoft.com"
},
"level": "Error",
"operationName": {
"value": "Microsoft.Authorization/policies/deny/action",
},
"resourceType": {
"value": "Microsoft.Resources/deployments",
},
"status": {
"value": "Failed",
},
}
Who initiated the operation.
When the operation occurred.
What operations were taken on the resources.
The status/result of the operation.
...
Through activity logs, you can determine:
Portal view of Activity Logs
Demo
Remove human error.
Security control.
Cost savings by spend control.
Environment parity.
Automation! (automation, automation)
Why do I want ARM and Infrastructure as Code?
@ITCAMPRO #ITCAMP18Community Conference for IT Professionals
magnus@loftysoft.com
Azure Resource Management Wizardry
This course is about the proper way to handle resources in Azure,
access for users, cost control in the Cloud and much more!
After this course you will approach Azure
in a more conscious, controlled and confident way!
magnus@loftysoft.com

ITCamp 2018 - Magnus Mårtensson - Azure Resource Manager For The Win