Skip to content

code-server for azure app service #2711

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
aflextr opened this issue Feb 10, 2021 · 23 comments
Closed

code-server for azure app service #2711

aflextr opened this issue Feb 10, 2021 · 23 comments
Assignees
Labels
feature New user visible feature
Milestone

Comments

@aflextr
Copy link

aflextr commented Feb 10, 2021

Can you prepare the code-server docker image for Azure's app services?

@aflextr aflextr added the feature New user visible feature label Feb 10, 2021
@jsjoeio
Copy link
Contributor

jsjoeio commented Feb 10, 2021

This is a great idea! cc @bpmct are you familiar with Azure's app services? Any ideas on how to do this and also any interest in taking this one?

@bpmct
Copy link
Member

bpmct commented Feb 10, 2021

Haven't experimented with it yet, but I'd love to take a look! I'll share updates here, and any help is appreciated :)

@bpmct bpmct self-assigned this Feb 10, 2021
@jsjoeio jsjoeio added this to the v3.8.2 milestone Feb 10, 2021
@aflextr
Copy link
Author

aflextr commented Feb 12, 2021

@bpmct Hello, how are things going? Maybe I can help you with this. Azure application service code server official docker image works normally, but we can't see the password and we can't access ssh via Azure. However, this link contains information on how to access ssh. If you can fix the ssh issue, you can probably easily create the custom code server image for the application service.

ssh link

@bpmct
Copy link
Member

bpmct commented Feb 12, 2021

I'm getting to this today. I think a custom image is the right direction to go, so we can add SSH and support for using code-server --link. I'll share a GitHub for testing in a few hours :)

@jsjoeio jsjoeio modified the milestones: v3.9.0, v3.9.1 Feb 12, 2021
@bpmct
Copy link
Member

bpmct commented Feb 12, 2021

Azure app service is a bit tough to set up debug/logs, but I got code-server running with my custom image and I'm about to get SSH access+custom password configured. I'll publish the image/repo as soon as I do that. Some other things I'm looking to do:

  • Experiment with Azure auth, see if we can use that as an auth layer for code-server
  • Create a CLI/script to auto-deploy to Azure App service, tail logs

@bpmct
Copy link
Member

bpmct commented Feb 12, 2021

Image is live: https://github.com/bpmct/code-server-azure. Will document in this repo soon. LMK if you have questions

@aflextr
Copy link
Author

aflextr commented Feb 12, 2021

After entering the password, it stays on the white screen, so do you?

@bpmct
Copy link
Member

bpmct commented Feb 12, 2021

I just deployed again and it works fine. Try refreshing once after entering the password?

@bpmct
Copy link
Member

bpmct commented Feb 12, 2021

What app type are you using? I'm using this. Not saying this config is necessary, but it may be a hardware limitations thing:

P1V2
210 total ACU
3.5 GB memory
Dv2-Series compute equivalent

@aflextr
Copy link
Author

aflextr commented Feb 12, 2021

I use the free app

Free F1
1 GB memory

@aflextr
Copy link
Author

aflextr commented Feb 12, 2021

It worked when I used a different size app service but it didn't work in free size.interesting. ¯_(ツ)_/¯

@bpmct
Copy link
Member

bpmct commented Feb 12, 2021

I believe this is due to the SSH server using some resources. I am trying an image without (ssh :no-ssh tag) to see if that fixes it. If so, I will set that as an option to disable in the environment variable or see if there is a lightweight alternative.

@aflextr
Copy link
Author

aflextr commented Feb 13, 2021

The free plan (f1) has a shortage of white screens, but other sizes do not. maybe there is a solution for the free plan.

@bpmct
Copy link
Member

bpmct commented Feb 13, 2021

I noticed that "WebSockets" is off and "HTTP" version is low on the free plan. I changed this, as I noticed it was a websocket error. Still no luck. Just sharing findings so far.

@bpmct
Copy link
Member

bpmct commented Feb 13, 2021

This is horribly documented, but I finally found this. I think this is our limitation: https://docs.microsoft.com/en-us/azure/app-service/faq-app-service-linux#web-sockets

@bpmct
Copy link
Member

bpmct commented Feb 13, 2021

I think this could be resolved with the --link flag and using a tunnel instead. However, I believe the web service will still need something running on port 80 to keep the container alive. With --link, the port is randomized.

@bpmct
Copy link
Member

bpmct commented Feb 13, 2021

I can mess with this in the morning with a workaround that makes a simple http server to redirect to the --link url based off the logs.

@aflextr
Copy link
Author

aflextr commented Feb 13, 2021

Thank you for helping (● '◡' ●)

@aflextr
Copy link
Author

aflextr commented Feb 13, 2021

@bpmct i used ngrok for the free plan and it worked. maybe the code-server --link could work.

@bpmct
Copy link
Member

bpmct commented Feb 15, 2021

I updated the image to work with --link and added a dumb web server to keep Azure alive and redirect to the --link URL. It now works on the free version 🎉

The image will now run --link by default if $PASSWORD is not set

@bpmct
Copy link
Member

bpmct commented Feb 16, 2021

@aflextr have you attached a volume to your Azure app? if so, would you want to document on the repo?https://github.com/bpmct/code-server-azure

@aflextr
Copy link
Author

aflextr commented Feb 16, 2021

No unfortunately I couldn't add

@jsjoeio
Copy link
Contributor

jsjoeio commented Feb 24, 2021

Closing via #2729

@aflextr if you need more help after this, feel free to start a QA on our Discussions!

@jsjoeio jsjoeio closed this as completed Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New user visible feature
Projects
None yet
Development

No branches or pull requests

3 participants