Skip to content

[BUG] CosmosDBSqlRoleAssignment doesn't support setting name property #47979

Open
@captainsafia

Description

@captainsafia

Library name and version

Azure.Provisioning 1.0.0

Describe the bug

The CosmosDBSqlRoleAssignment type defined in the library doesn't expose a setter for the Name property, making it impossible to set on an instantiated type.

public BicepValue<string> Name
{
get { Initialize(); return _name!; }
}
private BicepValue<string>? _name;

Expected behavior

Name should be a settable property on the resource.

Actual behavior

Calling the following:

var roleAssignment = new CosmosDBSqlRoleAssignment(Infrastructure.NormalizeBicepIdentifier("roleAssignment"))
{
    PrincipalId = principalIdParameter,
    Scope = cosmosDbAccount.Id,
    Parent = cosmosDbAccount,
};

will produce incomplete bicep:

resource roleAssignment 'Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments@2024-08-15' = {
  properties: {
    principalId: principalId
    scope: cosmosdb.id
  }
  parent: cosmosdb
}

Reproduction Steps

var roleAssignment = new CosmosDBSqlRoleAssignment(Infrastructure.NormalizeBicepIdentifier("roleAssignment"))
{
    PrincipalId = principalIdParameter,
    Scope = cosmosDbAccount.Id,
    Parent = cosmosDbAccount,
};

Environment

No response

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.Provisioning

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions