I am following this guide: https://learn.microsoft.com/en-us/azure/app-service/tutorial-python-postgresql-app?tabs=bash%2Cclone&pivots=postgres-single-server
After successfully completing Step 1 and Step 2, I get to Step 3:
“Install the db-up extension for the Azure CLI:
az extension add --name db-up
“
Yet, when I run this command, I receive the following output:
X@Y-MacBook-Pro djangoapp % az extension add --name db-up Failed to delete '/Users/X/.azure/cliextensions/db-up': [Errno 2] No such file or directory: '/Users/X/.azure/cliextensions/db-up'. Retrying ... Failed to delete '/Users/X/.azure/cliextensions/db-up': [Errno 2] No such file or directory: '/Users/X/.azure/cliextensions/db-up'. Retrying ... Failed to delete '/Users/X/.azure/cliextensions/db-up': [Errno 2] No such file or directory: '/Users/X/.azure/cliextensions/db-up'. Retrying ... Failed to delete '/Users/X/.azure/cliextensions/db-up': [Errno 2] No such file or directory: '/Users/X/.azure/cliextensions/db-up'. You may try to delete it manually. An error occurred. Pip failed with status code 1. Use --debug for more information.
Any ideas here? I’ve tried some of the solutions to similar errors I’ve found on Stack/GitHub, but so far no luck. The goal is to get a Django app deployed to Azure with a connected DB also on Azure. Thanks!
Advertisement
Answer
The official document has recently been updated. Now you can connect your database to your application through Portal, Azure CLI, and VS code. Below is the command which helps to Connect the web app to the database through Azure CLI.
az webapp config appsettings set --resource-group $RESOURCE_GROUP_NAME --name $APP_SERVICE_NAME --settings DBHOST=$DB_SERVER_NAME DBNAME=$DB_NAME DBUSER=$ADMIN_USERNAME DBPASS=$ADMIN_PWD