How get all azure reservations with application permission

Van Vo Hai 80 Reputation points
2024-10-21T03:54:08.0166667+00:00

Hi supporters,

I want to get all reserved instances that I have seen on the reservations page using application permissions. The API I used is this one. https://learn.microsoft.com/en-us/rest/api/reserved-vm-instances/reservation/list-all?view=rest-reserved-vm-instances-2022-11-01&tabs=HTTP

However, I could not achieve that. After reading the document for permissions, I have the following questions:

  1. Can I achieve this using application permissions?
  2. I understand that the user or application (if allowed) requires either the Reservations Administrator or Reservations Reader role at the tenant level. Can I assign roles at the tenant level via the REST API, or is it only supported through PowerShell?

Thank,

Microsoft Entra
0 comments No comments
{count} votes

Accepted answer
  1. Navya 12,405 Reputation points Microsoft Vendor
    2024-10-22T06:44:28.6533333+00:00

    Hi @Van Vo Hai

    Thank you for posting this in Microsoft Q&A.

    I understand that you want to retrieve all Azure reservations using application permissions, and you have a few queries about it.

    Can I achieve this using application permissions?

    No, unfortunately you can't achieve this using application permissions.

    I understand that the user or application (if allowed) requires either the Reservations Administrator or Reservations Reader role at the tenant level. Can I assign roles at the tenant level via the REST API, or is it only supported through PowerShell?

    Yes, you can assign roles at the tenant level via the REST API

    For your reference: https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-rest

    Hope this helps. Do let us know if you any further queries.

    Thanks,

    Navya.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.