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]: principalId and tenantId in ManagedServiceIdentity should be of type uuid ARM consistency #845

Open
4 tasks done
Tracked by #2766 ...
XiaofeiCao opened this issue May 16, 2024 · 6 comments
Open
4 tasks done
Tracked by #2766 ...
Labels
bug Something isn't working lib:azure-resource-manager Issues for @azure-tools/typespec-azure-core library
Milestone

Comments

@XiaofeiCao
Copy link
Contributor

XiaofeiCao commented May 16, 2024

Describe the bug

BUG

TypeSpec definition:

model ManagedServiceIdentity {
@doc("The Active Directory tenant id of the principal.")
@visibility("read")
tenantId?: string;
@doc("The active directory identifier of this principal.")
@visibility("read")
principalId?: string;

Though in Swagger's common-types v5, it's defined as

"principalId": {
  "readOnly": true,
  "format": "uuid",
  "type": "string",
  "description": "The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity."
},
"tenantId": {
  "readOnly": true,
  "format": "uuid",
  "type": "string",
  "description": "The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity."
},

v3, v4 are uuids also.

Java mgmt SDK will generate type UUID for "format": "uuid". Lacking this mark will break Java SDK.

Expected behavior

These two properties should have @format("uuid") be of type uuid:

@doc("The Active Directory tenant id of the principal.")
@visibility("read")
//@format("uuid")
//tenantId?: string;
tenantId?: uuid;

@doc("The active directory identifier of this principal.")
@visibility("read")
//@format("uuid")
//principalId?: string;
principalId?: uuid;

Reproduction

In the description

Checklist

  • Follow our Code of Conduct
  • Check that this issue is about the Azure libraries for typespec. For bug in the typespec language or core libraries file it in the TypeSpec repo
  • Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.
@timotheeguerin
Copy link
Member

Should change to have uuid type not @format("uuid")

@XiaofeiCao XiaofeiCao changed the title [Bug]: principalId and tenantId in ManagedServiceIdentity should be marked @format("uuid") [Bug]: principalId and tenantId in ManagedServiceIdentity should be of type uuid May 17, 2024
@XiaofeiCao
Copy link
Contributor Author

@timotheeguerin This will impact MPG for Java and Go(@tadelesh for confirmation). I can help with a PR.

@pshao25
Copy link
Member

pshao25 commented May 28, 2024

@timotheeguerin This will impact MPG for Java and Go(@tadelesh for confirmation). I can help with a PR.

Could you do this together? #863

@timotheeguerin
Copy link
Member

The change is ok, PR welcome, the only thing is this can be a breaking change for the providerhub controller generation

@XiaofeiCao
Copy link
Contributor Author

XiaofeiCao commented May 29, 2024

@timotheeguerin Another discrepancy for ManagedServiceIdentity: #931

I don't have much context for providerhub controller. I'll put them together in a PR as a start.

@allenjzhang allenjzhang changed the title [Bug]: principalId and tenantId in ManagedServiceIdentity should be of type uuid [Bug]: principalId and tenantId in ManagedServiceIdentity should be of type uuid ARM consistency May 30, 2024
@markcowl markcowl added this to the [2024] July milestone May 30, 2024
@markcowl markcowl added the lib:azure-resource-manager Issues for @azure-tools/typespec-azure-core library label May 30, 2024
@allenjzhang
Copy link
Member

fixed in pending PR. #945

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lib:azure-resource-manager Issues for @azure-tools/typespec-azure-core library
Projects
None yet
Development

No branches or pull requests

5 participants