Reputation: 3
I am trying to create an App Service with Azure Container Registry with CDKTF and Provider AzureRM 2.70.0 (also tried with the latest) While I wrote these codes
this.appService = new AppService(this, "iShare App", {
name: process.env.PROJECT_NAME! + process.env.ENV,
resourceGroupName: resourceGroup.name,
location: resourceGroup.location,
appServicePlanId: appServicePlan.id,
dependsOn: [appServicePlan],
appSettings: {
"WEBSITES_PORT" : "5000",
"DOCKER_REGISTRY_SERVER_URL" : props.containerregistry.containerRegistry.loginServer,
"DOCKER_REGISTRY_SERVER_USERNAME" : props.containerregistry.containerRegistry.adminUsername,
"DOCKER_REGISTRY_SERVER_PASSWORD" : props.containerregistry.containerRegistry.adminPassword,
},
kind: "linux",
siteConfig: {
linuxfxversion: "DOCKER|isharedemotest3dev.azurecr.io/isharedemotest3-hades:2fb17de",
always_on: true,
health_check_path: "/health",
}
}
and this error pop out
TS2322: Type '{ linuxfxversion: string; always_on: true; health_check_path: string; }' is not assignable to type 'AppServiceSiteConfig[]'.
Object literal may only specify known properties, and 'linuxfxversion' does not exist in type 'AppServiceSiteConfig[]'.
app-service.d.ts(118, 14): The expected type comes from property 'siteConfig' which is declared here on type 'AppServiceConfig'
on app-service.d.ts
readonly siteConfig?: AppServiceSiteConfig[];
/**
* source_control block.
*
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/azurerm/r/app_service#source_control AppService#source_control}
*
* @stability stable
*/
which there is an option of linuxfxversion but it is still an error ( have tried any letter case, same result)
How do I fix this? Thank you.
Upvotes: 0
Views: 634
Reputation: 11921
There is an extra []
missing on the siteConfig attribute.
It should be
siteConfig: [{
linuxfxversion: "DOCKER|isharedemotest3dev.azurecr.io/isharedemotest3-hades:2fb17de",
always_on: true,
health_check_path: "/health",
}]
The background here is that siteConfig can have multiple entries (at least according to the Terraform provider schema), therefore you need to wrap it in an array.
Upvotes: 0