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

AKS resource missing IdentityProfile property #1936

Closed
JimPaine opened this issue Mar 19, 2021 · 6 comments
Closed

AKS resource missing IdentityProfile property #1936

JimPaine opened this issue Mar 19, 2021 · 6 comments
Labels

Comments

@JimPaine
Copy link
Contributor

JimPaine commented Mar 19, 2021

Bicep version
Bicep CLI version 0.3.1 (d0f5c9b)

Describe the bug

** UPDATED **
On an AKS recourse the identityprofile object appears to be empty as I can not discover kubeletidentity and if I put it in anyway I get an error that object id doesn't exist.

Related to: #1935

To Reproduce

Add a role assignment and try and set the principalId from the kubeletidentity under identityprofile.

** UPDATED **
image

Additional context

** UPDATED **

@ghost ghost added the Needs: Triage 🔍 label Mar 19, 2021
@anthony-c-martin
Copy link
Member

anthony-c-martin commented Mar 19, 2021

@JimPaine - you should be able to use scope to get type validation for the Microsoft.Authorization/roleAssignments resource type:

resource roleDef 'Microsoft.Authorization/roleDefinitions@2015-07-01' existing = {
  scope: subscription()
  name: '7f951dda-4ed3-4680-a7ca-43fe172d538d'
}

resource acrrole 'Microsoft.Authorization/roleAssignments@2015-07-01' = {
  name: guid(acr.id, 'AcrPull')
  scope: acr
  properties: {
    roleDefinitionId: roleDef.id
    principalId: aks.properties.identityProfile.kubeletidentity.objectId
    principalType: 'ServicePrincipal'
  }
}

@JimPaine
Copy link
Contributor Author

Thanks @anthony-c-martin I have now closed the issue #1935 around the scope item, though I would be interested to understand the overlap between 'scope' and the upcoming 'parent' property :D but that can wait. This was more around being able to discover the objectId that you have

 principalId: aks.properties.identityProfile.kubeletidentity.objectId

When I try and discover it through the property tree I can't see anything on identityprofile and if I ignore the warning it still highlights objectid as a problem.

image

@anthony-c-martin
Copy link
Member

anthony-c-martin commented Mar 19, 2021

Got you, sorry - I missed that!

Something strange has happened during type generation for this property - I'll need to look into that in more detail:

Microsoft.ContainerService/managedClusters@2021-02-01 -> properties -> identityProfile -> dictionary of this strangely-named type

@JimPaine
Copy link
Contributor Author

JimPaine commented Mar 19, 2021

Awesome thanks and I will clean up the OP

@anthony-c-martin
Copy link
Member

By the way, if you want to work around this and remove the warning until we have a proper fix out, you should be able to use the any() function to override type validation:

principalId: any(aks.properties.identityProfile.kubeletidentity).objectId

@anthony-c-martin
Copy link
Member

Fixed with Azure/bicep-types-az#245

@ghost ghost locked as resolved and limited conversation to collaborators May 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants