101
Mastering Azure Managed Applications Hands on workshop Julio Colon Senior Software Engineer David Starr Principal Software Engineer

Hands on workshop Mastering Azure Managed Applications

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Hands on workshop Mastering Azure Managed Applications

Mastering Azure Managed Applications

Hands on workshop

Julio Colon

Senior Software Engineer

David Starr

Principal Software Engineer

Page 2: Hands on workshop Mastering Azure Managed Applications

Microsoft Code of Conduct

Microsoft’s mission is to empower every person and every organization on the planet to achieve more. This includes all

Microsoft events and gatherings, including on digital platforms, where we seek to create a respectful, friendly, fun and

inclusive experience for all participants.

We expect all digital event participants to uphold the principles of this Code of Conduct, which covers the main digital

event and all related activities. We do not tolerate disruptive or disrespectful behavior, messages, images, or

interactions by any party participant, in any form, at any aspect of the program including business and social activities,

regardless of location.

Microsoft will not tolerate harassment or discrimination based on age, ancestry, color, gender identity or expression,

national origin, physical or mental disability, religion, sexual orientation, or any other characteristic protected by

applicable local laws, regulations, and ordinances.

We encourage everyone to assist in creating a welcoming and safe environment. Please report any concerns, harassing

behavior, suspicious, or disruptive activity to Business Conduct Hotline (1-877-320-MSFT or [email protected]).

Microsoft reserves the right to refuse admittance to or remove any person from Microsoft Build at any time at its sole

discretion.

Page 3: Hands on workshop Mastering Azure Managed Applications

Topics

• Azure Managed

Applications

• Artifacts

• Partner Center

• Integrating VM

Offers

• Metered Billing

• Custom UX

• Managing

Customer

Deployments

• Advanced

Deployment

Scenarios

• Test your

knowledge

• Managed

Idenitites

• And more…

Page 4: Hands on workshop Mastering Azure Managed Applications

Engagement

Put questions into chat at any

time

Speakers will monitor chat as

we go

Links on slides will be posted

to chat

Please hold verbal questions

until breaks or labs

Page 5: Hands on workshop Mastering Azure Managed Applications

Azure Applications

Page 6: Hands on workshop Mastering Azure Managed Applications

Azure Applications

• A type of offer in the

Azure Marketplace

• Deployed via ARM templates into

the customer subscription

• Custom installation UX for customer

Page 7: Hands on workshop Mastering Azure Managed Applications

Types of Azure Applications

Azure Solution Application

• Deploys into customer tenant

• Customer owns and maintains it

• The publisher has no maintenance

to do on the application

• Not transactable in the Azure

Managed Application

Azure Managed Application

• Deploys to customer subscription

• Publisher owns and maintains it

• The publisher controls the rights

the customer has to the solution

services

• Transactable in the Azure Managed

Application

Page 8: Hands on workshop Mastering Azure Managed Applications

Service Catalog Deployment

Service catalog

Managed App

definition

Package file in

Storage account

Azure Managed

Application

Page 9: Hands on workshop Mastering Azure Managed Applications

Azure Managed Applications

Page 10: Hands on workshop Mastering Azure Managed Applications

What is a Managed Application?

A type of Azure Application

Maintenance of deployed resources is the publisher’s responsibility

Resources are deployed to a resource group managed by the publisher

2 Types – Internal and external

Page 11: Hands on workshop Mastering Azure Managed Applications

Internal vs. External

Internal

Used for enterprise deployments

Deployed via the Service Catalog

External

Used for public offers

Deployed via the Azure

Marketplace

Page 12: Hands on workshop Mastering Azure Managed Applications

Why use a Managed Application?

• Protect IP

• Control environment updates

• Manage customer permissions

on resources created in their

subscription

• Enable different deployments

based on different plans

Page 13: Hands on workshop Mastering Azure Managed Applications

Managed Application components

• Managed Resource Group (MRG)

• Application Resource Group

• Security Group (SG)

• Service Principal (SP)

Page 14: Hands on workshop Mastering Azure Managed Applications

Purchasing a Managed App

https://azuremarketplace.microsoft.com/ https://portal.azure.com/

Page 15: Hands on workshop Mastering Azure Managed Applications

Purchasing a Managed App

Page 16: Hands on workshop Mastering Azure Managed Applications

Buyers View

Page 17: Hands on workshop Mastering Azure Managed Applications

17

Demo

Purchasing an Azure Managed

Application

Page 18: Hands on workshop Mastering Azure Managed Applications

1. Create Offer

2. Create Plan

3. Select Technical

Configuration

4. Open Package

Details

5. Add Package.zip

6. Review & Publish

Publish

Page 19: Hands on workshop Mastering Azure Managed Applications

Publishers’ View

Page 20: Hands on workshop Mastering Azure Managed Applications

20

Demo

Creating an Azure Managed

Application offer in Partner

Center

Page 21: Hands on workshop Mastering Azure Managed Applications

Azure Marketplace

Managed Application overview

Managed Application Resource Group

Managed Application

Managed Resource Group

Contributor

Customer

*/read

Offer

Platinum Plan

Gold Plan

Silver Plan

Customer’s Subscription

Provisions

Page 22: Hands on workshop Mastering Azure Managed Applications

Tenancy and isolation

Page 23: Hands on workshop Mastering Azure Managed Applications

10 Minute Break

23

Page 24: Hands on workshop Mastering Azure Managed Applications

Help us make this valuable for you!

Start of class survey

https://forms.office.com/r/FT1wVjS38H

Page 25: Hands on workshop Mastering Azure Managed Applications

Azure Managed Application artifacts

Page 26: Hands on workshop Mastering Azure Managed Applications

Managed Application deployment package

application.zip package file

mainTemplate.json

ARM file creates

Azure resources

viewDefinition.json Customizes the

Managed

Application UX

createUiDefinition.jsonCustomizes

installation

screens for users

Feeds

output to

ARM file

Page 27: Hands on workshop Mastering Azure Managed Applications

27

ARM Templates

Infrastructure as code

Deploy Azure resources from

declarative JSON files

May be checked into

version control

Page 28: Hands on workshop Mastering Azure Managed Applications

{

"$schema": "https://schema.management.azure.com/schemas/2019-04-01/...#",

"contentVersion": "1.0.0.0",

"parameters": { … },

"variables": { … },

"resources": [ … ],

“outputs": [ … ],

}

mainTemplate.json – The ARM Template

Page 29: Hands on workshop Mastering Azure Managed Applications

29

CreateUIDefinition.json

Defines the installation

experience for the customer

Creates an install “wizard” for

the customer for installing

the Managed Application

Page 30: Hands on workshop Mastering Azure Managed Applications

createUIDefinition.json

Page 31: Hands on workshop Mastering Azure Managed Applications

31https://portal.azure.com/#blade/Microsoft_Azure_CreateUIDef/SandboxBlade

Page 32: Hands on workshop Mastering Azure Managed Applications

32

Demo

Creating the application

package

Page 33: Hands on workshop Mastering Azure Managed Applications

Hands On Lab 1

aka.ms/AMAWorkshopLabs

When you finish the

lab, please raise your

hand in Teams.

Page 34: Hands on workshop Mastering Azure Managed Applications

Using Partner Center to publish your offer

Page 35: Hands on workshop Mastering Azure Managed Applications

The Partner Center portal

Publish offers on the

Azure Marketplace and AppSource

Works with many different

offer types

View Marketplace Subscriptions

Bill and get paid

Page 36: Hands on workshop Mastering Azure Managed Applications

Partner Center Summary Reports

Summary reports

Orders

Customers

Usage

Marketplace insights

Views across countries

Page 37: Hands on workshop Mastering Azure Managed Applications

Billing Options

Page 38: Hands on workshop Mastering Azure Managed Applications

Microsoft Commercial Marketplace billing types

Virtual

Machine

Azure Apps

(Multi-VM)

Container

Image

Consulting

& Managed

Services

SaaS

App

Office

365

Dynamics

365

PowerApps

List (Contact)

List (Trial)

Free

BYOL

Transact

AppSourceAzure Marketplace Both

PaaS

Page 39: Hands on workshop Mastering Azure Managed Applications

Monetization

Virtual Machine Azure Apps

(Multi-VM)

SaaS

App

Billing Cycle Monthly * Monthly * Monthly or Annual *

Pricing ModelConsumption per core/per

hour

Managed Apps: optional flat

rate

Both: Leverage VM pricing

Flat-rate

Per-user

Consumption-based

(metered event)

Trial Options 1-month or 3-months Leverages VM pricing 1-month

Page 40: Hands on workshop Mastering Azure Managed Applications

Changing Plan Pricing

A plan’s price is immutable

To “upgrade” one must purchase a different plan

A plan may deploy its resources incrementally

Page 41: Hands on workshop Mastering Azure Managed Applications

What are Azure Marketplace Meters?

• Consumable

• Meter ID

• Unit of Measure

• Quantity

• Report

• 1 per hour

• 1 per day (batch)

$1/hour 2 units

$2

m_p

ark

ing

100W incl + $1/W extra 100 units

$100

m_c

harg

er

2 hours

200W

Page 42: Hands on workshop Mastering Azure Managed Applications

AMA offer Pricing Options: Metered

Pricing Option Description Example Plans for an Offer

VariableConsumption based on variable

usage.• Plan A - Number of Transactions $0.12/transaction

Fix + Variable Consumption based on a fix

amount, plus variable usage.

• Plan B - Basic $25/Month (2000 transactions

included) + $0.10/transaction

Multi-Dimension

Consumption based on

multiple dimensions. Up to 10

dimensions allowed.

• Plan C – Basic (Picture Send/Picture Received/

Bandwidth(Mb))

• D1 – Picture Send $0.10/unit

• D2 – Picture Received $0.12/unit

• D3 – Per Megabit Send $0.25/unit

Multi-Dimension

Fix + Variable

Combination of a fixed price

and multi-dimension based

consumption

• Plan D – Basic $10/Month (1000 Pictures Send,

1000 Received and 100 Megabits)

+ Picture Send/Picture Received/ Bandwidth(Mb)

• D1 – Picture Send $0.10/unit

• D2 – Picture Received $0.12/unit

• D3 – Per Megabit Send $0.25/unit

Page 43: Hands on workshop Mastering Azure Managed Applications

Metered: Basic

Page 44: Hands on workshop Mastering Azure Managed Applications

Metered: Multi-Dimension Fix + Variable

Page 45: Hands on workshop Mastering Azure Managed Applications

Azure App

ARM Template(mainTemplate.json)

VM Offer(s)

Azure Portal UI Definition(createUiDefinition.json)

Azure Services

Metering

Meter

Service

Marketplace

Billing API

(Once

Certified)

Azure Portal View

Definition(viewDefinition.json)

* Optional

Meter

Service

Page 46: Hands on workshop Mastering Azure Managed Applications
Page 47: Hands on workshop Mastering Azure Managed Applications

Getting Publisher Support

Page 48: Hands on workshop Mastering Azure Managed Applications

Publisher Guide

Offer Types Marketing Assets Lead Management Legal Documents Publishing TaT Support Information Technical Assets Technical Requirements

Virtual

Machines

Offer Images/Icons

Offer Description

Offer Category/SEO

Offer Documentation

(Videos and Docs.)

Define how do you

want to manage the

offer leads:

Table Storage

Dynamics CRM

Online

HTTPS endpoint

Marketo

Salesforce

Privacy Policy

Terms of Use

24 Hours

Engineering Contacts

Customer Support

Support URLs

Virtual Hard Disk (VHD) Virtual Machine VHD

Azure Apps

(Solution

Template)

7 Days

ARM Template

UI Definition File

Resources (libraries,

scripts, runtimes, etc…)

ARM Template

UI Definition File

Azure Apps

(Managed

Apps)

ARM Template

UI Definition File

Security Principal to

Manage the Offer

Azure Apps

(HDInsight)

ARM Template

UI Definition File

SaaS Apps 12 HoursFree/Trial: None

Transact: Billing API

Integration with Azure

Active Directory

Containers 48 Hours Container

Container Image

Azure Container Registry

(ACR) Credentials

IoT Edge

Modules48 Hours Container

Container Image

Azure Container Registry

(ACR) Credentials

Azure Marketplace Offers and Assets

TaT – Turn Around Time

Page 49: Hands on workshop Mastering Azure Managed Applications

Getting Publisher Support

http://aka.ms/MarketplacePublisherSupport

Page 50: Hands on workshop Mastering Azure Managed Applications

Hands On Lab 2

aka.ms/AMAWorkshopLabs

When you finish the

lab, please raise your

hand in Teams.

Page 51: Hands on workshop Mastering Azure Managed Applications

Integrated VM Offers

Page 52: Hands on workshop Mastering Azure Managed Applications

Azure Managed Application

ARM Template(mainTemplate.json)

VM Offer(s)

UI Definition(createUiDefinition.json)

Azure Services

VM Offer (hidden)

VM Template (.vhd)

Base VM(Azure or Customer .vhd)

App Code(binaries)

Integrated VM Model

Meter

Service

Marketplace

Billing API

(Once

Certified)

View Definition(viewDefinition.json)

* Optional

Page 53: Hands on workshop Mastering Azure Managed Applications

Creating the VM Technical Assets

Building the VM Image

Build the VM Image that will be used as a

base for the Offer. You can use an MS Stock

image or build your own custom image

Open Ports

Define the Open Ports you want to have in

the Offer

(Optional) Data Disk Images

For each VM, you can attach up to fifteen (15)

Data disks

Page 54: Hands on workshop Mastering Azure Managed Applications

55

Referencing a VM Offer

Page 55: Hands on workshop Mastering Azure Managed Applications

30 Minute Lunch Break

56

Start back up at 01:05 PST

Page 56: Hands on workshop Mastering Azure Managed Applications

Deployment Workflow

Page 57: Hands on workshop Mastering Azure Managed Applications

Azure Marketplace

Data Sharing Pilot Architecture

Share 1

Share 2

Share 3

Data Set

Data Set

Data Set

Data Set

Data Set

Offer 1

Offer 2

Plan 1

Plan 2

Plan 1

Publisher Subscription

Consumer Subscription

Webhook

Azure Function

Raw Data Resource Group

Provider Managed Resource Group

Data Share Resource Group

Data Share

service

Provider Managed Resource Group

Share

Snapshot

Data Share

service

Share

Subscription

Consumer

Managed

Resource

Group

Provider Managed Resource Group

Share

Snapshot

Data Share

service

Share

Subscription

Consumer

Managed

Resource

Group

Page 58: Hands on workshop Mastering Azure Managed Applications

Security

Page 59: Hands on workshop Mastering Azure Managed Applications

WebhookCustomer

provisions AMA

AMA and managed

resources deploy

Webhook is called

with status

Webhook is called

with status

Webhook

returns 200

Webhook

returns 200

Page 60: Hands on workshop Mastering Azure Managed Applications

Deployment Status Notifications (Webhook)

• Called by the Azure Managed Application deployment process

• Communicates application status to an endpoint

• Stops when it reads a 200 response from the endpoint

POST https://{your_endpoint_URI}/resource?{optional_parameter}={optional_parameter_value}&sig=Guid HTTP/1.1

{ "eventType": "PUT", "applicationId": "/subscriptions/<subId>/resourceGroups/<rgName>/providers/Microsoft.Solutions/applications/<applicationName>","eventTime": "2019-08-14T19:20:08.1707163Z", "provisioningState": "Succeeded", "billingDetails": {

"resourceUsageId":"<resourceUsageId>"}, "plan": {

"publisher": "publisherId", "product": "offer", "name": "skuName", "version": "1.0.1"

}}

https://docs.microsoft.com/en-us/azure/azure-resource-manager/managed-applications/publish-notifications

Page 61: Hands on workshop Mastering Azure Managed Applications

Deployment Status Notifications (Webhook)

POST https://{your_endpoint_URI}/resource?{optional_parameter}={optional_parameter_value} HTTP/1.1

{ "eventType": "PUT", "applicationId": "/subscriptions/<subId>/resourceGroups/<rgName>/providers/Microsoft.Solutions/applications/<applicationName>","eventTime": "2019-08-14T19:20:08.1707163Z", "provisioningState": "Failed", "billingDetails": {

"resourceUsageId":"<resourceUsageId>"}, "plan": {

"publisher": "publisherId", "product": "offer", "name": "skuName", "version": "1.0.1"

}, "error": {

"code": "ErrorCode", "message": "error message", "details": [ {

"code": "DetailedErrorCode", "message": "error message"

} ]}

}

Page 62: Hands on workshop Mastering Azure Managed Applications

Webhook

Events in the Azure Managed Application lifecycle

EventType ProvisioningState Trigger for notification

PUT Accepted Managed resource group has been created and projected

successfully after application PUT (before the deployment

inside the managed resource group is kicked off).

PUT Succeeded Full provisioning of the managed application succeeded after a

PUT.

PUT Failed Failure of PUT of application instance provisioning at any

point.

PATCH Succeeded After a successful PATCH on the managed application

instance to update tags, JIT access policy, or managed

identity.

DELETE Deleting As soon as the user initiates a DELETE of a managed app

instance.

DELETE Deleted After the full and successful deletion of the managed

application.

DELETE Failed After any error during the deprovisioning process that blocks

the deletion.

Page 63: Hands on workshop Mastering Azure Managed Applications

Upgrading plans

Page 64: Hands on workshop Mastering Azure Managed Applications

Upgrade my plan

I purchased the “Silver” plan previously

I want to upgrade to the “Gold” plan

Page 65: Hands on workshop Mastering Azure Managed Applications

Complete or incremental deployments

Deploys all resources defined in

ARM

If selected resource group exists,

destroys it and re-installs

Replaces all resources

If selected resource group

exists, deploys only new

resources

Will not overwrite existing

resources

Deploys to the same RG as the

original solution

IncrementalComplete

Page 66: Hands on workshop Mastering Azure Managed Applications

Managing CustomerDeployments

Page 67: Hands on workshop Mastering Azure Managed Applications

Allowing Just In Time (JIT) Access

• Currently in preview

• Give consumers greater control over access to managed

resources

• Publisher sends a request for access to troubleshoot or update

the managed resources

• JIT is configured per plan

Page 68: Hands on workshop Mastering Azure Managed Applications

Azure LighthouseManage your customer Managed Applications

Page 69: Hands on workshop Mastering Azure Managed Applications

Metered Billing

Page 70: Hands on workshop Mastering Azure Managed Applications

Metered: Multi-Dimension Fix + Variable

Page 71: Hands on workshop Mastering Azure Managed Applications

Metering Usage

POST https://marketplaceapi.microsoft.com/api/usageEvent?api-version={{ApiVersion}}Content-Type: application/jsonAuthorization: Bearer {{access_token}}

{"resourceId": "Identifier of the resource against which usage is emitted","quantity": 5.0,"dimension": "Dimension identifier","effectiveStartTime": "Time in UTC when the usage event occurred","planId": "Plan associated with the purchased offer"

}

200 Response

{"usageEventId": "Unique identifier associated with the usage event","status": "Accepted","messageTime": "Time this message was created in UTC","resourceId": "Identifier of the resource against which usage is emitted","quantity": 5.0,"dimension": "Dimension identifier","effectiveStartTime": "Time in UTC when the usage event occurred","planId": "Plan associated with the purchased offer"

}

Page 72: Hands on workshop Mastering Azure Managed Applications

Metering Batch Usage

POST https://marketplaceapi.microsoft.com/api/batchUsageEvent?api-version={{ApiVersion}}Content-Type: application/jsonAuthorization: Bearer {{access_token}}

200 Response

{"count": 2,"result": [{"usageEventId": "Unique identifier associated with the usage event","status": "Accepted|Expired|Duplicate|Error|ResourceNotFound|ResourceNotAuthorized|InvalidDimension|BadArgument","messageTime": "Time this message was created in UTC","resourceId": "Identifier of the resource against which usage is emitted","quantity": 5.0,"dimension": "Dimension identifier","effectiveStartTime": "Time in UTC when the usage event occurred","planId": "Plan associated with the purchased offer","error": "Error object (optional)"

},

…]

}

Page 73: Hands on workshop Mastering Azure Managed Applications

Emitting a meter using the REST APIs

https://github.com/microsoft/commercial-marketplace-managed-application-metering-samples

# Get Resource URI$managementTokenUrl = "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https%3A%2F%2Fmanagement.azure.com%2F" $Token = Invoke-RestMethod -Headers @{"Metadata" = "true"} -Uri $managementTokenUrl

# Get Subscription ID$metadataUrl = "http://169.254.169.254/metadata/instance?api-version=2019-06-01"$metadata = Invoke-RestMethod -Headers @{'Metadata'='true'} -Uri $metadataUrl

# Get AMA Details$Headers = @{}$Headers.Add("Authorization","$($Token.token_type) "+ " " + "$($Token.access_token)")$managementUrl = "https://management.azure.com/subscriptions/" + $metadata.compute.subscriptionId + "/resourceGroups/" + $metadata.compute.resourceGroupName + "?api-version=2019-10-01"$resourceGroupInfo = Invoke-RestMethod -Headers $Headers -Uri $managementUrl$managedappId = $resourceGroupInfo.managedBy

# Get Marketplace Token$marketplaceTokenUrl = "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=20e940b3-4c77-4b0b-9a53-9e16a1b010a7" $marketplaceToken = Invoke-RestMethod -Headers @{"Metadata" = "true"} -Uri $marketplaceTokenUrl

# Get Usage from the last 5 minutes$lastHourMinusFiveMinutes = (Get-Date).AddMinutes(-65).ToString("yyyy-MM-ddTHH:mm:ssZ")$body = @{ 'resourceUri' = $managedappId; 'quantity' = 15; 'dimension' = 'dim1'; 'effectiveStartTime' = $lastHourMinusFiveMinutes; 'planId' = 'userassigned'} | ConvertTo-Json

# Post Meter$Headers = @{} $Headers.Add("Authorization","$($marketplaceToken.token_type) "+ " " + "$($marketplaceToken.access_token)")$response = Invoke-RestMethod 'https://marketplaceapi.microsoft.com/api/usageEvent?api-version=2018-08-31' -Method 'POST' -ContentType "application/json" -Headers $Headers -Body $body -Verbose

$managementTokenUrl = "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https%3A%2F%2Fmanagement.azure.com%2F" $Token = Invoke-RestMethod -Headers @{"Metadata" = "true"} -Uri $managementTokenUrl

Page 74: Hands on workshop Mastering Azure Managed Applications

Calling Metering Operations in C#

Response<BatchUsageEventOkResponse> PostBatchUsageEvent( ... );

Task<Response<BatchUsageEventOkResponse>> PostBatchUsageEventAsync( ... );

Response<UsageEventOkResponse> PostUsageEvent( ... );

Task<Response<UsageEventOkResponse>> PostUsageEventAsync( ... );

Page 75: Hands on workshop Mastering Azure Managed Applications

Customizing the Managed ApplicationUI and Behavior

Page 76: Hands on workshop Mastering Azure Managed Applications

77

viewDefinition.json

Customize the Managed

Application itself

Add functionality to the

Azure Managed Application

Page 77: Hands on workshop Mastering Azure Managed Applications

CustomizedManaged Application

Page 78: Hands on workshop Mastering Azure Managed Applications

{

"$schema": "https://raw.githubusercontent.com/Azure/azure-resource-

manager-schemas/master/schemas/viewdefinition/0.0.1-

preview/ViewDefinition.json",

"views": [

{ "kind": "Overview” ... },

{ "kind": "Metrics” ... },

{ "kind": "CustomResources”...}

]

}

viewDefinition.json

Page 79: Hands on workshop Mastering Azure Managed Applications

80

Demo

Customizing Managed App

functionality with

viewDefinition.json

Page 80: Hands on workshop Mastering Azure Managed Applications

Hands On Lab 3

aka.ms/AMAWorkshopLabs

When you finish the

lab, please raise your

hand in Teams.

Page 81: Hands on workshop Mastering Azure Managed Applications

Advanced Deployment Scenarios

Page 82: Hands on workshop Mastering Azure Managed Applications

Storage Provider

Compute Device

Compute Device

Compute DeviceUtil/Billing Service

Metrics

Repo

2. Report Usage

3. Send Marketplace Meters (hourly)

Control Plane

Data Plane

1. Data Transfer

DD

D

DD

D

DD

D

DD

D

Managed Application

Page 83: Hands on workshop Mastering Azure Managed Applications

IoT

IoT Device

IoT Device

IoT Device

Util/Billing Service

Authorization

Service

Metrics

Repo

3. Send Marketplace Meters (hourly)

Managed Application

Page 84: Hands on workshop Mastering Azure Managed Applications

Delegated Manage Identities{

"type": "Microsoft.Authorization/roleAssignments","apiVersion": "2014-10-01-preview","name": "[guid(resourceGroup().id)]","dependsOn": [

"[concat('Microsoft.ManagedIdentity/userAssignedIdentities/', variables('vm_name'))]"],"properties": {"roleDefinitionId": "[variables(parameters('roleType'))]","delegatedManagedIdentityResourceId": "[resourceId('Microsoft.ManagedIdentity/userAssignedI

dentities', variables('vm_name'))]","principalId": "[reference(concat('Microsoft.ManagedIdentity/userAssignedIdentities/',varia

bles('msi_name'))).principalId]","scope": "[variables('scope')]"

}}

Page 85: Hands on workshop Mastering Azure Managed Applications

Containers

Util/Billing Service

Authorization

Service

Metrics

Repo

Private Container

Registry

1. Register the Customer Private Container Registry

2. Pull CIS Container Images

Container

Container

Container

3. Run the Images

Container

Metered Usage:

Per hour / Per Day

6. Send Marketplace Meters (hourly)

Virtual Machine

Container Runtime

Container

Container

Private Container

Registry

Managed Application

Page 86: Hands on workshop Mastering Azure Managed Applications

Custom Resources and Resource Providers

The feature is in preview

Only available in select regions

Works via Service Catalog today

Possible in AMAs today, but requires Swagger integration with Azure APIs

https://docs.microsoft.com/en-us/azure/azure-resource-manager/managed-applications/tutorial-create-managed-app-with-custom-provider?tabs=azurecli-interactive

Page 87: Hands on workshop Mastering Azure Managed Applications

Azure Resource Providers

PowerShell | Azure CLI | Azure Portal

Azure Resource Manager (ARM)

Azure Resource Providers

REST

SUBSCRIPTION

RESOURCE

GROUP

/Microsoft.Storage/storageAccounts/{accountName}?api-version=2018-02-01

Page 88: Hands on workshop Mastering Azure Managed Applications

Custom Azure Resource Providers

PowerShell | Azure CLI | Azure Portal

Azure Resource Manager (ARM)

Custom Resource

Providers

REST

SUBSCRIPTION

MANAGED

RESOURCE

GROUP

CUSTOM

RESOURCE

/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}?api-version=2018-09-01-preview

Page 89: Hands on workshop Mastering Azure Managed Applications
Page 90: Hands on workshop Mastering Azure Managed Applications

Service Catalog Deployment

Service catalog

Managed App

definition

Package file in

Storage account

Azure Managed

Application

Page 91: Hands on workshop Mastering Azure Managed Applications

92

Demo

Custom Resource Providers

Page 92: Hands on workshop Mastering Azure Managed Applications

Help us improve the workshop!

End of class surveyhttps://forms.office.com/r/zNKRp40ULA

Page 93: Hands on workshop Mastering Azure Managed Applications

Hands On Lab 4

aka.ms/AMAWorkshopLabs

When you finish the

lab, please raise your

hand in Teams.

Page 94: Hands on workshop Mastering Azure Managed Applications

Managed Identities

Page 95: Hands on workshop Mastering Azure Managed Applications

Managed Identities – Why?

• Security

• Eliminate managing credentials

• Credentials are not accessible

• Advantages

• AAD required

• No cost

Page 96: Hands on workshop Mastering Azure Managed Applications

Managed Identities

• System Assigned Identity

• User Assigned Identity

https://docs.microsoft.com/en-us/azure/azure-resource-manager/managed-applications/publish-managed-identity

• Application Settings

• Managed Application

Settings

Page 97: Hands on workshop Mastering Azure Managed Applications

Managed Identities – CustomUIDefinition.json{

"name": "appIdentity",

"type": "Microsoft.ManagedIdentity.IdentitySelector",

"label": "Managed Identity Configuration",

"toolTip": {

"systemAssignedIdentity": "Grant the managed application access to additional existing resources.",

"userAssignedIdentity": "Grant the managed application access to additional existing resources.“

},

"defaultValue": {

"systemAssignedIdentity": "Off"

},

"options": {

"hideSystemAssignedIdentity": false,

"hideUserAssignedIdentity": false,

"readOnlySystemAssignedIdentity": false

},

"visible": true

}

Page 98: Hands on workshop Mastering Azure Managed Applications

Resources & Closing

Page 99: Hands on workshop Mastering Azure Managed Applications

Solution Templates Resources and DocumentationTopic Description Links

Azure Templates Quick Starts Bootstrap samples https://github.com/Azure/azure-quickstart-templates

Best Practices ARM Template Guidehttps://github.com/Azure/azure-quickstart-templates/blob/master/1-CONTRIBUTION-GUIDE/best-

practices.md

Template Validation Tool Pre-certification tool https://github.com/Azure/azure-quickstart-templates/tree/master/test/template-validation-tests

Template Deployment Scripts

Resource Groups

Deployment Scripts

Samples

https://github.com/Azure/azure-quickstart-templates/blob/master/Deploy-AzureResourceGroup.ps1

https://github.com/Azure/azure-quickstart-templates/blob/master/az-group-deploy.sh

UI Testing SideLoad Scripts:Testing UI without

publishing

https://github.com/Azure/azure-quickstart-templates/blob/master/SideLoad-CreateUIDefinition.ps1

https://github.com/Azure/azure-quickstart-templates/blob/master/sideload-createuidef.sh

Template Reference Docs Reference Guide https://docs.microsoft.com/en-us/azure/templates/

CreateUIDefinition Docs Azure Portal https://docs.microsoft.com/en-us/azure/managed-applications/create-uidefinition-functions

Template Language Expressions ARM Functions Guide https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-template-functions

Azure PowerShell Azure PowerShell Module https://docs.microsoft.com/en-us/powershell/azure/install-azurerm-ps?view=azurermps-5.7.0

Azure CLI Azure Command Line https://docs.microsoft.com/en-us/cli/azure/?view=azure-cli-latest

Visual Studio Code Extension ARM Template Formatter https://marketplace.visualstudio.com/items?itemName=msazurermtools.azurerm-vscode-tools

Page 100: Hands on workshop Mastering Azure Managed Applications

Marketplace Sample Code and Examples

https://aka.ms/marketplacesamples

Page 101: Hands on workshop Mastering Azure Managed Applications