You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bicep just pushed deployer concept, which they didn't have when we shipped azd. So we implemented that as AZURE_PRINCIPAL_ID. We should consider using "deployer" instead
resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
// can be used to help make GUID unique
name: guid(deployer().objectId, readerRoleDefinitionId, resourceGroup().id)
properties: {
principalId: deployer().objectId // easily retrieve objectId
roleDefinitionId: readerRoleDefinitionId
}
}
The text was updated successfully, but these errors were encountered:
When we do this, if we want to be really cute - we should see if we can eliminate computing the value of AZURE_PRINCIPAL_ID in some cases (like when it is not listed in in the main.parameters.json and so we know we won't need it. That would save some end to end time for us since computing the principal id is a little expensive (we have to do some graph calls).
We plan to modify the AZD CLI code to support the deployer() method first, and then update the reference to principalId in the todo templates.
The specific AZD CLI modification approach is as follows:
First, Update the minimum Bicep version to 0.32.4 in the bicep.go, as this is the version that supports the deployer(). Currently, the Bicep version that is automatically downloaded in AZD is 0.29.47, which does not supports the deployer().
Second, regarding @ellismg's comment, it is agreed that avoiding unnecessary AZURE_PRINCIPAL_ID calculations is beneficial. To achieve this, it is planned to modify the loadParameters(). Specifically, before computing the principalId, check if main.parameters.json refers to AZURE_PRINCIPAL_ID. If not, computing principalId will be skipped to save time.
Bicep just pushed deployer concept, which they didn't have when we shipped azd. So we implemented that as AZURE_PRINCIPAL_ID. We should consider using "deployer" instead
Azure/bicep#15340
The text was updated successfully, but these errors were encountered: