Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Azure ARM/MongodbRoleDefinition response doesn't adhere to schema #4559

Open
petrepopescu21 opened this issue Feb 4, 2025 · 1 comment
Labels
bug 🪲 Something isn't working needs-triage 🔍

Comments

@petrepopescu21
Copy link
Contributor

petrepopescu21 commented Feb 4, 2025

Describe the bug

For the MongodbRoleDefinition API, the schema defines the .properties.type field as an Enum (CustomRole, BuiltInRole), but Azure responds with an int when read via the API

This causes an unmarshaling error, which prevented onboarding the resource in #4550

Azure Service Operator Version: N/A

To Reproduce

az resource show --ids /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg/providers/Microsoft.DocumentDB/databaseAccounts/asotestdb/mongodbRoleDefinitions/asotest-mongo.dboperator

Additional context

generated type

type MongodbRoleDefinition_STATUS struct {
	Conditions     []conditions.Condition `json:"conditions,omitempty"`
	DatabaseName   *string                `json:"databaseName,omitempty"`
	Id             *string                `json:"id,omitempty"`
	Name           *string                `json:"name,omitempty"`
	Privileges     []Privilege_STATUS     `json:"privileges,omitempty"`
	PropertiesType *string                `json:"properties_type,omitempty"`
	PropertyBag    genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	RoleName       *string                `json:"roleName,omitempty"`
	Roles          []Role_STATUS          `json:"roles,omitempty"`
	Type           *string                `json:"type,omitempty"`
}
az resource show --ids /subscriptions/3e8e8f8d-5388-41dd-8cb1-6dd1d418fe76/resourceGroups/asotest-rg-bmupee/providers/Microsoft.DocumentDB/databaseAccounts/asotestdbkgsgso/mongodbRoleDefinitions/asotest-mongo-hamilo.dboperator
{
  "extendedLocation": null,
  "id": "/subscriptions/3e8e8f8d-5388-41dd-8cb1-6dd1d418fe76/resourceGroups/asotest-rg-bmupee/providers/Microsoft.DocumentDB/databaseAccounts/asotestdbkgsgso/mongodbRoleDefinitions/asotest-mongo-hamilo.dboperator",
  "identity": null,
  "kind": null,
  "location": null,
  "managedBy": null,
  "name": "dboperator",
  "plan": null,
  "properties": {
    "databaseName": "asotest-mongo-hamilo",
    "privileges": [
      {
        "actions": [
          "dbStats"
        ],
        "resource": {
          "db": "asotest-mongo-hamilo"
        }
      }
    ],
    "roleName": "dboperator",
    "roles": [],
    "type": 1
  },
  "resourceGroup": "asotest-rg-bmupee",
  "sku": null,
  "tags": null,
  "type": "Microsoft.DocumentDB/databaseAccounts/mongodbRoleDefinitions"
}
@matthchr
Copy link
Member

We've engaged the owning service team on this and will update when we have more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working needs-triage 🔍
Projects
Development

No branches or pull requests

2 participants