Skip to content

[BUG] Data Factory API spec returns PascalCase fields causing SDK unmarshalling failures (KeyName / VaultBaseUrl mismatch) #39182

@matthewyuh246

Description

@matthewyuh246

API Spec link

https://github.com/Azure/azure-rest-api-specs/blob/8eb3f7a4f66d408152c32b9d647e59147172d533/specification/datafactory/resource-manager/Microsoft.DataFactory/stable/2018-06-01/datafactory.json

API Spec version

2018-06-01

Describe the bug

The Data Factory REST API returns encryption fields using PascalCase (KeyName, VaultBaseUrl, KeyVersion), but the API spec defines these fields as camelCase (keyName, vaultBaseUrl, keyVersion).

Because the SDK is generated from the spec, the Go SDK's UnmarshalJSON only recognizes camelCase keys, causing these fields to remain nil even when encryption is configured.

This behavior has been confirmed in SDK versions v8, v9, and v10.

Related SDK issue: Azure/azure-sdk-for-go#25725


Proposed Solution

I would be happy to contribute a fix once the correct approach is confirmed.

Possible approaches include:

  1. Update the API spec to use PascalCase field names (KeyName, VaultBaseUrl, KeyVersion)
  2. Add explicit serialization metadata (e.g., x-ms-client-name) to align with actual REST API behavior

I am willing to open a PR once the maintainers advise which approach is appropriate.

Expected behavior

The API spec should accurately reflect the casing used in the REST API response.

The encryption fields should be defined as:

  • KeyName (not keyName)
  • VaultBaseUrl (not vaultBaseUrl)
  • KeyVersion (not keyVersion)

Alternatively, explicit serialization metadata should be added so SDKs can correctly unmarshal responses regardless of casing.

Actual behavior

The REST API returns PascalCase fields:

{
  "properties": {
    "encryption": {
      "KeyName": "my-cmk-key",
      "VaultBaseUrl": "https://my-keyvault.vault.azure.com",
      "KeyVersion": "abc123"
    }
  }
}

However, the SDK expects camelCase fields based on the spec, so all encryption fields are unmarshalled as nil.

This prevents applications from:

  • Detecting whether CMK encryption is enabled
  • Auditing encryption configurations
  • Validating Data Factory security posture

Reproduction Steps

  1. Create an Azure Data Factory with CMK encryption enabled
  2. Call the REST API to get the Data Factory properties:
    az rest --method GET --url "https://management.azure.com/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.DataFactory/factories/{factoryName}?api-version=2018-06-01"
  3. Observe that the response contains PascalCase fields (KeyName, VaultBaseUrl, KeyVersion)
  4. Use the Azure Go SDK (v8/v9/v10) to retrieve the same Data Factory
  5. Observe that the encryption fields are nil despite being set

Environment

  • Azure Go SDK versions: v8, v9, v10
  • API version: 2018-06-01
  • Verified using: az rest command

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions