Skip to content
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

What-if does not display output if readonly fields of moduleA are used as module B parameter #388

Closed
yangchengs opened this issue Jan 20, 2025 · 1 comment

Comments

@yangchengs
Copy link

yangchengs commented Jan 20, 2025

For example, I have a file appinsight.bicep as module A, the output has two read-only fields

@description('Resource definition ofapplication insights')
resource applicationInsights 'Microsoft.Insights/components@2020-02-02' = {
  name: applicationInsightsName
  location: location
  kind: 'java'
  properties: {
    Application_Type: 'web'
    WorkspaceResourceId: logAnalyticsWorkspace.id
  }  
}

output instrumentationId string = applicationInsights.properties.InstrumentationKey
output connectionId string = applicationInsights.properties.ConnectionString

In the parent bicep. If I use instrumentationId and connectionId as input for appservice.bicep, the what-if will not display output for app service. If I use a non-readonly field from applicationInsights.properties, it is working well. The issue is not related with any RP and it looks like a general issue because I tested storage account as well.

var appInsightsKeyVar = {
  APPINSIGHTS_INSTRUMENTATIONKEY: monitoring.outputs.instrumentationId
  APPLICATIONINSIGHTS_CONNECTION_STRING: monitoring.outputs.connectionId
}

@description('Create AppService plan, App Service , Autoscale Settings and App Service KeyVault Access Policy')
module appServiceModule 'appservice/appservice.bicep' = {
  name: 'appServiceModule-deployment'
  //dependsOn: [ monitoring ]
  params: {
    location: location
    appServicePlanName: appServicePlanName
    //appServiceSkuName: appServiceSkuName
    appServiceName:  appServiceName
    appServiceSettings: appInsightsKeyVar
    appServiceSlotSettings: appInsightsKeyVar
    keyVaultName: keyVaultName
    appServiceSubnetName: appServiceSubnetName
    //privateEndpointSubnetName: pleSubnetName
    vnetName: vnetName
    vnetResourceGroup: vnetResourceGroup
    isAccProdConfig: envVariable == 'a' || envVariable == 'p'
    enableAppServiceSettings: enableAppServiceSettings
    emailAddress: groupEmail
    envVariable: envVariable    
  }
}
@jeskew
Copy link
Member

jeskew commented Jan 21, 2025

Using resource properties that are not specified in the template as input to a module will cause the module to be short-circuited. This is the same issue as #157, and the remediation is being tracked there.

@jeskew jeskew closed this as completed Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants