Azure / azure-sdk-for-go

This repository is for active development of the Azure SDK for Go. For consumers of the SDK we recommend visiting our public developer docs at:
https://docs.microsoft.com/azure/developer/go/
MIT License
1.65k stars 844 forks source link

There is a mismatch result between sdk and direct api call on armstorage package which is function queueServices #20575

Open ahmetdemirbas opened 1 year ago

ahmetdemirbas commented 1 year ago

Bug Report

There is a mismatch result between sdk and direct api call.

When I call queueServices via Postman, result as bellow

https://management.azure.com/subscriptions/---/resourceGroups/cloud-shell-storage-westeurope/providers/Microsoft.Storage/storageAccounts/-----/queueServices/default?api-version=2022-09-01

{
    "id": "/subscriptions/---------/resourceGroups/cloud-shell-storage-westeurope/providers/Microsoft.Storage/storageAccounts/-------/queueServices/default",
    "name": "default",
    "type": "Microsoft.Storage/storageAccounts/queueServices",
    "properties": {
        "logging": {
            "version": "1.0",
            "delete": false,
            "read": false,
            "write": false,
            "retentionPolicy": {
                "enabled": false
            }
        },
        "cors": {
            "corsRules": []
        }
    }
}

When I call via SDK, there is no logging property.

My Function :

client, err := armstorage.NewQueueServicesClient(subscriptionId, cred, nil)
    if err != nil {
        constants.Log.WithError(errors.New(err.Error())).WithField("UserID", "foo").Error("error calling Azure management API in AzureResourceGroupSave function")
    }

    resp, err := client.GetServiceProperties(ctx, resourceGroup, accountName, nil)
    if err != nil {
        constants.Log.WithError(errors.New(err.Error())).WithField("UserID", "foo").Error("error calling Azure management API in AzureResourceGroupSave function")
    }

return resp

Thanks!

ghost commented 1 year ago

Hi @ahmetdemirbas. Thank you for your feedback and we will look into it soon. Meanwhile, feel free to share your experience using the Azure SDK in this survey.

tadelesh commented 1 year ago

@ahmetdemirbas thank you for your feedback. Our SDK is generated from swagger definition. There is no logging property defined in the spec. I'll involve service team to fix the swagger issue.

ghost commented 1 year ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.

Issue Details
### Bug Report - import path of package in question, e.g. `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage` - SDK version e.g. `master` - `go version go1.20.2 darwin/amd64` There is a mismatch result between sdk and direct api call. When I call queueServices via Postman, result as bellow https://management.azure.com/subscriptions/---/resourceGroups/cloud-shell-storage-westeurope/providers/Microsoft.Storage/storageAccounts/-----/queueServices/default?api-version=2022-09-01 ``` { "id": "/subscriptions/---------/resourceGroups/cloud-shell-storage-westeurope/providers/Microsoft.Storage/storageAccounts/-------/queueServices/default", "name": "default", "type": "Microsoft.Storage/storageAccounts/queueServices", "properties": { "logging": { "version": "1.0", "delete": false, "read": false, "write": false, "retentionPolicy": { "enabled": false } }, "cors": { "corsRules": [] } } } ``` When I call via SDK, there is no logging property. My Function : ``` client, err := armstorage.NewQueueServicesClient(subscriptionId, cred, nil) if err != nil { constants.Log.WithError(errors.New(err.Error())).WithField("UserID", "foo").Error("error calling Azure management API in AzureResourceGroupSave function") } resp, err := client.GetServiceProperties(ctx, resourceGroup, accountName, nil) if err != nil { constants.Log.WithError(errors.New(err.Error())).WithField("UserID", "foo").Error("error calling Azure management API in AzureResourceGroupSave function") } return resp ``` Thanks!
Author: ahmetdemirbas
Assignees: tadelesh
Labels: `question`, `Storage`, `Service Attention`, `customer-reported`
Milestone: -