data-api-builder
data-api-builder copied to clipboard
Unable to deploy in Azure - unclear procedure.
Hi Team,
I was able to get dab to work on my local host and expose APIs for my database. Now I want to deploy it on Azure and the deployment procedure to deploy it as an app service or a container is extremely poorly written and lacks details of major steps.
I tried downloading the source from this repo and build locally using visual studio to to deploy as an app service using Visual studio but the build was not successful(I kept seeing errors for missing .net core packages version 6.0.19)
I tried following the procedure to deploy dab as a container in Azure. The process is extremely unclear. I talks about creating a container which I succesfully did withing nothing further. It also specifies an Azure-deploy.sh file with absolutely no guidance on how/where toe execute it.
All if the YouTube videos just stop at a demonstration of Dab running locally, can someone please help properly list down full set of steps to actually run it in Azure.
hi @noumanqaiser, apologies for your troubles. Does this documentation help: https://learn.microsoft.com/en-us/azure/data-api-builder/running-in-azure ?
Hi Anirudh, Thanks for your reply.
I tried all the steps in this document, I was able to create a storage account and upload the config file, I was also able to create a container using the dab image. That's where it's extremely unclear on what to do.
"Create the Azure Container Instance using the image from the Microsoft Container Registry, and mount the storage account file share, so that it can be accessed by Data API builder"
After creating the container using Azure portal, what set of steps must be followed to run it?
I see that in the subsequent line in the documentation it starts to talk about deploying using sh file again without explaining at all where and how to run it(FYI, cloud shell kr Azure CLI throws errors when running that script due to unknown commands)
Any help would be greatly appreciated.
Thanks again for reporting the issue and apologies for the vagueness in the docs. I'll capture the follow-up steps here, let us know if those help you, and we will ensure the official docs are updated as well.
- Note the FileShare Name from your Container Apps Environment:
A -> just a name to identify the storage account connection in Container Apps Environment B -> File Share name that you created in Azure Storage Account. B and C should Match
-
Edit the Container to specify the volume mount. If you click on Edit and Deploy option on the container, you will see an option to add the volume mount.
-
In the volume mount, specify the FileShare name to be the one that you created in the Container Apps Environment and noted in step 0 as A.
Once this is done you will see it updated in your container information.
-
What should the Mount path value be while editing the container? Mount path:
ContainerAppsEnvironment FilesShareName
:Path inside the container where you want to mount the files to.
-
How did you come up with /mnt/dabconfigs in your example? Does it have any relation to the file share name inside the storage account? That is why I put configs in the First box. And Mount path can be anything. I have put
/mnt/dabconfigs/
for convenience. Better to put it inside/mnt/<anyname>
-
What if the
dab-config.json
file is not present at the root in the file share of the storage account? How do you specify a different config file name through the portal? Doesn’t matter. Lets say dab.config is present indabconfigs/sqlconfigs/dab-config.json
. Then once you mount it /mnt/configs. you will have all the directory and files mounted on this path /mnt/configs. And then config file can be accessed by/mnt/configs/sqlconfigs/dab-config.json
- How do we tell the container about my config file?
Once the directory is mounted. We have to give the commands for the container specifying the path of the config file.
Example: let’s say the config file in your container is here
/mnt/dabconfigs/dab-config.json
. then you need to give this command to the container. This command is the first command that runs when the container starts. This command can be edited by clickingEdit and deploy
.
I just tested out this newly published tutorial. This should resolve your issues in this comment: https://learn.microsoft.com/azure/data-api-builder/how-to-deploy-container-app
Please feel free to re-open the issue if the guide doesn't solve your issue.