Skip to content

Conversation

@anamikapan11
Copy link
Contributor

@anamikapan11 anamikapan11 commented Nov 11, 2025

Added changes for bicep side for role definition function

Checklist

Microsoft Reviewers: Open in CodeFlow

@anamikapan11 anamikapan11 changed the title bicep role definition changes [do not merge] bicep role definition changes Nov 11, 2025
.Build();

// Add roleDefinition function
yield return new FunctionOverloadBuilder("roleDefinition")
Copy link
Member

@majastrz majastrz Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

roleDefinition

I think the function name in the backend is plural. #Closed

.WithGenericDescription("Gets a role definition that can be used in role assignments.")
.WithDescription("Returns information about the specified role definition including id and roleDefinitionId.")
.WithRequiredParameter("roleName", LanguageConstants.String, "The display name of the role definition")
.WithFlags(FunctionFlags.RequiresInlining)
Copy link
Member

@majastrz majastrz Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RequiresInlining

You don't need in-lining for this one. That flag is needed for functions that cannot be placed inside resource bodies. #Closed

{
var bicepText = @"
var contributorRole = az.roleDefinition('Contributor')
var ownerRole = az.roleDefinition('Owner')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

roleDefinition

Something strange is going on because this test and the one below should have failed after the change to roleDefinitions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this test pass locally?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weirdly it didn't show any issues before in my local as well but i made the change to plural in test

@@ -0,0 +1,26 @@
// Test file for roleDefinition function
targetScope = 'subscription'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subscription

This file seems to be at the root of the repo unconnected to anything. Do you need it? (Same question for the json one.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i was using it initially to test the changes, removed it

Copy link
Member

@majastrz majastrz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants