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] CosmosDBSqlRoleAssignment doesn't support setting name property #47979

Open
captainsafia opened this issue Jan 24, 2025 · 2 comments
Open
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. Provisioning

Comments

@captainsafia
Copy link

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

@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jan 24, 2025
@jsquire jsquire added Client This issue points to a problem in the data-plane of the library. Provisioning and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jan 24, 2025
@captainsafia
Copy link
Author

Edit: it also appears that the Name property is erroneously marked as an output here.

@eerhardt
Copy link
Member

Here's where it says it is an output:

_name = DefineProperty<string>("Name", ["name"], isOutput: true);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. Provisioning
Projects
None yet
Development

No branches or pull requests

4 participants