C
C#3w ago
Shinyshark

Using resourceTypedParamsAndOutputs in bicep

I am writing a bicep file to deploy an app-service. I am using the experimental feature 'resourceTypedParamsAndOutputs' for this.
module nervexisAppService './appService.bicep' = {
name: 'deployAppServices'
params: {
projectName: projectName
environmentAbbreviation: environmentAbbreviation
nervexisRdwMock: functionApps.outputs.nervexisRdwMock
nervexisTecAllianceMock: functionApps.outputs.nervexisRdwMock
nervexisAppServicePlan: nervexisAppServicePlan.outputs.nervexisAppServicePlan
}
}
module nervexisAppService './appService.bicep' = {
name: 'deployAppServices'
params: {
projectName: projectName
environmentAbbreviation: environmentAbbreviation
nervexisRdwMock: functionApps.outputs.nervexisRdwMock
nervexisTecAllianceMock: functionApps.outputs.nervexisRdwMock
nervexisAppServicePlan: nervexisAppServicePlan.outputs.nervexisAppServicePlan
}
}
param nervexisRdwMock resource 'Microsoft.Web/sites@2024-04-01'
param nervexisTecAllianceMock resource 'Microsoft.Web/sites@2024-04-01'
param nervexisAppServicePlan resource 'Microsoft.Web/serverfarms@2024-04-01'

resource nervexisAppService 'Microsoft.Web/sites@2024-04-01' = {
name: '${webAppServicePrefix}-${projectName}-nervexis-${environmentAbbreviation}'
location: resourceGroup().location
kind: 'app'
properties: {
serverFarmId: nervexisAppServicePlan.id
siteConfig: {
appSettings: [
{
name: 'Caching:CacheType'
value: 'Memory'
}
{
name: 'Caching:DistributedCache:InstanceName'
value: 'Nervexis-Gunnewiek-'
}
{
name: 'Rdw:BaseUrl'
value: 'https://${nervexisRdwMock.properties.defaultHostName}'
}
{
name: 'TecAlliance:BaseUrl'
value: 'https://${nervexisTecAllianceMock.properties.defaultHostName}'
}
]
}
}
tags: {
project: projectName
environment: environmentAbbreviation
}
}
param nervexisRdwMock resource 'Microsoft.Web/sites@2024-04-01'
param nervexisTecAllianceMock resource 'Microsoft.Web/sites@2024-04-01'
param nervexisAppServicePlan resource 'Microsoft.Web/serverfarms@2024-04-01'

resource nervexisAppService 'Microsoft.Web/sites@2024-04-01' = {
name: '${webAppServicePrefix}-${projectName}-nervexis-${environmentAbbreviation}'
location: resourceGroup().location
kind: 'app'
properties: {
serverFarmId: nervexisAppServicePlan.id
siteConfig: {
appSettings: [
{
name: 'Caching:CacheType'
value: 'Memory'
}
{
name: 'Caching:DistributedCache:InstanceName'
value: 'Nervexis-Gunnewiek-'
}
{
name: 'Rdw:BaseUrl'
value: 'https://${nervexisRdwMock.properties.defaultHostName}'
}
{
name: 'TecAlliance:BaseUrl'
value: 'https://${nervexisTecAllianceMock.properties.defaultHostName}'
}
]
}
}
tags: {
project: projectName
environment: environmentAbbreviation
}
}
When I attempt to reference the resources, like in the appSettings, I get the following error: 'Deployment template validation failed: 'The template resource 'Microsoft.Web/sites/wapp-gnnwk-nervexis-test' reference to 'Microsoft.Web/sites/fa-gnnwk-rdw-mock' requires an API version. Please see https://aka.ms/arm-syntax for usage details.'
Template structure and syntax - Azure Resource Manager
Describes the structure and properties of Azure Resource Manager templates (ARM templates) using declarative JSON syntax.
1 Reply
Shinyshark
ShinysharkOP3w ago
I have provided the API version in the param resource definition, what API version is it missing?
Want results from more Discord servers?
Add your server