skip to Main Content

I need to make the code that will check the resources of their azure portal.
For example user a logins the this API will hit GET https://management.azure.com/subscriptions/{subscriptionId}/resources?api-version=2021-04-01

and the subscription ID will pass automatically of user a.
How do I authenticate the user?
How do I get their subscription ID in PHP code? So every user will be able to fetch their resources details on the website by simply login.
What should I do.

2

Answers


    1. Sign in to the Azure portal.
    2. Under the Azure services heading, select Subscriptions. (If no subscriptions are listed, you may need to switch Azure AD tenants.) Your Subscription IDs are listed in the second column.
    3. Copy the Subscription ID and paste it into a text document of your choice for use later.
    Login or Signup to reply.
  1. You can use the Azure REST API to list subscriptions. NOTE: a user may have more than one subscription under the current tenant and it will return all subscriptions that user has access to.

    REST GET Subscriptions

    GET https://management.azure.com/subscriptions?api-version=2020-01-01

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

    Rest API reference

    https://learn.microsoft.com/en-us/rest/api/azure/

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search