azure - How to deploy pgadmin4 docker image on azure web app?
问题描述
I am unable to run docker image dpage/pgadmin4 on azure web app (Linux) which is available on docker hub.
I have installed Docker in my Linux machine and was able to run that docker image locally. Then I created Web app in Azure with options as given below:
- OS: Linux
- Publish: Docker Image
- App service plan: Linux app service
After creating web app, I added two env variables in App Settings section:
PGADMIN_DEFAULT_EMAIL : user@domain.com
PGADMIN_DEFAULT_PASSWORD : SuperSecret
Finally login screen is visible but when I enter above credentials, it doesn't work and keeps redirecting to login page.
Update: If login is working properly, screen appears as shown below. !(pgadmin initial screen)
解决方案
对于你的问题,我做了测试,发现真的很奇怪。当我通过Azure CLI在Azure服务Web App for Container中部署docker镜像dpage/pgadmin4并设置应用设置时,使用用户名和密码登录没有问题。但是当我通过 Azure 门户部署它时,我遇到了同样的事情。
不知道是什么原因,但解决方案是设置环境变量PGADMIN_DEFAULT_EMAIL
并PGADMIN_DEFAULT_PASSWORD
通过 Azure CLI 如下所示:
az webapp config appsettings set --resource-group <resource-group-name> --name <app-name> --settings PGADMIN_DEFAULT_EMAIL="user@domain.com" PGADMIN_DEFAULT_PASSWORD="SuperSecret"
如果你真的想知道原因,那么你可以向微软反馈。也许这是一个错误或一些特殊设置。
更新
我这边的测试截图在这里:
推荐阅读
- android - 数据未显示在 recyclerview 上 - 出现错误未附加布局管理器;跳过布局
- java - Maven - 尝试构建项目时出错
- php - 在 php 中获取 XML 提要
- android - 缩放 X 轴 MPAndroidCharts
- ios - Facebook App Review iOS - 无法选择“从 Apple App Store 下载”
- css - 将按钮组与 div 内的右端对齐
- r - 我的 R 函数的奇怪输出
- dynamics-crm - 带有 WordTemplateExportRecordId 的 MS CRM Word 文档生成:
- oracle - 如何从我的 oracle pl sql 程序运行 bat 文件
- mongodb - MongoDB 分组和项目自定义字段