34
Singapore, 2015 Platinum Sponsors Singapore, 2015 Building infrastructure with Azure Resource Manager using PowerShell K.Mohamed Faizal, Azure MVP, Singapore

Building infrastructure with Azure Resource Manager using PowerShell

Embed Size (px)

Citation preview

Page 1: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015

Platinum Sponsors

Singapore, 2015 Building

infrastructure with Azure Resource Manager using

PowerShell K.Mohamed Faizal,

Azure MVP, Singapore

Page 2: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015Singapore, 2015

AgendaOverview

2 Azure Resource Manager Tools

3 Customizing Templates

4 Role Based Access Control (RBAC)

5 Q&A

1

Page 3: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015 Areas of Focus

Deploy Organize Control

Page 4: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015Singapore, 2015

Singletons

STORAGE

Page 5: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015Singapore, 2015

Challenges Set Permissions Monitor and alerting rules Billing Deployment Communication

?

Page 6: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015Singapore, 2015

Azure – SharePoint Architecture

Virtual Network

Microsoft Azure

Cloud Service

Availability Set

Active Directory & DNS

Cloud Service Cloud Service

Availability Set

Search Server

Availability Set

Web Front End

Availability Set

Apps Servers

Availability Set

Database

Gatewaysubnet

Active VPN

Availability Set

Distributed Cache

Availability Set

Office Web Apps

Page 7: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015

Platinum Sponsors

Singapore, 2015

DemoAzure Portal – Overview

Page 8: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015Singapore, 2015

Consistent Management Layer

AZURE RESOURCE MANAGER API

What is Azure Resource Manager?

Page 9: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015Singapore, 2015

Resource Groupcontainer for multiple resources resources exist in one* resource group resource groups can span regions resource groups can span services RESOURCE GROUP

*and only one

Page 10: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015 Resource Group Lifecycle

Question: Should these resources be in the same group or a different one?Hint: Do they have common lifecycle and management?

Answer: Up to you.

Page 11: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015

IT

DEV

Infrastructure & Configuration as Code

Value• Deployment Optimization• Accelerate Delivery

Measure• Deployment Rate• MTTR

CODE

STAGE

PRODUCTION

Page 12: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015 Supported Resources

• Websites• SQL-A DB• MySQL DB• VS Online• Application Insights• Classic Compute*• Classic Network*• Classic Storage*• BizTalk Services• Scheduler• Search• Cache• …..• All Existing RP’s will move over into the new stack.• https://management.azure.com/subscriptions/{{subscriptionId}}/providers?api-version=2014-04-01-preview

* Only supported via the Preview Portal

Page 13: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015Singapore, 2015

Install Azure PowerShell Tool • Install the Azure

PowerShell modules• Microsoft Web Platform I

nstaller• (OR) Go To Github and

Install • https://github.com/

Azure/azure-powershell/releases

Page 14: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015Singapore, 2015

Command Line Tools

Page 15: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015Singapore, 2015

Windows PowerShell

Page 16: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015Singapore, 2015

Add Azure Subscription

Page 17: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015Singapore, 2015

Rest API / Postman

Page 18: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015

Visual Studio Azure RM Tools

http://www.microsoft.com/en-us/download/details.aspx?id=43740

Page 19: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015Singapore, 2015

Deployment tracks template executioncreated within a resource groupallows nested deployments

RESOURCE GROUP

Page 20: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015Singapore, 2015

"resources": [ { "name": “myStorageAccount", "type": "Microsoft.Storage/storageAccounts", "location": “westus", "apiVersion": "2015-05-01-preview", "properties": {"accountType": “Standard_LRS"} } ]

Declarative -> Imperative ???

Page 21: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015Singapore, 2015

"resources": [ { "name": “myStorageAccount", "type": "Microsoft.Storage/storageAccounts", "location": “westus", "apiVersion": "2015-05-01-preview", "properties": {"accountType": “Standard_LRS"} } ]

PUT /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Storage/storageAccounts/myStorageAccount?api-version=2015-05-01-preview

{“location”: “westus”,"properties": {"accountType": “Standard_LRS"}

}

Declarative -> Imperative ???

implied

Page 22: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015Singapore, 2015

• Resource Extensions• VM → DSC / Chef / Puppet / Custom script / etc.• AppService → WebDeploy• SQL DB → BACPAC

• Copies + length (like PB+J!)• Nested Templates• NewOrExisting Patterns

Advanced Template Scenarios

Page 23: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015Singapore, 2015

• Resource Groups• Linked Resources• Tags

Organising with Azure Resource Manager

Page 24: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015Singapore, 2015

Resource Group

App-Centric Resource Groups and Templates

My3 Tier

Template

SQL DB AppService

VirtualMachine

reference()

Page 25: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015Singapore, 2015 App-centric Resource Groups and Tier-centric

Templates

MyDB Tier

Template

MyWeb TierTemplate

MyVM Tier

Template

Resource Group

SQL DB AppService

VirtualMachine

reference()

Page 26: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015Singapore, 2015 App-centric Resource Groups and Nested

TemplatesPa

rent

Te

mpl

ate My Nested

DB TierTemplate

My NestedWeb TierTemplate

My NestedVM Tier

Template

Resource Group

SQL DB AppService

VirtualMachine

reference()

My3 Tier

Template

Page 27: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015Singapore, 2015

Tier-centric Resource Groups and Templates

MyDB Tier

Template

MyWeb TierTemplate

MyVM Tier

Template

Resource Group

SQL DB AppService

VirtualMachine

reference()Linked Resource

Resource Group Resource Group

Page 28: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015Singapore, 2015

Resource TagsName-value pairs assigned to resources or resource groupsSubscription-wide taxonomyEach resource can have up to 15 tagsTag by Environment, e.g. dev/test/prodTag by Role, e.g. web/cache/DBTag by Department, e.g. finance/legalTag by Responsible party, e.g. Bob

Tagging Tips

Page 29: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015Singapore, 2015

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

Page 30: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015Singapore, 2015

Two Key ConceptsRole Definitions

Describes the set of permissions (e.g. read actions)

Can be used in multiple assignments

Role Assignments

Associate role definitions with an identity (e.g. user/group) at a scope (e.g. resource group)

Always inherited – subscription assignments apply to all resources

Page 31: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015Singapore, 2015

Role-Based Access Control

Page 32: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015Singapore, 2015

Granular Scopes/subscriptions/{id}/resourceGroups/{name}/providers/…/

sites/{site} subscription level – grants permissions to all resources in the sub

resource group level – grants permissions to all resources in the group resource level – grants

permissions to the specific resource

Page 34: Building infrastructure with Azure Resource Manager using PowerShell

Singapore, 2015

Don’t Forget!• Fill in your survey – it’s how we do better!• Don’t lose you badge! You need it for the Social Events• Grab the Speakers for a chat – they all have time for you!• Let everyone know what they are missing on Social Media

#PowerShell#PSConfAsia

Tweets (preferably with Pictures) win Prizes!!!!Photos of Marina Bay Credit: Alvin Lau