cPanel has built-in GIT hosting that you can use in automated deployment with e.g. Azure Web App service. To make it happen, you create a text file with deployment instructions and credentials in your code repo, and you add an environment variable to Azure.
Category: Cloud & Serverless
Fixing SubscriptionIsOverQuotaForSku for App Service Free Tier
When creating a Service Plan in a region you never used before, you may run into `SubscriptionIsOverQuotaForSku` error. The solution is to request a service increase, the process is often automated and done in a few minutes. The guide contains step-by-step instructions and lists potential gotchas.
Creating API credentials for certbot-dns-oci
The setup You want to generate Letsencrypt certificates using DNS-01 challenge (e.g. wildcard certificates) and you host your domain on Oracle Cloud. Your code is in Python and you want to use certbot-dns-oci for updating the TXT DNS records for the DNS-01 challenge. The problem You need to provide some OCI credentials to certbot-dns-oci and… Continue reading Creating API credentials for certbot-dns-oci
Debugging cron environment on Azure Web App Service
I wrote a service script in Python and I wanted it to run daily on Azure Web App Service. The catch? Same script will run differently when launched manually via SSH and when triggered with cron. Most notably, it will be missing all your environment variables. So how do you know what actually is in… Continue reading Debugging cron environment on Azure Web App Service
Cron not working on Azure App Service (Linux)
If you deploy a Python (or any) app to Azure App Service for Linux, you may find that cron jobs in /etc/cron.d/ silently stop working. This is because App Service runs your app through a custom container with a startup.sh as PID 1, and the cron daemon is never started. Even if the cron package… Continue reading Cron not working on Azure App Service (Linux)
Oracle Cloud FreeBSD: LaunchInstance NotAuthorizedOrNotFound
I created an instance configuration on Oracle Cloud based on FreeBSD-14.2-RELEASE-arm64-ufs image (could have been any other FreeBSD). When launching an instance from this configuration, I got: Error returned by LaunchInstance operation in Compute service.(404, NotAuthorizedOrNotFound, false) Authorization failed or requested resource not found. The likely problem is some value is missing in the instance… Continue reading Oracle Cloud FreeBSD: LaunchInstance NotAuthorizedOrNotFound
Recovering an Oracle Cloud instance
Use case: you have an Oracle Cloud instance but lost SSH access to it. To recover access, you need to know which pubkey you used on it, or which port SSH is listening on. Or, you don’t want to terminate it before you make sure it doesn’t contain important data. Solution: you will have to… Continue reading Recovering an Oracle Cloud instance
Deploying a Python bot to Azure Web App Service (Free Tier)
Run a Python bot for free on Azure Web App Service Pre-requisite: have a bot. You can use mehov/bot-clock as an example. It works with Telegram, so you will need TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID – see the bot’s readme for more info. Create a new Web App Go to Azure Portal → App Services and create… Continue reading Deploying a Python bot to Azure Web App Service (Free Tier)
Python doesn’t print logs on Render.com
When you deploy a Python Web Service to Render.com, your print statements may not work. They may appear later if they get buffered, but in most cases you want them to be put out immediately in the console. Render logs everything output to STDOUT. So you’ll need to make sure you configure your logging library… Continue reading Python doesn’t print logs on Render.com
Finding deployment ID or commit hash with Azure Web Apps Node.JS
You deploy your Node.js code to Azure Web Apps. In your code, you want to know the latest deployment commit ID/hash. Since Azure does not keep the information in environment variables, we will need to call a custom script on each build from package.json.