Spurious no unnecessary dependsOn entries
lint error in 0.32.4
#15828
-
Hello! Recent param functionAppName string
module functionAppDeployment 'customRegistryFunctionApp' = {
name: 'functionAppDeployment'
params: {
functionAppName: functionAppName
// blah blah
}
}
// Later in the file
module functionAppSettingsDeployment 'customRegistryFunctionAppConfig' = {
name: 'functionAppSettingsDeployment'
params: {
functionAppName: functionAppName
// blah blah
}
// We add `dependsOn` because we need this to deploy *after* function app itself
// As of 0.32.4 we get `no-unnecessary-dependson` here
dependsOn: [functionAppDeployment]
}
// customRegistryFunctionApp.bicep
param functionAppName string
resource functionApp 'Microsoft.Web/sites@2023-01-01' = {
name: functionAppName
// blah blah
}
// customRegistryFunctionAppConfig.bicep
param functionAppName string
resource existingFunctionApp 'Microsoft.Web/sites@2023-01-01' existing = {
name: functionAppName
}
resource functionAppSettings 'Microsoft.Web/sites/config@2023-01-01' = {
parent: existingFunctionApp
name: 'appsettings'
// blah blah
}
My question is, will |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
Does the param functionAppName string
module functionAppDeployment 'customRegistryFunctionApp' = {
name: 'functionAppDeployment'
params: {
functionAppName: functionAppName
// blah blah
}
}
// Later in the file
module functionAppSettingsDeployment 'customRegistryFunctionAppConfig' = {
name: 'functionAppSettingsDeployment'
params: {
functionAppName: functionAppName
foo: functionAppDeployment.outputs.foo
// blah blah
}
} If so, Bicep will automatically infer a dependency and include a |
Beta Was this translation helpful? Give feedback.
Right. This analysis has been in place for resources since the early days of Bicep, but it was only enabled for modules in v0.32. With the
dependsOn
removed from main.bicep, in the compiled template,functionAppSettingsDeployment
still depends onstorageDeployment
, which in turn depends onfunctionAppDeployment
.