Hi there, I'm attempting to deploy an Azure Funct...
# azure
a
Hi there, I'm attempting to deploy an Azure Function using Pulumi and am failing to have the function run. I've written the code and deployed it manually, which works, but cannot seem to get parity from pulumi. I've created the resource group, storage account, app service plan, uploaded the code to a BlobContainer as a Blob using FileArchive. I can see the file in the Function App's Files. However, I don't see any functions in the Function App overview page which seems to be the significant parity difference between my manual func a pulumi one. I'm wondering if anyone's had success deploying? I'm using Python in the logic
as an aside, I can't seem to set the Python version from Pulumi using WebApp's
python_version
parameter. I have manually select that in the portal's configuration, otherwise Runtime version displays
custom (~4)
For a bit more context, my function ingests data from blob storage, parses/formats the data, and emits to event hubs. AppInsights shows no sign of connection life between the WebApp and the blob or the event hub. I can verify all my env vars/relevant connection strings are correct by comparing to my manually-created function app
My hunch is that there's nothing in Pulumi telling azure exactly which file is the correct Python executable. the FileArchive I'm uploading includes requirements.txt, oryx-manifest.toml, .ostype, host.json, and function_app.py. In the Function App's Log Stream, I see a peculiar log line:
2024-05-29T015935Z [Information] Reading functions metadata (Custom)
2024-05-29T015935Z [Information] 1 functions found (Custom)
2024-05-29T015935Z [Information] 0 functions loaded
f
Since you have an oryx manifest maybe this doesnt apply to you, but I was stumped on a dotnet function app that refused to run, and it turned out that what I deploy was missing a .azurefunctions directory that my glob didnt pick up. Without that directory, it didnt recognize it as a function app and just shrugged.
a
@full-hydrogen-5950 interesting. I copypasta'd the oryx manifest from my manual function, so it's very possible there's something off there. what's inside the .azurefunctions dir?
f
Are you using the
WEBSITE_RUN_FROM_PACKAGE
setting?
a
@fast-sandwich-30809 yes I am
I believe that setting is working, since I can see all the files in my function app's 'App Files' panel
f
I’m not in control of the code in our apps, but I had to turn off
WEBSITE_RUN_FROM_PACKAGE
. because there was a dependency on a swap file in the app directory. That aside, the .azurefunctions contains a couple of DLLs and most importantly I think it contains a file called
function.deps.json
that lists what assemblies are required to run. I think it’s specific to running dotnet, but I’m not sure.