Skip to content

Client - Server app example to demonstrate how to secure WebAPI with Managed Identity

Notifications You must be signed in to change notification settings

dtila/Tutorial-AzureManagedIdentityRoledBased

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Azure Web API ManagedIdentity Roled based Authorization

.NET Core solution that exemplify securing 2 app in Azure using the Managed Identity. This code is in .NET but the setup can be used for any programming language.

Tutorial: https://medium.com/@dtila/secure-web-api-services-in-azure-with-managed-identity-f1e5243be855

PowerShell script:

$tenantId = '<your tenant id>'
$serverRoleId = '7fbe8499-b22e-47e0-bc51-9c29bd1f40f2'
$clientManagedIdentity = '0f38730f-a246-415f-9edd-52c05292eeab'
$serverEnterpriseApp = '9014273b-4c34-4b58-ad1d-8ed04172d414'

Connect-AzureAd -TenantId $tenantId

New-AzureADServiceAppRoleAssignment `
    -Id $serverRoleId `
    -PrincipalId $clientManagedIdentity `
    -ObjectId $clientManagedIdentity `
    -ResourceId $serverEnterpriseApp

About

Client - Server app example to demonstrate how to secure WebAPI with Managed Identity

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published