Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to manage reservations? #25

Open
kelnerrr opened this issue Feb 9, 2022 · 3 comments
Open

How to manage reservations? #25

kelnerrr opened this issue Feb 9, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@kelnerrr
Copy link

kelnerrr commented Feb 9, 2022

Hi,

is there any way to to manage Reservations with AzureRMR?
I'm thinking about getting the list of Reservation Orders and then the list of all Reservations.

I was trying to get the resource with:

az <- get_azure_login()
az_resource$new(
  token = az$token$credentials$access_token,
  subscription = sub_id, 
  id = "/providers/microsoft.capacity/reservationOrders/{guid}/"
)

When I added the required subscription parameter I got this:

Error: No API versions found
In addition: Warning message:
No stable API versions found, falling back to the latest preview version

That would be great to have a possibility to manage Reservations.
What I need now would be to only assign permissions for people/groups to the Reservation Orders.

@hongooi73
Copy link
Collaborator

Have you tried it using the recommended approach?

az <- get_azure_login()
az$
  get_subscription(...)$
  get_resource_group("resgroupname")$
  create_resource(
    type="microsoft.capacity/reservationOrders",
    name="whatever"
  )

@kelnerrr
Copy link
Author

kelnerrr commented Feb 9, 2022

Reservations are a strange thing and are not under any resource group.
They are billed on a specific subscription but may be used by other subscriptions as well. So probably they do not even belong to a subscription (not counting for billing purposes).
Unfortunately, I do not know how the reservations look under the hood.

@hongooi73 hongooi73 added the enhancement New feature or request label Feb 9, 2022
@kelnerrr
Copy link
Author

I found a confirmation that a reservation is not a subscription's resource.

The reservation lifecycle is independent of an Azure subscription, so the reservation isn't a resource under the Azure subscription. Instead, it's a tenant-level resource with its own Azure RBAC permission separate from subscriptions.

Source: https://docs.microsoft.com/en-us/azure/cost-management-billing/reservations/view-reservations?toc=%2Fazure%2Fcost-management-billing%2Freservations%2Ftoc.json#who-can-manage-a-reservation-by-default

Would there be any way to manage such a resource with AzureRMR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants