azure-dev icon indicating copy to clipboard operation
azure-dev copied to clipboard

Support `run from package` for function and web apps

Open xaviermignot opened this issue 2 years ago • 5 comments

  • [x] Make sure you've installed the latest version using instructions in the wiki

Output from azd version Run azd version and copy and paste the output here: azd version 1.5.1 (commit 3856d1e98281683b8d112e222c0a7c7b3e148e96)

Describe the bug Deploying an Azure Function in dotnet 8 isolated doesn't work from a Linux machine.

To Reproduce

  1. Clone the following repo.
  2. Run azd up from the root of the repo
  3. Check the Overview panel of the Function App from the portal, no function has been deployed.

Expected behavior We should see a HelloWorldFunction in the list of deployed functions. Deploying from vs code works fine.

Environment Information on your environment: * Language name and version: C#, dotnet isolated 8 * IDE and version : Visual Studio Code 1.85.1

Additional context I guess my problem is related to the "run from a package" feature as described here in the docs.
Deploying from vs code adds the WEBSITE_RUN_FROM_PACKAGE setting to my Function App with a URL to a zip file in my storage account. I don't manage this setting in my Bicep code, I was expecting azd to handle it as vs code does (but it might be wrong).

The package created by azd in the /tmp folder looks correct.

I have also tried to use a file share (with the WEBSITE_CONTENTAZUREFILECONNECTIONSTRING and WEBSITE_CONTENTSHARE settings) but no content is pushed to the file share when deploying (except the host.json file).

Has anyone already deployed to a Linux Azure Function in .NET 8 isolated using azd ? I would like to know which method is supported, if any. I haven't found information about this in the docs, sorry if I missed it.
I am open to workarounds/suggestions, if there is anything I should try, please tell me !

Thanks and happy holidays !

xaviermignot avatar Dec 26 '23 20:12 xaviermignot

@xaviermignot thanks for reporting.

@wbreza can you triage this?

rajeshkamal5050 avatar Jan 08 '24 19:01 rajeshkamal5050

Unfortunately, azd only supports zip deploy deployment today for function and web apps. RUN_FROM_PACKAGE is not supported at this time.

wbreza avatar Jan 16 '24 22:01 wbreza

For the record, and for anyone having the same issue, I found a workaround by adding the setting SCM_DO_BUILD_DURING_DEPLOYMENT with the value False explicitely in my Bicep code.
I found this by deploying this sample and comparing both Function Apps.
I have no idea if that disables the "run from package" feature though :-/

xaviermignot avatar Feb 11 '24 16:02 xaviermignot

I faced similar issue in nodejs function. I am having dependencies in parent directory

  "devDependencies": {
    "types": "file:../types",
  },

scm build only have contents of function app directory and not of ../types which fails during npm install. Local build is successfull because directory is present but fails on scm build.

When using azd deploy it said successfully deployed but it didn't happen. Nothing out of place in debug logs. Adding SCM_DO_BUILD_DURING_DEPLOYMENT didn't fixed my issue. azd should atleast give an error that deployment failed.

ZIP deployment also works provided in vscode

ankur198 avatar Mar 07 '24 15:03 ankur198

This issue has been automatically marked as stale because it has not had any activity in the last year!!, and it will be closed in 30 days if no further activity occurs.

If you think this is a mistake, please comment on this issue to keep it open.

github-actions[bot] avatar Dec 05 '25 03:12 github-actions[bot]