What happened?
When using the sample script found at https://github.com/Azure/data-api-builder/blob/main/samples/azure/azure-container-apps-deploy.sh with a valid DAB config using latest schema version, latest mcr.microsoft.com/azure-databases/data-api-builder Docker container image, and properly configured environment variables in the sample script to deploy to Azure Container Apps, DAB can't seem to find the config on startup and returns HTTP 503 on entity REST requests.
After some troubleshooting, it was found that an older Docker image with tag 0.7.6 does not trigger this issue and returns requests fine; this issue seems to occur only on images after 0.7.6 (0.8.44-rc and the latest of this post, 0.8.49, which is also the same as latest tag) regardless if the schema version is different from the Docker image version.
Version
0.8.49
What database are you using?
Azure SQL
What hosting model are you using?
Container Apps
Which API approach are you accessing DAB through?
REST
Relevant log output
2023-08-31T17:16:02.452130428Z warn: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[60]
2023-08-31T17:16:02.452159362Z Storing keys in a directory '/root/.aspnet/DataProtection-Keys' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed.
2023-08-31T17:16:02.452399157Z info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[62]
2023-08-31T17:16:02.452407764Z User profile is available. Using '/root/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest.
2023-08-31T17:16:02.465330499Z info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[58]
2023-08-31T17:16:02.465346428Z Creating key {bfc3e456-e8bc-4fc8-8788-7792304f6555} with creation date 2023-08-31 17:16:02Z, activation date 2023-08-31 17:16:02Z, and expiration date 2023-11-29 17:16:02Z.
2023-08-31T17:16:02.472850394Z warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
2023-08-31T17:16:02.472867196Z No XML encryptor configured. Key {bfc3e456-e8bc-4fc8-8788-7792304f6555} may be persisted to storage in unencrypted form.
2023-08-31T17:16:02.476072036Z info: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[39]
2023-08-31T17:16:02.476080652Z Writing data to file '/root/.aspnet/DataProtection-Keys/key-bfc3e456-e8bc-4fc8-8788-7792304f6555.xml'.
2023-08-31T17:16:02.491547038Z Unable to find config file: does not exist.
2023-08-31T17:16:02.672510416Z Unable to find config file: does not exist.
2023-08-31T17:16:02.687951924Z info: Microsoft.Hosting.Lifetime[14]
2023-08-31T17:16:02.687990687Z Now listening on: http://[::]:5000
2023-08-31T17:16:02.689067467Z info: Microsoft.Hosting.Lifetime[0]
2023-08-31T17:16:02.689083808Z Application started. Press Ctrl+C to shut down.
2023-08-31T17:16:02.689670331Z info: Microsoft.Hosting.Lifetime[0]
2023-08-31T17:16:02.689681321Z Hosting environment: Production
2023-08-31T17:16:02.689686020Z info: Microsoft.Hosting.Lifetime[0]
2023-08-31T17:16:02.689690148Z Content root path: /App
2023-08-31T17:17:00.902103944Z info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
2023-08-31T17:17:00.902166371Z Request starting HTTP/1.1 GET http://***.westus2.azurecontainerapps.io/api/Product - -
2023-08-31T17:17:00.905627200Z warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3]
2023-08-31T17:17:00.905651636Z Failed to determine the https port for redirect.
2023-08-31T17:17:00.950390183Z info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
2023-08-31T17:17:00.950445215Z Request finished HTTP/1.1 GET http://***.westus2.azurecontainerapps.io/api/Product - - - 503 0 - 48.8507ms
Code of Conduct
What happened?
When using the sample script found at https://github.com/Azure/data-api-builder/blob/main/samples/azure/azure-container-apps-deploy.sh with a valid DAB config using latest schema version, latest
mcr.microsoft.com/azure-databases/data-api-builderDocker container image, and properly configured environment variables in the sample script to deploy to Azure Container Apps, DAB can't seem to find the config on startup and returns HTTP 503 on entity REST requests.After some troubleshooting, it was found that an older Docker image with tag
0.7.6does not trigger this issue and returns requests fine; this issue seems to occur only on images after0.7.6(0.8.44-rcand the latest of this post,0.8.49, which is also the same aslatesttag) regardless if the schema version is different from the Docker image version.Version
0.8.49
What database are you using?
Azure SQL
What hosting model are you using?
Container Apps
Which API approach are you accessing DAB through?
REST
Relevant log output
Code of Conduct