If you're creating a bug/problem report, please include the followings:
- ABP Framework version: v7.0
- UI type: Angular
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): yes, microservice template
- Exception message and stack trace:
- Steps to reproduce the issue:"
Hi, I am currently using the microservice template generated by abp commercial. I can run all the services without a hitch on my local dev machine. I've switched the database to PostgreSQL and the entire solution runs well on tye.
Currently, I'm in the progress of deploying this solution to Azure Kubernetes using Azure Container Registry as my repository.
What I have set up on Azure Cloud:
- All instances of PostgreSQL for each microservice.
- Container instances for Kibana, Grafana, Redis, Prometheus, ElasticSearch, and RabbitMQ.
- Azure Kubernetes Service
- Azure Container Registry
- Linked ACR to AKS
- Deployed Web Gateway to AKS (Currently hitting CORS origin error when opening into Swagger) (1)
- Deployed Auth Server to AKS (Connection Timeout) (2)
Is there any help/guide/documentation regarding this deployment? I am also planning to use Azure CI/CD in the future.
My current deployment procedure is:
- Publish to ACR using Visual Studio 2022
- Create Deployment yaml in AKS in Azure Portal for the published image
- Create Service yaml in AKS in Azure Portal using the deployment (using Load Balancer).
For some reason, when I deploy the Auth Server, the deployment, 'Ready' status is an error. But when running in localhost it runs fine. (3)
Below is my appsettings.json for AuthServer
{
"App": {
//"SelfUrl": "https://localhost:44322",
"SelfUrl": "http://20.92.102.114:4322",
"CorsOrigins": "https://*.KMS4.com,http://localhost:4200,https://localhost:44307,https://localhost:44325,https://localhost:44353,https://localhost:44367,https://localhost:44388,https://localhost:44381,https://localhost:44361,http://20.92.102.114:4322",
"RedirectAllowedUrls": "http://localhost:4200,https://localhost:44307,https://localhost:44321",
"DisablePII": "false"
},
"AuthServer": {
//"Authority": "https://localhost:44322",
"Authority": "http://20.92.102.114:4322",
"RequireHttpsMetadata": "true",
"SwaggerClientId": "WebGateway_Swagger"
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"IdentityService": "User ID=[username];Password=[password];Host=aldankms4.postgres.database.azure.com;Port=5432;Database=KMS4_Identity;Pooling=false",
"AdministrationService": "User ID=[username];Password=[password];Host=aldankms4.postgres.database.azure.com;Port=5432;Database=KMS4_Administration;Pooling=false",
"SaasService": "User ID=[username];Password=[password];Host=aldankms4.postgres.database.azure.com;Port=5432;Database=KMS4_Saas;Pooling=false"
},
"StringEncryption": {
"DefaultPassPhrase": "Zk0TJPzHzDaBB6Wa"
},
"Redis": {
//"Configuration": "localhost:6379"
"Configuration": "kms4.redis.cache.windows.net,abortConnect=false,ssl=true,allowAdmin=true,password=[password]"
},
"RabbitMQ": {
"Connections": {
"Default": {
//"HostName": "localhost"
"HostName": "20.92.102.114"
}
},
"EventBus": {
"ClientName": "AuthServer",
"ExchangeName": "KMS4"
}
},
"ElasticSearch": {
//"Url": "http://localhost:9200"
"Url": "https://kms4elasticsearch.azurewebsites.net"
}
}
Below is my appsettings.json for WebGateway
{
"App": {
"SelfUrl": "https://localhost:44325",
"CorsOrigins": "https://*.KMS4.com,http://localhost:4200,https://localhost:44307,http://20.227.27.217:4325"
},
"AuthServer": {
"Authority": "https://localhost:44322",
"RequireHttpsMetadata": "true",
"SwaggerClientId": "WebGateway_Swagger"
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"Redis": {
//"Configuration": "localhost:6379"
"Configuration": "kms4.redis.cache.windows.net,abortConnect=false,ssl=true,allowAdmin=true,password=[password]"
},
"ElasticSearch": {
//"Url": "http://localhost:9200"
"Url": "https://kms4elasticsearch.azurewebsites.net"
}
}
Thank you!
3 Answer(s)
-
0
You can check https://github.com/abpframework/abp/issues/15601 for swagger ui authorization issue.
However your problem seems that gateway is still trying to redirect to localhost for AccountService, maybe you have missed overriding the configmap of gateways for production.
You can also check the Azure deployment scripts and values for eShopOnAbp sample https://github.com/abpframework/eShopOnAbp/tree/main/etc/k8s that i can provide for a sample.
-
0
I've checked the eShopOnAbp sample, its seems that the
appsettings.json
file is preserved using localhost. I noticed that there is anappsettings.Docker.json
for some projects such aswebgateway
. Is this what docker uses when building the image? Should I implement this as well when I am pushing the image to the ACR?I've checked my
ocelot.json
file, might it be something to do with theocelot.json
file when it is trying to redirect to AccountService?Thanks
-
0
It is using Helm charts for deployment. Maybe you missed https://github.com/abpframework/eShopOnAbp/blob/main/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-configmap.yaml