https://github.com/yokawasa/code-server-azure-webapp
Visual Studio Code Server on Azure Web App for Containers
https://github.com/yokawasa/code-server-azure-webapp
azure azure-webapp code-server containers visualstudiocode
Last synced: 3 months ago
JSON representation
Visual Studio Code Server on Azure Web App for Containers
- Host: GitHub
- URL: https://github.com/yokawasa/code-server-azure-webapp
- Owner: yokawasa
- License: mit
- Created: 2019-04-12T11:07:50.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-12T12:42:13.000Z (over 6 years ago)
- Last Synced: 2025-04-07T17:06:10.402Z (6 months ago)
- Topics: azure, azure-webapp, code-server, containers, visualstudiocode
- Language: Shell
- Homepage:
- Size: 334 KB
- Stars: 11
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Visual Studio Code Server on Azure Webapp for Containers
The aim of this repository is to deploy [code-server](https://github.com/codercom/code-server), VS Code running on a remote server, to [Azure Webapp for Containers](https://azure.microsoft.com/en-us/services/app-service/containers/).
> [WARNING] Please note that its performance is not very good on Azure Webapp for Containers

## Run in Docker
```sh
docker run -it -p 127.0.0.1:8443:8443 -v "${PWD}:/home/coder/project" codercom/code-server:1.621 --allow-http --no-auth
```## Deploy Code Server to Azure Webapp for Containers
Prepare docker compose YAML file for code server webapp (`codeserver.yaml`)
```sh
cat << EOD | tee codeserver.yaml
version: '3.3'services:
codeserver:
image: 'codercom/code-server:1.621'
volumes:
- ${WEBAPP_STORAGE_HOME}/site/wwwroot:/home/coder/project
ports:
- "80:8443"
entrypoint:
- dumb-init
- code-server
- --allow-http
- --no-auth
restart: always
EOD
```Open `deploy.sh`and add values for `RESOURCE_GROUP`, `REGION`, `APP_NAME` and `APP_PLAN_NAME`, then run the script to deploy the code server container to Azure Webapp for Containers.
> deploy.sh
```bash
RESOURCE_GROUP=""
REGION=""
APP_NAME=""
APP_PLAN_NAME=""
CONFIG_FILE="codeserver.yaml"cwd=`dirname "$0"`
expr "$0" : "/.*" > /dev/null || cwd=`(cd "$cwd" && pwd)`echo "Create Resource Group: $RESOURCE_GROUP"
az group create --name $RESOURCE_GROUP --location $REGIONecho "Create App Service Plan: $APP_PLAN_NAME"
az appservice plan create \
--name $APP_PLAN_NAME \
--resource-group $RESOURCE_GROUP \
--sku S1 --is-linuxecho "Create Web App for Container: $APP_NAME"
az webapp create \
--resource-group $RESOURCE_GROUP \
--plan $APP_PLAN_NAME \
--name $APP_NAME \
--multicontainer-config-type compose \
--multicontainer-config-file $cwd/$CONFIG_FILEecho "Add App Setting"
az webapp config appsettings set \
--resource-group $RESOURCE_GROUP \
--name $APP_NAME \
--settings WEBSITES_ENABLE_APP_SERVICE_STORAGE=TRUE
```Access the code-server on Azure webapp
```sh
open https://$APP_NAME.azurewebsites.net
```## Cleanup
> cleanup.sh
```
az group delete --name $RESOURCE_GROUP
```