SlideShare a Scribd company logo
Use Azure Active Directory
Managed Identities for your
services!
@Jan_de_V
Jan de Vries
Cloud Solution Architect
So, how do YOU design
your solutions?
What to take into consideration?
Time to market
Complexity
Performance
Security
Availability
Maintainability
Cost
Team knowledge
…
Today’s topic
Security
Application Service Application Service
Application ServiceApplication Service
SQL Database
SQL Database
Storage Account
Service Bus
Yeah, we secured our services with…
•IP whitelisting
•A ‘secret’ code in the headers
•(self-signed) Certificates
•VNet with some NSGs
•Private Link
Introducing: Managed Identities
"identity": {
"type": "SystemAssigned"
},
var tenantId = this.configuration["ActiveDirectory:TenantId"];
var applicationIdUri = this.configuration["ApplicationIdUri"];
var azureServiceTokenProvider = new AzureServiceTokenProvider();
var accessToken = await azureServiceTokenProvider.GetAccessTokenAsync(
applicationIdUri,
tenantId: tenantId);
var httpClient = this.clientFactory.CreateClient();
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", accessToken);
var response = await httpClient.GetAsync(endpointUrlOfYourBackendService);
https://github.com/Azure/azure-sdk-for-net/issues/6172
Manifest
"appRoles": [
{
"allowedMemberTypes": [
"Application",
"User"
],
"description": "Reader Role",
"displayName": "Speaker service reader",
"id": "42ee5891-7e50-4db9-a6d9-75ffc8cc1e9b",
"isEnabled": true,
"lang": null,
"origin": "Application",
"value": "SecureApi.Speaker.Reader"
},
...
],
"Authentication": {
"Authority": "https://login.microsoftonline.com/[tenantId]",
"ClientId": "[theApplicationIdOfTheApplicationRegistration]",
"AppIdUri": "[theApplicationIDURI]"
}
app.UseAuthentication();
app.UseAuthorization();
services.AddAuthentication(o => {
o.DefaultScheme = JwtBearerDefaults.AuthenticationScheme;
})
.AddJwtBearer(o => {
o.Authority = Configuration["Authentication:Authority"];
o.TokenValidationParameters = new Microsoft.IdentityModel.Tokens.TokenValidationParameters
{
ValidAudiences = new List<string>
{
Configuration["Authentication:AppIdUri"],
Configuration["Authentication:ClientId"]
}
};
});
So, what do we have now?
Service 1
• We got a Managed Identity of the first service
• We’re making a HTTP call with an Authorization header
Service 2
• We have an App Registration
• We’ve added `appRoles` entries
• We’ve configured Authentication on the second service
az rest `
--method post `
--uri https://graph.microsoft.com/beta/servicePrincipals/91bc8c76-cddc-4f20-b82d-ec7df1d80827/appRoleAssignments `
--headers "{'content-type': 'application/json'}" `
--body "{
'appRoleId': '42ee5891-7e50-4db9-a6d9-75ffc8cc1e9b’, # identifier of your app role
'principalId': '717a6e6a-2d24-4954-9df1-88679da7c12e’, # object id of the Managed Identity
'principalType': 'ServicePrincipal’,
'resourceId': '91bc8c76-cddc-4f20-b82d-ec7df1d80827’ # the identifier Enterprise Application
}"
Questions, contact
https://github.com/Jandev
@Jan_de_V
jandv@4dotnet.nl
https://twitch.tv/jandev
https://jan-v.nl

More Related Content

What's hot

Using Windows Azure for Solving Identity Management Challenges
Using Windows Azure for Solving Identity Management ChallengesUsing Windows Azure for Solving Identity Management Challenges
Using Windows Azure for Solving Identity Management Challenges
Michael Collier
 
SharePoint Access Control and Claims Based Authentication
SharePoint Access Control and Claims Based AuthenticationSharePoint Access Control and Claims Based Authentication
SharePoint Access Control and Claims Based Authentication
Jonathan Schultz
 
Visual Studio LightSwitch
Visual Studio LightSwitchVisual Studio LightSwitch
Visual Studio LightSwitch
Danijel Malik
 

What's hot (20)

Configuration in azure done right
Configuration in azure done rightConfiguration in azure done right
Configuration in azure done right
 
Using Windows Azure for Solving Identity Management Challenges
Using Windows Azure for Solving Identity Management ChallengesUsing Windows Azure for Solving Identity Management Challenges
Using Windows Azure for Solving Identity Management Challenges
 
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
 
Fact oriented modeling
Fact oriented modelingFact oriented modeling
Fact oriented modeling
 
Azure is for Everyone
Azure is for EveryoneAzure is for Everyone
Azure is for Everyone
 
Getting started with Azure Cognitive services
Getting started with Azure Cognitive servicesGetting started with Azure Cognitive services
Getting started with Azure Cognitive services
 
Azure fundamentals 03
Azure fundamentals 03Azure fundamentals 03
Azure fundamentals 03
 
Microsoft Azure News - 2018 June
Microsoft Azure News - 2018 JuneMicrosoft Azure News - 2018 June
Microsoft Azure News - 2018 June
 
Scott Guthrie's Windows Azure Overview
Scott Guthrie's Windows Azure Overview Scott Guthrie's Windows Azure Overview
Scott Guthrie's Windows Azure Overview
 
EWUG - Bridging the legacy gap in modern workplaces
EWUG - Bridging the legacy gap in modern workplacesEWUG - Bridging the legacy gap in modern workplaces
EWUG - Bridging the legacy gap in modern workplaces
 
Develop enterprise-ready applications for Microsoft Teams
Develop enterprise-ready applications for Microsoft TeamsDevelop enterprise-ready applications for Microsoft Teams
Develop enterprise-ready applications for Microsoft Teams
 
Azure AD B2C Webinar Series: Identity Protocols OIDC and OAuth2 part 1
Azure AD B2C Webinar Series: Identity Protocols OIDC and OAuth2 part 1Azure AD B2C Webinar Series: Identity Protocols OIDC and OAuth2 part 1
Azure AD B2C Webinar Series: Identity Protocols OIDC and OAuth2 part 1
 
SharePoint Access Control and Claims Based Authentication
SharePoint Access Control and Claims Based AuthenticationSharePoint Access Control and Claims Based Authentication
SharePoint Access Control and Claims Based Authentication
 
Azure
AzureAzure
Azure
 
User Authentication and Cloud Authorization in the Galaxy project: https://do...
User Authentication and Cloud Authorization in the Galaxy project: https://do...User Authentication and Cloud Authorization in the Galaxy project: https://do...
User Authentication and Cloud Authorization in the Galaxy project: https://do...
 
Easy Auth Overview - Tokyo Azure Meetup - Feb 2018
Easy Auth Overview - Tokyo Azure Meetup - Feb 2018Easy Auth Overview - Tokyo Azure Meetup - Feb 2018
Easy Auth Overview - Tokyo Azure Meetup - Feb 2018
 
Visual Studio LightSwitch
Visual Studio LightSwitchVisual Studio LightSwitch
Visual Studio LightSwitch
 
10 Ways to Gaurantee Your Azure Project will Fail
10 Ways to Gaurantee Your Azure Project will Fail10 Ways to Gaurantee Your Azure Project will Fail
10 Ways to Gaurantee Your Azure Project will Fail
 
Azure AD B2C Webinar Series: Identity Protocols OIDC and OAuth2 part 2
Azure AD B2C Webinar Series: Identity Protocols OIDC and OAuth2 part 2Azure AD B2C Webinar Series: Identity Protocols OIDC and OAuth2 part 2
Azure AD B2C Webinar Series: Identity Protocols OIDC and OAuth2 part 2
 
Microsoft cloud 101
Microsoft cloud 101Microsoft cloud 101
Microsoft cloud 101
 

Similar to Next.Net event - Use Azure Active Directory Managed Identities for your services!

선도 금융사들의 aws security 활용 방안 소개 :: Eugene Yu :: AWS Finance...
선도 금융사들의 aws security 활용 방안 소개 :: Eugene Yu :: AWS Finance...선도 금융사들의 aws security 활용 방안 소개 :: Eugene Yu :: AWS Finance...
선도 금융사들의 aws security 활용 방안 소개 :: Eugene Yu :: AWS Finance...
Amazon Web Services Korea
 

Similar to Next.Net event - Use Azure Active Directory Managed Identities for your services! (20)

Using Azure Managed Identities for your App Services by Jan de Vries from 4Do...
Using Azure Managed Identities for your App Services by Jan de Vries from 4Do...Using Azure Managed Identities for your App Services by Jan de Vries from 4Do...
Using Azure Managed Identities for your App Services by Jan de Vries from 4Do...
 
Compliance with AWS
Compliance with AWSCompliance with AWS
Compliance with AWS
 
AWS Summit Auckland - Introducing Well-Architected for Developers
AWS Summit Auckland  - Introducing Well-Architected for DevelopersAWS Summit Auckland  - Introducing Well-Architected for Developers
AWS Summit Auckland - Introducing Well-Architected for Developers
 
Azure Community Tour 2019 - AZUGDK
Azure Community Tour 2019 - AZUGDKAzure Community Tour 2019 - AZUGDK
Azure Community Tour 2019 - AZUGDK
 
Zero Credential Development with Managed Identities
Zero Credential Development with Managed IdentitiesZero Credential Development with Managed Identities
Zero Credential Development with Managed Identities
 
Zero Credential Development with Managed Identities for Azure resources
Zero Credential Development with Managed Identities for Azure resourcesZero Credential Development with Managed Identities for Azure resources
Zero Credential Development with Managed Identities for Azure resources
 
Zero credential development with managed identities
Zero credential development with managed identitiesZero credential development with managed identities
Zero credential development with managed identities
 
Zero Credential Development with Managed Identities
Zero Credential Development with Managed IdentitiesZero Credential Development with Managed Identities
Zero Credential Development with Managed Identities
 
Tour to Azure Security Center
Tour to Azure Security CenterTour to Azure Security Center
Tour to Azure Security Center
 
선도 금융사들의 aws security 활용 방안 소개 :: Eugene Yu :: AWS Finance...
선도 금융사들의 aws security 활용 방안 소개 :: Eugene Yu :: AWS Finance...선도 금융사들의 aws security 활용 방안 소개 :: Eugene Yu :: AWS Finance...
선도 금융사들의 aws security 활용 방안 소개 :: Eugene Yu :: AWS Finance...
 
Zero Credential Development with Managed Identities
Zero Credential Development with Managed IdentitiesZero Credential Development with Managed Identities
Zero Credential Development with Managed Identities
 
Zero credential development with managed identities
Zero credential development with managed identitiesZero credential development with managed identities
Zero credential development with managed identities
 
Passwordless Development using Azure Identity
Passwordless Development using Azure IdentityPasswordless Development using Azure Identity
Passwordless Development using Azure Identity
 
5 minutes on security
5 minutes on security5 minutes on security
5 minutes on security
 
Introducing “Well-Architected” For Developers - Technical 101
Introducing “Well-Architected” For Developers - Technical 101Introducing “Well-Architected” For Developers - Technical 101
Introducing “Well-Architected” For Developers - Technical 101
 
Introduction to basic governance in Azure - #GABDK
Introduction to basic governance in Azure - #GABDKIntroduction to basic governance in Azure - #GABDK
Introduction to basic governance in Azure - #GABDK
 
Understanding AWS Security
Understanding AWS SecurityUnderstanding AWS Security
Understanding AWS Security
 
LIFT OFF 2017: AWS and Cloud Computing
LIFT OFF 2017: AWS and Cloud ComputingLIFT OFF 2017: AWS and Cloud Computing
LIFT OFF 2017: AWS and Cloud Computing
 
Getting Started with Windows Workloads on Amazon EC2 - Toronto
 Getting Started with Windows Workloads on Amazon EC2 - Toronto Getting Started with Windows Workloads on Amazon EC2 - Toronto
Getting Started with Windows Workloads on Amazon EC2 - Toronto
 
Make IT Pro's great again: Microsoft Azure for the SharePoint professional
Make IT Pro's great again: Microsoft Azure for the SharePoint professionalMake IT Pro's great again: Microsoft Azure for the SharePoint professional
Make IT Pro's great again: Microsoft Azure for the SharePoint professional
 

More from Jan de Vries

More from Jan de Vries (16)

Webdev Zwolle - PaaSwordless in Azure
Webdev Zwolle - PaaSwordless in AzureWebdev Zwolle - PaaSwordless in Azure
Webdev Zwolle - PaaSwordless in Azure
 
Move Up - Design je Azure Functions als een pro
Move Up - Design je Azure Functions als een proMove Up - Design je Azure Functions als een pro
Move Up - Design je Azure Functions als een pro
 
TechDays Sweden - Creating real-life serverless solutions with Azure Functions
TechDays Sweden - Creating real-life serverless solutions with Azure FunctionsTechDays Sweden - Creating real-life serverless solutions with Azure Functions
TechDays Sweden - Creating real-life serverless solutions with Azure Functions
 
TechDays Sweden - No Nouns!
TechDays Sweden - No Nouns!TechDays Sweden - No Nouns!
TechDays Sweden - No Nouns!
 
Serverless... Hoe, wat en vooral waarom
Serverless... Hoe, wat en vooral waaromServerless... Hoe, wat en vooral waarom
Serverless... Hoe, wat en vooral waarom
 
Why care about serverless
Why care about serverlessWhy care about serverless
Why care about serverless
 
No nouns, hoe ga je een microservices architectuur opzetten
No nouns, hoe ga je een microservices architectuur opzettenNo nouns, hoe ga je een microservices architectuur opzetten
No nouns, hoe ga je een microservices architectuur opzetten
 
No nouns
No nounsNo nouns
No nouns
 
Creating real life serverless solutions with Azure Functions
Creating real life serverless solutions with Azure FunctionsCreating real life serverless solutions with Azure Functions
Creating real life serverless solutions with Azure Functions
 
Creating real life serverless solutions with Azure Functions - dotNet Amsterd...
Creating real life serverless solutions with Azure Functions - dotNet Amsterd...Creating real life serverless solutions with Azure Functions - dotNet Amsterd...
Creating real life serverless solutions with Azure Functions - dotNet Amsterd...
 
Using the Azure Container Service in your company
Using the Azure Container Service in your companyUsing the Azure Container Service in your company
Using the Azure Container Service in your company
 
TechDays 2017 - Creating real life serverless solutions with azure functions
TechDays 2017 - Creating real life serverless solutions with azure functionsTechDays 2017 - Creating real life serverless solutions with azure functions
TechDays 2017 - Creating real life serverless solutions with azure functions
 
Visual Studio 2017
Visual Studio 2017Visual Studio 2017
Visual Studio 2017
 
Applied patterns in the project
Applied patterns in the projectApplied patterns in the project
Applied patterns in the project
 
Dependency injection en testen
Dependency injection en testenDependency injection en testen
Dependency injection en testen
 
Clean Code summary
Clean Code summaryClean Code summary
Clean Code summary
 

Recently uploaded

How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
Alluxio, Inc.
 

Recently uploaded (20)

Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
GraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysisGraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysis
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 

Next.Net event - Use Azure Active Directory Managed Identities for your services!

  • 1. Use Azure Active Directory Managed Identities for your services! @Jan_de_V Jan de Vries Cloud Solution Architect
  • 2. So, how do YOU design your solutions?
  • 3. What to take into consideration? Time to market Complexity Performance Security Availability Maintainability Cost Team knowledge …
  • 5. Application Service Application Service Application ServiceApplication Service SQL Database SQL Database Storage Account Service Bus
  • 6. Yeah, we secured our services with… •IP whitelisting •A ‘secret’ code in the headers •(self-signed) Certificates •VNet with some NSGs •Private Link
  • 8.
  • 10.
  • 11. var tenantId = this.configuration["ActiveDirectory:TenantId"]; var applicationIdUri = this.configuration["ApplicationIdUri"]; var azureServiceTokenProvider = new AzureServiceTokenProvider(); var accessToken = await azureServiceTokenProvider.GetAccessTokenAsync( applicationIdUri, tenantId: tenantId); var httpClient = this.clientFactory.CreateClient(); httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken); var response = await httpClient.GetAsync(endpointUrlOfYourBackendService);
  • 12.
  • 14. Manifest "appRoles": [ { "allowedMemberTypes": [ "Application", "User" ], "description": "Reader Role", "displayName": "Speaker service reader", "id": "42ee5891-7e50-4db9-a6d9-75ffc8cc1e9b", "isEnabled": true, "lang": null, "origin": "Application", "value": "SecureApi.Speaker.Reader" }, ... ],
  • 15. "Authentication": { "Authority": "https://login.microsoftonline.com/[tenantId]", "ClientId": "[theApplicationIdOfTheApplicationRegistration]", "AppIdUri": "[theApplicationIDURI]" } app.UseAuthentication(); app.UseAuthorization(); services.AddAuthentication(o => { o.DefaultScheme = JwtBearerDefaults.AuthenticationScheme; }) .AddJwtBearer(o => { o.Authority = Configuration["Authentication:Authority"]; o.TokenValidationParameters = new Microsoft.IdentityModel.Tokens.TokenValidationParameters { ValidAudiences = new List<string> { Configuration["Authentication:AppIdUri"], Configuration["Authentication:ClientId"] } }; });
  • 16. So, what do we have now? Service 1 • We got a Managed Identity of the first service • We’re making a HTTP call with an Authorization header Service 2 • We have an App Registration • We’ve added `appRoles` entries • We’ve configured Authentication on the second service
  • 17. az rest ` --method post ` --uri https://graph.microsoft.com/beta/servicePrincipals/91bc8c76-cddc-4f20-b82d-ec7df1d80827/appRoleAssignments ` --headers "{'content-type': 'application/json'}" ` --body "{ 'appRoleId': '42ee5891-7e50-4db9-a6d9-75ffc8cc1e9b’, # identifier of your app role 'principalId': '717a6e6a-2d24-4954-9df1-88679da7c12e’, # object id of the Managed Identity 'principalType': 'ServicePrincipal’, 'resourceId': '91bc8c76-cddc-4f20-b82d-ec7df1d80827’ # the identifier Enterprise Application }"