azure-sdk-for-go: `sql.ServersClient` `List` function results do not match the CLI (`az sql server list`) results
Bug Report
- import path of package in question -
github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql - SDK version -
65.0.0+incompatible go version go1.18.2 darwin/arm64
- What happened?
- When I use the CLI and call
az sql server list, a list of SQL servers is returned. - When using the SDK, an empty list is returned.
for page, err := client.SqlServer.List(context.Background(), ""); page.NotDone(); err = page.Next() {
if err != nil {
panic(err)
}
for _, server := range page.Values() {
fmt.Printf("found server %s\n", *server.Name)
}
}
-
What did you expect or want to happen? I expected the SDK to return the same servers found when using the CLI.
-
How can we reproduce it?
- Create an SQL server
- Call
az sql server listto see the server in the list. - Now try calling the
Listfunction from agoprogram.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (5 by maintainers)
@navba-MSFT I’m still seeing the same error message after granting “SQL DB Contributor” permissions. I’ll open a support ticket with Microsoft. Thanks
@kany Thanks for the log. Nothing return from HTTP for subscription
85513e74-2aae-4f6d-bb54-0549a72dcacd. I’ll let service team to have a look.