Replies: 1 comment 7 replies
-
The tenant db migration created the connection string info from your local…need to update your tenant db
…________________________________
From: dblood2 ***@***.***>
Sent: Thursday, December 23, 2021 1:56:33 PM
To: fullstackhero/dotnet-webapi-boilerplate ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [fullstackhero/dotnet-webapi-boilerplate] Deployed to Azure App Service - SQL Connection error (Discussion #303)
As the title suggests, I've deployed the web API to an Azure App Service. The deployment went fine, and I can see the functions at the /swagger URL. CI/CD pipeline is provided by a GitHub Action. I inadvertently deployed with the connection string set to my local DB during the initial push. I then changed the connection string in:
database.json
hangfire.json
I committed/pushed the changes to GitHub and the deploy to Azure was successful. My production database server is an MSSQL Azure VM. I backed up the DB from local and restored it to production. All good.
I also created an Inbound rule in the network security group for the VM, allowing access on the correct port for the new App Service where I'd deployed the FSH web API. (I have several other Apps accessing the SQL VM, so I don't think this is the issue).
I ran tests in Postman, and Swagger, and they fail with a 500 - Internal server error, A network-related or instance-specific...[Could not connect to SQL Server] (That old chestnut). When I checked the logs through the console of the app service, the logs show the error, and it appears that the web API is still attempting to connect to the local DB for some reason.
[excerpt from log]
"An error occurred using the connection to database '{database}' on server '{server}'.","Properties":{"database":"BigKnockGolf","server":"DADDY","EventId":{"Id":20004,"Name":"Microsoft.EntityFrame...
(My local machine is named DADDY)
My questions:
* Anyone else tried to travel this path and succeed?
* Is there another location where the connection string must be changed?
* Even if this isn't FSH related, does anyone see any missteps in my process? ( I feel like I'm missing something silly, but just don't see it)
I think the boilerplate code is spectacular, and while I'm probably foolish for foraging ahead before the REALLY smart guys who are putting this together are finished, I just wanted to answer a few questions in my head before I started trying to actually use this in a production environment. Namely, could I deploy to Azure App Service, and use my existing VM as the backend DB.
Thanks in advance for any feedback,
Danny
—
Reply to this email directly, view it on GitHub<#303>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AALFFSKILIWVGRFRZR5WRFLUSNWGDANCNFSM5KVKLXJQ>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
7 replies
Answer selected by
dblood2
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As the title suggests, I've deployed the web API to an Azure App Service. The deployment went fine, and I can see the functions at the /swagger URL. CI/CD pipeline is provided by a GitHub Action. I inadvertently deployed with the connection string set to my local DB during the initial push. I then changed the connection string in:
database.json
hangfire.json
I committed/pushed the changes to GitHub and the deploy to Azure was successful. My production database server is an MSSQL Azure VM. I backed up the DB from local and restored it to production. All good.
I also created an Inbound rule in the network security group for the VM, allowing access on the correct port for the new App Service where I'd deployed the FSH web API. (I have several other Apps accessing the SQL VM, so I don't think this is the issue).
I ran tests in Postman, and Swagger, and they fail with a 500 - Internal server error, A network-related or instance-specific...[Could not connect to SQL Server] (That old chestnut). When I checked the logs through the console of the app service, the logs show the error, and it appears that the web API is still attempting to connect to the local DB for some reason.
[excerpt from log]
"An error occurred using the connection to database '{database}' on server '{server}'.","Properties":{"database":"BigKnockGolf","server":"DADDY","EventId":{"Id":20004,"Name":"Microsoft.EntityFrame...
(My local machine is named DADDY)
My questions:
I think the boilerplate code is spectacular, and while I'm probably foolish for foraging ahead before the REALLY smart guys who are putting this together are finished, I just wanted to answer a few questions in my head before I started trying to actually use this in a production environment. Namely, could I deploy to Azure App Service, and use my existing VM as the backend DB.
Thanks in advance for any feedback,
Danny
Beta Was this translation helpful? Give feedback.
All reactions