Hi everyone, qq - what's the right way to config a...
# azure
a
Hi everyone, qq - what's the right way to config a web app's stack under the Stack settings tab? From the document it seems to suggest linux_fx_version and python_version in the site_config section, but it doesn't seem to set the stack explicitly. For example, linux_fx_version="PYHTON|3.12", python_version="3.12" would set the run time version fine, but the stack isn't set to Python. But if I manually set the stack drop down list to Python, then the version would show up correctly. Any thoughts? Thank you!
m
If I understand correctly you are using Azure Classic provider in an older version, am I right? Which version is it? Because on latest versions this property does exist anymore and you have a specific resource for Linux Web Apps and another one for Windows Web Apps. With latest version of the Azure Classic provider you can check this: https://www.pulumi.com/registry/packages/azure/api-docs/appservice/linuxwebapp/#linuxwebappsiteconfigapplicationstack Personnaly, I prefer using the Azure Native provider you can check an example of doing that here: https://github.com/TechWatching/AzureFunctionsFlexConsumptionPlan/blob/a9fc83d073449cfb7e517fd117e04b507b5e0402/infra/index.ts#L67C1-L70C6 (it's for a Function App but it's the same).
a
Thx Alex for the note! I'm using the azure native apis, and I scanned this doc https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webapp/ but didn't find anything obvious to set the stack to Python, so my resource looks like this
once it pick Python, then the version number shows up as I provisioned, so I think there is something I'm missing, but I didn't find anything in the python sdk like you have with script
m
Okay sorry I thought you were not using Azure Native and my bad it's bit different beween Function App and App Service indeed. I've tested this code and it works fine with
linux_fx_version
Make sure you are setting everything correctly on the linux service plan :
app_service_plan = azure_native.web.AppServicePlan(
f"sp-workshop-{stack_name}",
resource_group_name=resource_group.name,
sku=azure_native.web.SkuDescriptionArgs(
name=app_service_sku
),
kind="Linux",
reserved=True
)
app_service = azure_native.web.WebApp(
f"app-workshop-{stack_name}",
resource_group_name=resource_group.name,
server_farm_id=app_service_plan.id,
site_config=azure_native.web.SiteConfigArgs(
linux_fx_version="PYTHON|3.8",
)
)
a
thanks Alex! yes the app service plan config had a small problem, seems configured ok, but it got in the way for the web app, all good now, thank you!