I have a long running ADF pipeline that uses a token for management.azure.com to query data from the ADF API. Is it possible to get a refresh token which should have a much longer life than the +-1 hour life of the normal access token? I've seen with other scopes you can use offline_access to get the refresh token but this doesn't seem valid for management.azure.com. Currently I'm doing a post to https://login.microsoftonline.com/{TenantId}/oauth2/v2.0/token with the following request body and successfully getting back an access token.
grant_type=client_credentials
client_id=XXXXX
client_secret=XXXXX
scope=https://management.azure.com/.default
Instead, you can try to increase the access token lifetime by using the below Microsoft Graph API query:
The access token now is valid for 24 hours:
References:
Set lifetimes for tokens using PowerShell - Microsoft identity platform | Microsoft
Create tokenLifetimePolicy - Microsoft Graph v1.0 | Microsoft