-
Notifications
You must be signed in to change notification settings - Fork 88
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
Unable to expand resources. The language expression property 'X' doesn't exist #3191
Comments
Thanks for reporting the issue @nbwdk. Are you able to provide the version you are using? Or was it v1.39.2 from the previous post? |
@nbwdk I'm not able to reproduce this issue on v1.39.2, but I'm only guessing at the content of some of these files. Noting v1.39.3 is the latest stable release. Are you able to provide a cutdown complete set of bicep files? |
Hey @BernieWhite, maybe I can help with some info on this also. I also get this error too in 1.40.0 although on the azureADOnlyAuthentication eval. Info below, if it helps: main.bicep param location string
param rgName string
param sqlDatabase object = {}
@secure()
param sqlAdministrators object = {}
param sqlServerName string
// targetScope (optional)
targetScope = 'subscription'
// Rg
module resourceGroup 'br/public:avm/res/resources/resource-group:0.4.0' = {
name: '${uniqueString(deployment().name, location)}-rg'
params: {
name: rgName
location: location
}
}
// Azure SQL DB
module sqlDb 'br/public:avm/res/sql/server:0.11.1' = {
name: '${uniqueString(deployment().name, location)}-sql'
scope: resourceGroup(rgName)
params: {
name: sqlServerName
location: location
minimalTlsVersion: '1.2'
managedIdentities: {
systemAssigned: true
}
publicNetworkAccess: 'Enabled'
administrators: {
azureADOnlyAuthentication: sqlAdministrators.azureADOnlyAuthentication
login: sqlAdministrators.login
sid: sqlAdministrators.sid
principalType: sqlAdministrators.principalType
}
databases: [
{
name: sqlDatabase.name
collation: sqlDatabase.collation
maxSizeBytes: sqlDatabase.maxSizeBytes
zoneRedundant: false
sku: {
name: sqlDatabase.sku
tier: sqlDatabase.tier
}
}
]
firewallRules: []
}
}
}
} main.bicepparam param location = 'uksouth'
param sqlServerName = 'sql-svr-contoso'
// SQL Database
param sqlDatabase = {
name: 'sqldb-psrule'
tier: 'Basic'
sku: 'Basic'
maxSizeBytes: 2147483648
collation: 'SQL_Latin1_General_CP1_CI_AS'
}
param sqlAdministrators = {
azureADOnlyAuthentication: true
login: 'SG_SomeGroup'
sid: 'GUID'
principalType: 'Group'
} main.test.bicep
Error
Happy to do further troubleshooting if need be. Let me know if I can help. |
Thanks @riosengineer Your main.test.bicep example was missing However after adding these I can't reproduce the // Test with only required parameters
module test '../main.bicep' = {
scope: subscription('guid')
name: 'deploy'
params: {
rgName: 'rg1'
sqlServerName: 'contoso'
location: 'uksouth'
sqlAdministrators: {
azureADOnlyAuthentication: true
login: 'SG_SomeGroup'
sid: 'guid'
principalType: 'Group'
}
sqlDatabase: {
name: 'sqldb-contoso'
tier: 'Basic'
sku: 'Basic'
maxSizeBytes: 2147483648
collation: 'SQL_Latin1_General_CP1_CI_AS'
}
}
} |
This happened to me as well. 📢 Here is a solution. or maybe let's call it a workaround. @nbwdk @BernieWhite Before going to the solution here is the version of each component I use PowerShell Version: 7.4.6 Problem Your model Solution The way I solved it is by moving the
With this solution, you can PSRule test without issues, you can deploy without issues. |
Thanks @maythamfahmi. I'd like to understand the issue more so that I can provide a fix. Thanks for the bicep version. In your example So, would I be right in saying that if |
Ah yeah, that's my bad, I just didn't paste across the maxSizeBytes property, but the collation was definitely missing from my file. I also cannot replicate now in 1.40.0 with latest Bicep CLI now. I have one feature enabled just for FYI:
I actually think my particular root cause was: I had two new test files with SQL resources in the main template. In one of the test files I was missing the sqlAdministrators object as it didn't auto-complete as a required param, so I missed it. When adding it in, no issues. So tldr: user error! |
Thanks for the update @riosengineer. @maythamfahmi Also can you confirm if you are using any experimental features in |
@BernieWhite I can confirm I am using the following
regarding your previous message, I can provide more details if still relevant :)
|
@maythamfahmi Absolutely, if there is a race case between resource dependencies then we should fix it. Ideally if you can provide a self-contained reproduction, this will assist significantly. |
@BernieWhite
Getting an error, when referencing a user assigned managed identity cross modules within the same bicep files scoped at subscription target
Originally posted by @nbwdk in #2850
The text was updated successfully, but these errors were encountered: