title: Is there a way to get Azure Subscription ID programmatically?
body: <p>We would like to create some Azure resources using Azure Rest APIs through a C# program. We are able to get access token by following the below msdn doc
  <a href="https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-v2-protocols-oauth-code" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-v2-protocols-oauth-code</a> .
  But the Azure Rest APIs also requires Subscription ID which we are not able to get. Is there a way we can get it through program? </p>
  
  <p>Thanks</p>
  
  <p>Balaji</p>