How managed identities work on Azure resources

Published 01-06-2021 09:39 AM 3,090 Views
Microsoft

One of the most common challenge faced by developers while maintaining source code on Azure resources is: how to store and retrieve the secrets without having to save any credentials whatsoever. Moreover, this is strictly discouraged in accordance with Defence-in-depth approach.

 

Managed identities on Azure solve this challenge by assigning service principals to the identities on Azure AD. 

 

To understand how it works, let's build a setup with Ubuntu VM running on Azure, Key Vault to fetch secrets, and Azure AAD to register the VM as a managed identity.

For brevity, I have already spun up a Ubuntu 18.04 VM.

1. Let's create a AKV account and save dummy credentials on it, which needs to be fetched by application running on VM.

 

PS C:\WINDOWS\system32> New-AzKeyVault -Name "dummy-keyvault" -ResourceGroupName "ManagedIdentityLab" -Location "East US2"


Vault Name                          : dummy-keyvault
Resource Group Name                 : ManagedIdentityLab
Location                            : East US2
Resource ID                         : /subscriptions/<redacted>/resourceGroups/ManagedIdentityLab/providers/Microsoft.KeyVault/vaults/dummy-keyvault
Vault URI                           : https://dummy-keyvault.vault.azure.net/

PS C:\WINDOWS\system32> $secretvalue = ConvertTo-SecureString 'abc@123' -AsPlainText -Force
PS C:\WINDOWS\system32> $secret = Set-AzKeyVaultSecret -VaultName 'dummy-keyvault' -Name 'ExamplePassword' -SecretValue $secretvalue

 

 

2. Now, let's assign a system-assigned identity to the ubuntu VM, so that applications running on it will use this identity to access other Azure resources like AKV.

 

 

PS C:\WINDOWS\system32> $vm = Get-AzVM -ResourceGroupName ManagedIdentityLab -Name  vm-running-app

PS C:\WINDOWS\system32> Update-AzVM -ResourceGroupName ManagedIdentityLab -VM $vm -IdentityType SystemAssigned

RequestId IsSuccessStatusCode StatusCode ReasonPhrase
--------- ------------------- ---------- ------------
                         True         OK OK
PS C:\WINDOWS\system32> $spID = (Get-AzVM -ResourceGroupName ManagedIdentityLab  -Name vm-running-app).identity.principalid
PS C:\WINDOWS\system32> $spID
f9733206-1fcb-42c9-abc9-a75d1b68d52b

 

 

3. Now we can assign this principal ID Reader access to Azure Key Vault we created in first step. We do this by assigning RBAC role: Reader to the principal ID assigned to the VM in step 2.

 

 

PS C:\WINDOWS\system32> New-AzRoleAssignment -ObjectId $spID -RoleDefinitionName "Reader" -Scope /subscriptions/<redacted>/resourceGroups/ManagedIdentityLab/providers/Microsoft.KeyVault/vaults/dummy-keyvault


RoleAssignmentId   : /subscriptions/<redacted>/resourceGroups/ManagedIdentityLab/providers/Microsoft.KeyVault/vaults/dummy-keyvault/providers/Microsoft.Authorization/roleAssignments/780e1100-f4a0-44a8-a8ee-79c5
                     588c3e17
Scope              : /subscriptions/<redacted>/resourceGroups/ManagedIdentityLab/providers/Microsoft.KeyVault/vaults/dummy-keyvault
DisplayName        : vm-running-app
SignInName         :
RoleDefinitionName : Reader
RoleDefinitionId   : acdd72a7-3385-48ef-bd32-f606fba81ae7
ObjectId           : f9733206-1fcb-42c9-abc9-a75d1b68d52b
ObjectType         : ServicePrincipal
CanDelegate        : False
Description        :
ConditionVersion   :
Condition          :

PS C:\WINDOWS\system32>

 

 

 

4. We are now all set to access the keyvault from the python3 interactive shell on ubuntu VM

 

 

 

>>> from azure.identity import ManagedIdentityCredential
>>> credentials=ManagedIdentityCredential()
>>> import os
>>> import cmd
>>> keyVaultName = os.environ["KEY_VAULT_NAME"]
>>> KVUri = f"https://{keyVaultName}.vault.azure.net"
>>> from azure.keyvault.secrets import SecretClient
>>> client = SecretClient(vault_url=KVUri, credential=credentials)
>>> retrieved_secret = client.get_secret("ExamplePassword")
>>>
>>> retrieved_secret
<KeyVaultSecret [https://dummy-keyvault.vault.azure.net/secrets/ExamplePassword/4d1ef64abc4d4c2e8741df66ee0f0065]>
>>> retrieved_secret.
retrieved_secret.id          retrieved_secret.name        retrieved_secret.properties  retrieved_secret.value
>>> retrieved_secret.value
'abc@123'
>>>

 

 

 

Voila! We can fetch the secret from the AKV without having to store the secret anywhere. The class ManagedIdentityCredential in azure-identity package fetches the VM's managed identity client ID.

 

The magic that happens behind the scene is described below:

1. As soon as the client.get_secret method is called to fetch secret from AKV, an http request is made to the AKV url. The response back is http 401 error, since the request header does not have a valid token.

 

 

INFO:azure.core.pipeline.policies.http_logging_policy:Request URL: 'https://dummy-keyvault.vault.azure.net/secrets/ExamplePassword/?api-version=REDACTED'
INFO:azure.core.pipeline.policies.http_logging_policy:Request method: 'GET'
INFO:azure.core.pipeline.policies.http_logging_policy:Response status: 401

 

 

2. Post this failure, another request is made to the AAD to get the token for the managed identity associated with the ubuntu VM. The response returned back is the access token :

 

 

INFO:azure.core.pipeline.policies.http_logging_policy:Request URL: 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=REDACTED&resource=REDACTED'
INFO:azure.core.pipeline.policies.http_logging_policy:Request method: 'GET'
INFO:azure.core.pipeline.policies.http_logging_policy:Response status: 200
INFO:azure.core.pipeline.policies.http_logging_policy:Response headers:

    "response": {
        "access_token": "********",
        "client_id": "1699a4a0-2f2a-4696-b483-dd32a950349a",
        "expires_in": "85295",
        "expires_on": 1610038816,
        "ext_expires_in": "86399",
        "not_before": "1609952116",
        "resource": "https://vault.azure.net",
        "token_type": "Bearer"
    },
    "scope": [
        "https://vault.azure.net/.default"
    ]
}

 

 

3. Finally, the access token retrieved from step 2 is used in the header to reattempt step 1. When AKV receives the request this time, it validates the access token against AAD. Since the access token is valid, the request is allowed to read the secret and we get a http 200 response back.

 

 

INFO:azure.identity._internal.decorators:ManagedIdentityCredential.get_token succeeded
INFO:azure.core.pipeline.policies.http_logging_policy:Request URL: 'https://dummy-keyvault.vault.azure.net/secrets/ExamplePassword/?api-version=REDACTED'
INFO:azure.core.pipeline.policies.http_logging_policy:Request method: 'GET'
INFO:azure.core.pipeline.policies.http_logging_policy:Request headers:
INFO:azure.core.pipeline.policies.http_logging_policy:Response status: 200

 

 

To summarize, managed identity allows the apps running on Azure resources to authenticate against AAD without having to store credentials. This is super convenient and compliant, also eliminates the need to rotate the client secret upon compromise or expiration.

 

%3CLINGO-SUB%20id%3D%22lingo-sub-2035097%22%20slang%3D%22en-US%22%3EHow%20managed%20identities%20work%20on%20Azure%20resources%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2035097%22%20slang%3D%22en-US%22%3E%3CP%3EOne%20of%20the%20most%20common%20challenge%20faced%20by%20developers%20while%20maintaining%20source%20code%20on%20Azure%20resources%20is%3A%20how%20to%20store%20and%20retrieve%20the%20secrets%20without%20having%20to%20save%20any%20credentials%20whatsoever.%20Moreover%2C%20this%20is%20strictly%20discouraged%20in%20accordance%20with%20Defence-in-depth%20approach.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EManaged%20identities%20on%20Azure%20solve%20this%20challenge%20by%20assigning%20service%20principals%20to%20the%20identities%20on%20Azure%20AD.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20understand%20how%20it%20works%2C%20let's%20build%20a%20setup%20with%20Ubuntu%20VM%20running%20on%20Azure%2C%20Key%20Vault%20to%20fetch%20secrets%2C%20and%20Azure%20AAD%20to%20register%20the%20VM%20as%20a%20managed%20identity.%3C%2FP%3E%0A%3CP%3EFor%20brevity%2C%20I%20have%20already%20spun%20up%20a%20Ubuntu%2018.04%20VM.%3C%2FP%3E%0A%3CP%3E1.%20Let's%20create%20a%20AKV%20account%20and%20save%20dummy%20credentials%20on%20it%2C%20which%20needs%20to%20be%20fetched%20by%20application%20running%20on%20VM.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EPS%20C%3A%5CWINDOWS%5Csystem32%26gt%3B%20New-AzKeyVault%20-Name%20%22dummy-keyvault%22%20-ResourceGroupName%20%22ManagedIdentityLab%22%20-Location%20%22East%20US2%22%0A%0A%0AVault%20Name%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3A%20dummy-keyvault%0AResource%20Group%20Name%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3A%20ManagedIdentityLab%0ALocation%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3A%20East%20US2%0AResource%20ID%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3A%20%2Fsubscriptions%2F%3CREDACTED%3E%2FresourceGroups%2FManagedIdentityLab%2Fproviders%2FMicrosoft.KeyVault%2Fvaults%2Fdummy-keyvault%0AVault%20URI%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3A%20https%3A%2F%2Fdummy-keyvault.vault.azure.net%2F%0A%0APS%20C%3A%5CWINDOWS%5Csystem32%26gt%3B%20%24secretvalue%20%3D%20ConvertTo-SecureString%20'abc%40123'%20-AsPlainText%20-Force%0APS%20C%3A%5CWINDOWS%5Csystem32%26gt%3B%20%24secret%20%3D%20Set-AzKeyVaultSecret%20-VaultName%20'dummy-keyvault'%20-Name%20'ExamplePassword'%20-SecretValue%20%24secretvalue%3C%2FREDACTED%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E2.%20Now%2C%20let's%20assign%20a%20system-assigned%20identity%20to%20the%20ubuntu%20VM%2C%20so%20that%20applications%20running%20on%20it%20will%20use%20this%20identity%20to%20access%20other%20Azure%20resources%20like%20AKV.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EPS%20C%3A%5CWINDOWS%5Csystem32%26gt%3B%20%24vm%20%3D%20Get-AzVM%20-ResourceGroupName%20ManagedIdentityLab%20-Name%20%20vm-running-app%0A%0APS%20C%3A%5CWINDOWS%5Csystem32%26gt%3B%20Update-AzVM%20-ResourceGroupName%20ManagedIdentityLab%20-VM%20%24vm%20-IdentityType%20SystemAssigned%0A%0ARequestId%20IsSuccessStatusCode%20StatusCode%20ReasonPhrase%0A---------%20-------------------%20----------%20------------%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20True%20%20%20%20%20%20%20%20%20OK%20OK%0APS%20C%3A%5CWINDOWS%5Csystem32%26gt%3B%20%24spID%20%3D%20(Get-AzVM%20-ResourceGroupName%20ManagedIdentityLab%20%20-Name%20vm-running-app).identity.principalid%0APS%20C%3A%5CWINDOWS%5Csystem32%26gt%3B%20%24spID%0Af9733206-1fcb-42c9-abc9-a75d1b68d52b%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E3.%20Now%20we%20can%20assign%20this%20principal%20ID%20Reader%20access%20to%20Azure%20Key%20Vault%20we%20created%20in%20first%20step.%20We%20do%20this%20by%20assigning%20RBAC%20role%3A%20Reader%20to%20the%20principal%20ID%20assigned%20to%20the%20VM%20in%20step%202.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3EPS%20C%3A%5CWINDOWS%5Csystem32%26gt%3B%20New-AzRoleAssignment%20-ObjectId%20%24spID%20-RoleDefinitionName%20%22Reader%22%20-Scope%20%2Fsubscriptions%2F%3CREDACTED%3E%2FresourceGroups%2FManagedIdentityLab%2Fproviders%2FMicrosoft.KeyVault%2Fvaults%2Fdummy-keyvault%0A%0A%0ARoleAssignmentId%20%20%20%3A%20%2Fsubscriptions%2F%3CREDACTED%3E%2FresourceGroups%2FManagedIdentityLab%2Fproviders%2FMicrosoft.KeyVault%2Fvaults%2Fdummy-keyvault%2Fproviders%2FMicrosoft.Authorization%2FroleAssignments%2F780e1100-f4a0-44a8-a8ee-79c5%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20588c3e17%0AScope%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3A%20%2Fsubscriptions%2F%3CREDACTED%3E%2FresourceGroups%2FManagedIdentityLab%2Fproviders%2FMicrosoft.KeyVault%2Fvaults%2Fdummy-keyvault%0ADisplayName%20%20%20%20%20%20%20%20%3A%20vm-running-app%0ASignInName%20%20%20%20%20%20%20%20%20%3A%0ARoleDefinitionName%20%3A%20Reader%0ARoleDefinitionId%20%20%20%3A%20acdd72a7-3385-48ef-bd32-f606fba81ae7%0AObjectId%20%20%20%20%20%20%20%20%20%20%20%3A%20f9733206-1fcb-42c9-abc9-a75d1b68d52b%0AObjectType%20%20%20%20%20%20%20%20%20%3A%20ServicePrincipal%0ACanDelegate%20%20%20%20%20%20%20%20%3A%20False%0ADescription%20%20%20%20%20%20%20%20%3A%0AConditionVersion%20%20%20%3A%0ACondition%20%20%20%20%20%20%20%20%20%20%3A%0A%0APS%20C%3A%5CWINDOWS%5Csystem32%26gt%3B%3C%2FREDACTED%3E%3C%2FREDACTED%3E%3C%2FREDACTED%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E4.%20We%20are%20now%20all%20set%20to%20access%20the%20keyvault%20from%20the%20python3%20interactive%20shell%20on%20ubuntu%20VM%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-python%22%3E%3CCODE%3E%26gt%3B%26gt%3B%26gt%3B%20from%20azure.identity%20import%20ManagedIdentityCredential%0A%26gt%3B%26gt%3B%26gt%3B%20credentials%3DManagedIdentityCredential()%0A%26gt%3B%26gt%3B%26gt%3B%20import%20os%0A%26gt%3B%26gt%3B%26gt%3B%20import%20cmd%0A%26gt%3B%26gt%3B%26gt%3B%20keyVaultName%20%3D%20os.environ%5B%22KEY_VAULT_NAME%22%5D%0A%26gt%3B%26gt%3B%26gt%3B%20KVUri%20%3D%20f%22https%3A%2F%2F%7BkeyVaultName%7D.vault.azure.net%22%0A%26gt%3B%26gt%3B%26gt%3B%20from%20azure.keyvault.secrets%20import%20SecretClient%0A%26gt%3B%26gt%3B%26gt%3B%20client%20%3D%20SecretClient(vault_url%3DKVUri%2C%20credential%3Dcredentials)%0A%26gt%3B%26gt%3B%26gt%3B%20retrieved_secret%20%3D%20client.get_secret(%22ExamplePassword%22)%0A%26gt%3B%26gt%3B%26gt%3B%0A%26gt%3B%26gt%3B%26gt%3B%20retrieved_secret%0A%3CKEYVAULTSECRET%3E%0A%26gt%3B%26gt%3B%26gt%3B%20retrieved_secret.%0Aretrieved_secret.id%20%20%20%20%20%20%20%20%20%20retrieved_secret.name%20%20%20%20%20%20%20%20retrieved_secret.properties%20%20retrieved_secret.value%0A%26gt%3B%26gt%3B%26gt%3B%20retrieved_secret.value%0A'abc%40123'%0A%26gt%3B%26gt%3B%26gt%3B%0A%3C%2FKEYVAULTSECRET%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EVoila!%20We%20can%20fetch%20the%20secret%20from%20the%20AKV%20without%20having%20to%20store%20the%20secret%20anywhere.%20The%20class%26nbsp%3BManagedIdentityCredential%20in%20azure-identity%20package%20fetches%20the%20VM's%20managed%20identity%20client%20ID.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20magic%20that%20happens%20behind%20the%20scene%20is%20described%20below%3A%3CBR%20%2F%3E%3CBR%20%2F%3E1.%20As%20soon%20as%20the%20client.get_secret%20method%20is%20called%20to%20fetch%20secret%20from%20AKV%2C%20an%20http%20request%20is%20made%20to%20the%20AKV%20url.%20The%20response%20back%20is%20http%20401%20error%2C%20since%20the%20request%20header%20does%20not%20have%20a%20valid%20token.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3EINFO%3Aazure.core.pipeline.policies.http_logging_policy%3ARequest%20URL%3A%20'https%3A%2F%2Fdummy-keyvault.vault.azure.net%2Fsecrets%2FExamplePassword%2F%3Fapi-version%3DREDACTED'%0AINFO%3Aazure.core.pipeline.policies.http_logging_policy%3ARequest%20method%3A%20'GET'%0AINFO%3Aazure.core.pipeline.policies.http_logging_policy%3AResponse%20status%3A%20401%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E2.%20Post%20this%20failure%2C%20another%20request%20is%20made%20to%20the%20AAD%20to%20get%20the%20token%20for%20the%20managed%20identity%20associated%20with%20the%20ubuntu%20VM.%20The%20response%20returned%20back%20is%20the%20access%20token%20%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3EINFO%3Aazure.core.pipeline.policies.http_logging_policy%3ARequest%20URL%3A%20'http%3A%2F%2F169.254.169.254%2Fmetadata%2Fidentity%2Foauth2%2Ftoken%3Fapi-version%3DREDACTED%26amp%3Bresource%3DREDACTED'%0AINFO%3Aazure.core.pipeline.policies.http_logging_policy%3ARequest%20method%3A%20'GET'%0AINFO%3Aazure.core.pipeline.policies.http_logging_policy%3AResponse%20status%3A%20200%0AINFO%3Aazure.core.pipeline.policies.http_logging_policy%3AResponse%20headers%3A%0A%0A%20%20%20%20%22response%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22access_token%22%3A%20%22********%22%2C%0A%20%20%20%20%20%20%20%20%22client_id%22%3A%20%221699a4a0-2f2a-4696-b483-dd32a950349a%22%2C%0A%20%20%20%20%20%20%20%20%22expires_in%22%3A%20%2285295%22%2C%0A%20%20%20%20%20%20%20%20%22expires_on%22%3A%201610038816%2C%0A%20%20%20%20%20%20%20%20%22ext_expires_in%22%3A%20%2286399%22%2C%0A%20%20%20%20%20%20%20%20%22not_before%22%3A%20%221609952116%22%2C%0A%20%20%20%20%20%20%20%20%22resource%22%3A%20%22https%3A%2F%2Fvault.azure.net%22%2C%0A%20%20%20%20%20%20%20%20%22token_type%22%3A%20%22Bearer%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22scope%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%22https%3A%2F%2Fvault.azure.net%2F.default%22%0A%20%20%20%20%5D%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E3.%20Finally%2C%20the%20access%20token%20retrieved%20from%20step%202%20is%20used%20in%20the%20header%20to%20reattempt%20step%201.%20When%20AKV%20receives%20the%20request%20this%20time%2C%20it%20validates%20the%20access%20token%20against%20AAD.%20Since%20the%20access%20token%20is%20valid%2C%20the%20request%20is%20allowed%20to%20read%20the%20secret%20and%20we%20get%20a%20http%20200%20response%20back.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3EINFO%3Aazure.identity._internal.decorators%3AManagedIdentityCredential.get_token%20succeeded%0AINFO%3Aazure.core.pipeline.policies.http_logging_policy%3ARequest%20URL%3A%20'https%3A%2F%2Fdummy-keyvault.vault.azure.net%2Fsecrets%2FExamplePassword%2F%3Fapi-version%3DREDACTED'%0AINFO%3Aazure.core.pipeline.policies.http_logging_policy%3ARequest%20method%3A%20'GET'%0AINFO%3Aazure.core.pipeline.policies.http_logging_policy%3ARequest%20headers%3A%0AINFO%3Aazure.core.pipeline.policies.http_logging_policy%3AResponse%20status%3A%20200%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20%3CSTRONG%3Esummarize%3C%2FSTRONG%3E%2C%20managed%20identity%20allows%20the%20apps%20running%20on%20Azure%20resources%20to%20authenticate%20against%20AAD%20without%20having%20to%20store%20credentials.%20This%20is%20super%20convenient%20and%20compliant%2C%20also%20eliminates%20the%20need%20to%20rotate%20the%20client%20secret%20upon%20compromise%20or%20expiration.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2035097%22%20slang%3D%22en-US%22%3E%3CP%3EManaged%20Identities%20are%20a%20great%20way%20to%20eliminate%20the%20need%20to%20store%20credentials%20in%20the%20source%20code%2C%20and%20retrieve%20token%20from%20Azure%20AD%20while%20abstracting%20the%20entire%20process%20for%20apps%20running%20on%20Azure%20resources.%20Learn%20how%20it%20works%20and%20what%20magic%20happens%20on%20the%20backend!%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22credentials%20in%20code.png%22%20style%3D%22width%3A%20550px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F244455i5539E67B2F6027CB%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22credentials%20in%20code.png%22%20alt%3D%22credentials%20in%20code.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2035097%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Active%20Directory%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%20Resource%20Manager%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDesktop%20Apps%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPython%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWeb%20Apps%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Version history
Last update:
‎Jan 06 2021 09:39 AM
Updated by: