Open puntakana opened 1 year ago
This is from our legacy SDK which is in maintenance mode and is likely outdated. The latest SDK for reservations
can be found here. Can you please migrate and see if it resolves your issue?
Hi @puntakana. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.
Hi @jhendrixMSFT,
Thank you for the response. I just tried the latest SDK (v3.0.1), but I'm experiencing the same symptoms (I only list reservations with an inherited right). I followed the example in the documentation:
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewReservationOrderClient().NewListPager(nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
fmt.Printf("id: %v ||| ProvisioningState: %#v\n", *v.ID, *v.Properties.ProvisioningState)
}
}
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Rkapso.
Bug Report
Our symptom
I want to retrieve reservations by importing: github.com/Azure/azure-sdk-for-go/profiles/latest/reservations/mgmt/reservations and sdk version : v68.0.0
The problem is that when using this code:
I don't get the full list of reservations (or at least the ones my user has access to). In fact, when going through the portal (reservations section), or using the az reservations list command, or even with this Python code:
I can see many more reservations.
Upon further investigation, I've noticed that there is a difference in the IAM part.
For reservations where I don't have an inherited right, the Golang code does not allow me to see the reservation. However, if I have an inherited IAM (Identity and Access Management) right in this case, the Golang code allows me to see the reservation.
Do you have any idea what I might be doing wrong in my Golang code or maybe is it a bug in go-sdk ?