Skip to content

bicep role definition changes#18457

Merged
anamikapan11 merged 7 commits into
Azure:mainfrom
anamikapan11:anapandey/roles
Mar 30, 2026
Merged

bicep role definition changes#18457
anamikapan11 merged 7 commits into
Azure:mainfrom
anamikapan11:anapandey/roles

Conversation

@anamikapan11
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

Comment thread test_roleDefinition.bicep Outdated
@@ -0,0 +1,26 @@
// Test file for roleDefinition function
targetScope = 'subscription'
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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:

@anamikapan11 anamikapan11 changed the title [do not merge] bicep role definition changes bicep role definition changes Mar 30, 2026
@anamikapan11 anamikapan11 merged commit 6a55467 into Azure:main Mar 30, 2026
41 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

Test this change out locally with the following install scripts (Action run 23756833993)

VSCode
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-vsix.sh) --run-id 23756833993
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-vsix.ps1) } -RunId 23756833993"
Azure CLI
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-cli.sh) --run-id 23756833993
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-cli.ps1) } -RunId 23756833993"

@mumian
Copy link
Copy Markdown
Contributor

mumian commented Apr 17, 2026

@anamikapan11 anamikapan11 deleted the anapandey/roles branch May 11, 2026 20:32
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.

4 participants