swift-hamburger-98290
04/13/2021, 1:24 PMApp Service
with ZIP? How to make Azure (Oryx?) create the virtualenv? Have this now:
...
let app = new web.WebApp("app", {
resourceGroupName: rg.name,
serverFarmId: asp.id,
siteConfig: {
alwaysOn: true,
appCommandLine: "python /home/site/wwwroot/__init__.py",
appSettings: [
{
name: "WEBSITE_RUN_FROM_PACKAGE",
value: codeUrl,
},
],
linuxFxVersion: "PYTHON|3.8",
},
});
But the virtual env is not created, and dependencies are not installed.cool-fireman-90027
04/13/2021, 2:06 PM$ python3 -m venv venv
$ source venv/bin/activate
$ pip3 install -r requirements.txt
as per the readme in azure-py-appservice.
The appservice settings are also set there.
Here is how you could do it:
const app = new web.WebApp("fa", {
resourceGroupName: resourceGroup.name,
name: "myuniqueapp",
location: resourceGroup.location,
serverFarmId: plan.id,
kind: "functionapp",
siteConfig: {
appSettings: [
{ name: "AzureWebJobsStorage", value: storageConnectionString },
{ name: "FUNCTIONS_EXTENSION_VERSION", value: "~3" },
{ name: "FUNCTIONS_WORKER_RUNTIME", value: "node" },
{ name: "WEBSITE_NODE_DEFAULT_VERSION", value: "10.14.1" },
{ name: "WEBSITE_RUN_FROM_PACKAGE", value: "<https://mikhailworkshop.blob.core.windows.net/zips/app.zip>" },
]
},
});
swift-hamburger-98290
04/13/2021, 2:14 PMrequirements.txt
and main.py
) and have Azure do python3 -m venv venv; source ...
on each deployment.pip install
because pulumi up
is not seen as a deployment (it does not appear in the deployments under Kudu
• Running az webapp deployment
works fine