question

mithunshanbhag avatar image
0 Votes"
mithunshanbhag asked azure-cxp-api edited

[app service linux] Are apt-get packages persistent across multiple re-deployments?

If I install any packages via apt-get on app service for linux (by connecting via SSH), will they be persistent across multiple re-deployments? Anyone know?

FWIW: I'm simply zip-deploying my app to a B2 plan. Am not using containers.

https://docs.microsoft.com/en-us/azure/app-service/containers/app-service-linux-ssh-support

Thanks,
-Mithun

azure-webapps
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JoffreyNURIT-4769 avatar image
1 Vote"
JoffreyNURIT-4769 answered mithunshanbhag commented

Hello Mithunshanbhag,

Yes, the configuration persist. You can try to restart your app service: your package still on your vm.
Deployment doesn't change anything. When you deploy your application, basically, you only:
- send your package
- Erase your old files (if you configure "delete" option)
- Unzip the package
- restart the service

The system doesn't change anything and remain the same.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@mithunshanbhag, Just checking in to see if the above post helped answer your question. Kindly let us know if you have any further questions on this specific topic, we would be more than happy to assist you.
Please do mark the post which was helpful by clicking on ‘Accept Answer’ & ‘Up-Vote’ to help the community find the right answers.

0 Votes 0 ·

Hi @JoffreyNURIT-4769, @ajkuma-MSFT,

I just doubled-checked.

While restarting the app persists the apt-get packages, re-deploying the app does not.

FWIW, I use azure pipeline tasks to stop app service, deploy and then start app service.

Here is the relevant gist: https://gist.github.com/mithunshanbhag/7a4de67243f5639e83104fc045bee547

0 Votes 0 ·
JoffreyNURIT-4769 avatar image
0 Votes"
JoffreyNURIT-4769 answered JoffreyNURIT-4769 commented

If i understand correctly,
1) You restart app: your package is available
2) You deploy your app: package not found
It's pretty weird...
When you use the package, you know where is installed?
You can find the package with the command "find / -name package-name"

I see this configuration:
removeAdditionalFilesFlag: true
excludeFilesFromAppDataFlag: true
it's a basic configuration, but if I understand what you say, it's possible the package was "erased" when you deploy your app BECAUSE of this configuration

You can test with:
- Deploy with this configuration to "false"
- if with this value to false, the package still here, you can move / copy the package to another location to not erase this with the next deploy

Another solution: use your script / your CI to execute the command and reinstall the package if needed
For exemple: "apt install XXX --yes"

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks. I removed that flag and redeployed, however the apt-get packages are still not getting preserved.

I might move to a containerized app-service where I can have all these apt-get dependencies in the image itself.

Thanks for all the help,, highly appreciated!

Thanks,
Mithun

1 Vote 1 ·

Your welcome :)
Container was a good solution. Good luck ;)

0 Votes 0 ·