azure-sdk-for-go: List Tenants returns nil for DisplayName & Domains instead of its actual values
Bug Report
-
import path of package in question services/resources/mgmt/2019-11-01/subscriptions/
-
SDK version 44.0.0
- Specify the exact commit if possible;
github.com/Azure/azure-sdk-for-go ^44.0.0 v44.0.0 c536f2d v44.0.0 15
github.com/Azure/go-autorest ^14.0.0 v14.1.1 778ae56 v14.2.0 10
- Specify the exact commit if possible;
github.com/Azure/azure-sdk-for-go ^44.0.0 v44.0.0 c536f2d v44.0.0 15
-
output of
go versiongo version go1.14 darwin/amd64
In detail: So, I am doing the following:
tenantList, err := client.List(context.Background())
This returns an array of tenants in tenantList.Values()
When I go over the array, I see that for the tenant, only tenantID and ID are populated and not the Domain and DisplayName as mentioned here: https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-11-01/subscriptions?tab=doc#TenantIDDescription
- What happened?
Not getting Domain & DisplayName
- What did you expect or want to happen?
I should have received it in the response as I see it here: https://docs.microsoft.com/en-us/rest/api/resources/tenants/list
- How can we reproduce it?
Create a New Tenants Client as follows:
`client := subscriptions.NewTenantsClient() client.Authorizer = sess.Authorizer
and then do the tenantList, err := client.List(context.Background()) and go over the tenants list`
Here’s a tenant: {0xc001cf43f0 0xc001cd6a00 Home <nil> <nil> <nil> <nil>}
As you can see except the TenantCategory (Home), Id & TenantId, everything else is set to nil which should not be the case.
- Anything we should know about your environment. Nothing special about the environment.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 17 (5 by maintainers)
Hi @ArcturusZhang Thank you for directing it to the right team. On my Golang SDK, I am using api-version as 2019-11-01 because that’s the latest available version of subscriptions package. I doubt the problem is on the service because when I use https://docs.microsoft.com/en-us/rest/api/resources/tenants/list for the same subscription, I see DisplayName & Domains being returned correctly and I confirmed it from the portal as well.
@ArcturusZhang Thank you for the quick response. I tried ListComplete as well but my problem is different. I understand the issue with pagination. My issue is - I have a single tenant in a subscription - It is not returning the DisplayName & Domains for that tenant. I get the TenantId, TenantCategory and Id but not the DisplayName & Domains using the Golang SDK.
I tried the REST API (https://docs.microsoft.com/en-us/rest/api/resources/tenants/list) for my subscription and I get all the attributes for the same tenant, even the Domains & the DisplayName so the error is in this SDK which is not populating the entire response from the server.