Coming next ARM Templates Deploy using Ia C
- Slides: 21
Coming next… ARM Templates: Deploy using Ia. C
#globalazuregreece #globalazure
Agenda § § § § Session: “Azure ARM Templates: Deploy Using Ia. C” What is Infrastructure as Code: a primer Basics on the Azure Resource Manager ARM Templates ecosystem explained Essential best practices Where to go next References Q&A
A few bits about me https: //sqltattoo. com @sqltattoo /in/vassilis-ioannidis me@sqltattoo. com github. com/SQLtattoo Member of the sqlschool. gr team Vassilis Ioannidis Consultant | Trainer | Speaker Other communities we ♥ and trust: autoexec / azureheads / dotnetzone Technical Consulting Manager @ incadea Gmb. H Since 2005 Since 2000
What is “Infrastructure as Code”: a primer Is the management of infrastructure in a declarative model Infrastructure as Code evolved to solve the problem of environment drift Idempotence is a basic principle and is the logic behind “same code produces same binary” Save money by delivering stable environments rapidly and at scale Create a library of reusable templates and add to change control repos and CD process Resources created according to governance requirements set Ia. C is orchestration based Orchestration in Azure is done by Azure Resource Manager
Azure Resource Manager fundamentals Azure Resource Manager is the modern deployment and management service for Azure CLI Power. Shell SDKs Enables the creation, update and deletion of resources in an Azure Subscription Azure Portal Authentication / Authorization All requests no matter the tool pass through the same process. No back doors. You use management features, like access control, locks, and tags, to secure and organize your resources after deployment REST Clients Azure Resource Manager Azure Resource Providers Iaa. S Providers i. e. Virtual Machines Storage Accounts Managed Disks Virtual Networks Paa. S Providers i. e. SQL Azure Web Apps API Services Messaging Services
Azure Resource Manager fundamentals (cont. ) Resources and dependencies Storage Account NIC Microsoft. Network/network. Interfaces Microsoft. Storage/storage. Accounts Virtual Network Microsoft. Network/virtual. Networks Azure VM Microsoft. Compute/virtual. Machines Subnet Microsoft. Network/virtual. Networks/subnets Disk Microsoft. Compute/disks
Azure Resource Manager fundamentals (cont. ) Demo Get Azure Resource Providers and Types info using Power. Shell
ARM Templates ecosystem explained Azure Resource Manager Templates are JSON files Basic structure of an ARM Template file: { "$schema": "https: //schema. management. azure. com/schemas/2019 -04 -01/deployment. Template. json#", "content. Version": "", "parameters": { }, "variables": { }, "resources": [ ], "outputs": { } } An ARM Template file name example: my-first-vm. json
ARM Templates ecosystem explained (cont. ) An ARM Template file can have a corresponding parameters file my-first-vm. json << ARM Template file name Parameters my-first-vm. parameters. json Parameters input << Corresponding Parameters file name
ARM Templates ecosystem explained (cont. ) ARM Template deployment modes Incremental o Is the default mode o Does not touch resources that are not specified in the template o Resources in the template are added or modified Complete o Removes resources not in described in the template (Watch out!) o A good use is when starting new or refactoring a deployment and need to delete old resources o If the Resource Group is locked, resources are not deleted
ARM Templates ecosystem explained (cont. ) Incremental Resource Group VM 1 VM 2 VM 3 VM 4 Resource Group VM 1 VM 2 VM 3 VM 4 Complete Resource Group VM 1 VM 2 VM 3 VM 4 Resource Group VM 4
ARM Templates ecosystem explained (cont. ) Tools for authoring ARM Templates VS Code ARM Template extensions Visual Studio Group Deployment Project You can always use Notepad. exe Also checkout ARMViz. io tool
ARM Templates ecosystem explained (cont. ) Deploying ARM Templates Azure RM Templates can be deployed through any of the following ways: ü the Azure Portal ü the Azure REST API ü the Azure CLI ü the Power. Shell ü the Cloud Shell (Bash or Power. Shell) ü Azure Dev. Ops ü Git. Hub ü Terraform (combined with Ansible for configuration) ü … Azure RM Templates are most commonly deployed in the same Resource Group Note: the Resource Group must exist in order for the deployment to succeed.
ARM Templates ecosystem explained (cont. ) ARM Template Deployment via Power. Shell New-Az. Resource. Group. Deployment ` -Deployment. Name “A descriptive deployment name” ` -Resource. Group. Name “my-resource-group-name” ` -Template. File ". templatesvnet 2 subnets. json" ` -Template. Parameter. File ". templatesvnet 2 subnets. parameters. json" ` @parameters ` -Verbose ` Use Test-Az. Resource. Group. Deployment to test your template and parameter values without actually deploying any resources
Azure Resource Manager fundamentals (cont. ) Demo Use Power. Shell to: 1. A simple template with a single resource 2. Incremental vs Complete deployment mode 3. Deploy a Windows VM (Iaa. S) 4. Deploy an Azure Web App (Paa. S)
Essential best practices Parameters Variables Resources ü Minimize use of Parameters ü Do not use the reference function in this section ü Add resource metadata using tags for easier identification and cost reporting ü Use camel casing for variables names ü Put comments in each resource ü Removed unused variables ü Do not hard code namespaces for public endpoints i. e. an Azure Blob Storage. Use reference function ü Use parameters for things like: SKU, Size, Copy count, Admin user name, Secrets (password etc. ) ü Use camel casing for parameter names ü Define default values, helps users see an example input ü Write metadata descriptions, make it easier for other to understand the input needed ü Location recommendation: user the resource. Group(). location to set a default location for the resources ü Assign variables to values that you use many times in the template ü Create variables for resource names that must be unique i. e. storage account ü Avoid assigning Public IP to VM directly
Where to go next? Deploy VM Extensions Blueprints Perform post-deployment actions Compliance & governance Azure Automation DSC Versioning with Git using ARM Templates Organize and share your code safely Nested & Linked Templates Azure Dev. Ops For modular and scalable execution Enable CD through Azure Pipelines
References Azure Quickstart Templates on Git. Hub https: //github. com/Azure/azure-quickstart-templates Azure Quickstart Templates on Azure web site (same content with Git. Hub, “friendly” search) https: //azure. microsoft. com/en-us/resources/templates/ Define Resources in ARM Templates https: //docs. microsoft. com/en-us/azure/templates/ Azure Resource Manager Templates Schemas on Git. Hub https: //github. com/Azure/azure-resource-manager-schemas ARM Template documentation https: //docs. microsoft. com/en-us/azure-resource-manager/templates/ Azure Resource Providers and Types https: //docs. microsoft. com/en-us/azure-resource-manager/management/resource-providers-and-types ARM Templates best practices https: //docs. microsoft. com/en-us/azure-resource-manager/templates/template-best-practices VS Code ARM Extensions https: //marketplace. visualstudio. com/items? item. Name=msazurermtools. azurerm-vscode-tools https: //marketplace. visualstudio. com/items? item. Name=ed-elliott. azure-arm-template-helper https: //marketplace. visualstudio. com/items? item. Name=bencoleman. armview
Q&A Thank you! Follow me on @sqltattoo Subscribe at https: //sqltattoo. com E-mail: me@sqltattoo. com
Coming next… Azure Bastion and the power working from within the browser!
- X.next = x.next.next
- Effort arm and resistance arm
- Advantages and disadvantages of first class levers
- Third class lever sporting examples
- Linker arm left arm
- Twin flex clasp
- Circumfrential clasp
- Octopus deploy logo
- Describes a firm's ability to create deploy modify
- Octopus deploy training
- Deploy happiness
- Aws drupal hosting
- Select all the accenture delivery tools
- Octopus rest api
- Octopus deploy demo
- Busceral
- Jeus8 deploy 오류
- The recognition of human movement using temporal templates
- Dtfd switch
- Using system.collections.generic
- They say / i say paragraph examples
- Marketo program types