[Bug Report] `userId` in live test response is `int32` but after sanitized the type become `string`
- Dominant language
- C#
- Stars
- 135
- Forks
- 260
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 143
Description
repro:
sdk: sdk\resourcemanager\storage\armstorage\storage_live_test.go
add [logging](https://github.com/Azure/azure-sdk-for-go/blob/main/documentation/development/ARM/new-version-guideline.md#logging) config in func `TestLocalUsers`
``` test code
func (testsuite *StorageTestSuite) TestLocalUsers() {
username := "storageuser"
var err error
testsuite.options.Logging = policy.LogOptions{
// include HTTP body for log
IncludeBody: true,
}
// From step LocalUsers_CreateOrUpdate
fmt.Println("Call operation: LocalUsers_CreateOrUpdate")
localUsersClient, err := armstorage.NewLocalUsersClient(testsuite.subscriptionId, testsuite.cred, testsuite.options)
testsuite.Require().NoError(err)
_, err = localUsersClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.accountName, username, armstorage.LocalUser{
Properties: &armstorage.LocalUserProperties{
HasSSHPassword: to.Ptr(true),
HomeDirectory: to.Ptr("homedirectory"),
PermissionScopes: []*armstorage.PermissionScope{
{
Permissions: to.Ptr("rwd"),
ResourceName: to.Ptr("share1"),
Service: to.Ptr("file"),
},
{
Permissions: to.Ptr("rw"),
ResourceName: to.Ptr("share2"),
Service: to.Ptr("file"),
}},
SSHAuthorizedKeys: []*armstorage.SSHPublicKey{
{
Description: to.Ptr("key name"),
Key: to.Ptr("ssh-rsa keykeykeykeykey="),
}},
},
}, nil)
testsuite.Require().NoError(err)
// From step LocalUsers_List
fmt.Println("Call operation: LocalUsers_List")
localUsersClientNewListPager := localUsersClient.NewListPager(testsuite.resourceGroupName, testsuite.accountName, nil)
for localUsersClientNewListPager.More() {
_, err := localUsersClientNewListPager.NextPage(testsuite.ctx)
testsuite.Require().NoError(err)
break
}
// From step LocalUsers_Get
fmt.Println("Call operation: LocalUsers_Get")
_, err = localUsersClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.accountName, username, nil)
testsuite.Require().NoError(err)
// From step LocalUsers_ListKeys
fmt.Println("Call operation: LocalUsers_ListKeys")
_, err = localUsersClient.ListKeys(testsuite.ctx, testsuite.resourceGroupName, testsuite.accountName, username, nil)
testsuite.Require().NoError(err)
// From step LocalUsers_RegeneratePassword
fmt.Println("Call operation: LocalUsers_RegeneratePassword")
_, err = localUsersClient.RegeneratePassword(testsuite.ctx, testsuite.resourceGroupName, testsuite.accountName, username, nil)
testsuite.Require().NoError(err)
// From step LocalUsers_Delete
fmt.Println("Call operation: LocalUsers_Delete")
_, err = localUsersClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.accountName, username, nil)
testsuite.Require().NoError(err)
}
```
run test command: go test -run TestStorageTestSuite
get response:
```JSON5
{
"id": "/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourceGroups/go-sdk-test-39/providers/Microsoft.Storage/storageAccounts/accountnam1/localusers/storageuser",
"name": "storageuser",
"type": "Microsoft.Storage/storageAccounts/localUsers",
"properties": {
"userId": 1000,
"hasSshPassword": false,
"permissionScopes": [
{
"permissions": "rwd",
"service": "file",
"resourceName": "share1"
},
{
"permissions": "rw",
"service": "file",
"resourceName": "share2"
}
],
"homeDirectory": "homedirectory",
"sid": "S-1-2-0-2736152866-1864178485-1789562599-1000",
"hasSharedKey": false,
"hasSshKey": true
}
}
```
get record in TestStorageTestSuite.json file :
```json5
{
"RequestUri": "https://Sanitized.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Sanitized/providers/Microsoft.Storage/storageAccounts/accountnam1/localUsers/storageuser?api-version=2025-06-01",
"RequestMethod": "GET",
"RequestHeaders": {
"Accept": "application/json",
"Accept-Encoding": "gzip",
"Authorization": "Sanitized",
"User-Agent": "azsdk-go-armstorage/v4.0.0-beta.1 (go1.25.1; Windows_NT)"
},
"RequestBody": null,
"StatusCode": 200,
"ResponseHeaders": {
"Cache-Control": "no-cache",
"Content-Length": "420",
"Content-Type": "application/json",
"Date": "Wed, 18 Mar 2026 10:06:34 GMT",
"Expires": "-1",
"Pragma": "no-cache",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"X-Cache": "CONFIG_NOCACHE",
"X-Content-Type-Options": "nosniff",
"x-ms-correlation-request-id": "00000000-0000-0000-0000-000000000000",
"x-ms-operation-identifier": "tenantId=00000000-0000-0000-0000-000000000000,objectId=00000000-0000-0000-0000-000000000000/westus/00000000-0000-0000-0000-000000000000",
"x-ms-ratelimit-remaining-subscription-global-reads": "16499",
"x-ms-ratelimit-remaining-subscription-reads": "1099",
"x-ms-request-id": "Sanitized",
"x-ms-routing-request-id": "WESTUS:20260318T100634Z:00000000-0000-0000-0000-000000000000",
"X-MSEdge-Ref": "Ref A: 4EEB91D95C194B0C9B229D42001CC0EC Ref B: SG2AA1040517052 Ref C: 2026-03-18T10:06:34Z"
},
"ResponseBody": {
"id": "Sanitized",
"name": "Sanitized",
"type": "Microsoft.Storage/storageAccounts/localUsers",
"properties": {
"userId": "Sanitized",
"hasSshPassword": false,
"permissionScopes": [
{
"permissions": "rwd",
"service": "file",
"resourceName": "share1"
},
{
"permissions": "rw",
"service": "file",
"resourceName": "share2"
}
],
"homeDirectory": "homedirectory",
"sid": "S-1-2-0-2736152866-1864178485-1789562599-1000",
"hasSharedKey": false,
"hasSshKey": true
}
}
},
```
Contributor guide
Research direction
Start with sdk\resourcemanager\storage\armstorage\storage_live_test.go and the TestStorageTestSuite.json recording, then run go test -run TestStorageTestSuite. Compare the live response's numeric properties.userId with its sanitized recording; done means the sanitized fixture preserves the correct response type without breaking the test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- testing-qa, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100