0
votes

I am using azure rest API for get all resources in my azure portal.

https://docs.microsoft.com/en-us/rest/api/resources/resources/list

Currently it will authenticated by access token. Is there any option to get azure access token by using only subscription id?

Note :Authenticate without using Azure AD.

1
I don't think you can do that.Joy Wang-MSFT
Is any option create life time access token in azure portal and use that token in code?Jinesh
AFAIK, no. If you could accept create the access token manually, why don't you get the token via click the Try it button?Joy Wang-MSFT
Is any option create life time access token in azure portal and use that token in code? - Why do you want to do that? I am just curious to know your use case. Please edit your question and explain the use case. There may be some viable alternatives available.Gaurav Mantri
Generate access token without using AD.Jinesh

1 Answers

1
votes

Is there any option to get azure access token by using only subscription id?

You can't do it because a user gets authenticated and authorized before accessing an Azure Subscription and information about a user is stored in Azure AD.

Is any option create life time access token in azure portal and use that token in code?

You can't do that either. Maximum duration for which an access token can be valid is 1 day (minimum is 10 minutes and default is 1 hour). You can read more about token lifetime here: https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-configurable-token-lifetimes.