Reputation: 109
I have a fairly standard setup for an ASP.NET Core application - source control on GitHub with the live application hosted on Azure, with master branch changes triggering CI builds on VSTS. The DB connection string is in appsettings.json, normally pointing at a localdb instance. For deploying to Azure, I want it to point to an Azure SQL DB (which I had neglected to set up during the first publish). The app service itself was set up on Azure as an app service without a DB - in other words, I shouldn't have done this just after waking up. However, both the app service and DB are linked to the same resource group.
The problem I am facing is that whenever I trigger a CI build via VSTS, the build works but the release falls over at the point at which it tries to replace the connection string with the one defined in the CI build variables.
2017-07-09T08:47:02.7205410Z ##[section]Starting: Deploy Azure App Service 2017-07-09T08:47:02.7415413Z ============================================================================== 2017-07-09T08:47:02.7415413Z Task : Azure App Service Deploy 2017-07-09T08:47:02.7415413Z Description : Update Azure App Service using Web Deploy / Kudu REST APIs 2017-07-09T08:47:02.7415413Z Version : 3.3.9 2017-07-09T08:47:02.7415413Z Author : Microsoft Corporation 2017-07-09T08:47:02.7415413Z Help : 2017-07-09T08:47:02.7415413Z ============================================================================== 2017-07-09T08:47:06.5658468Z Got connection details for Azure App Service:'BlackscarsSheetsSwtor' 2017-07-09T08:47:07.6978989Z ##[error]Error: NO JSON file matched with specific pattern: appsettings,json.
I've tried the solution here, only to be met with exactly the same error, though with the log showing **/appsettings.json instead of appsettings.json.
This is the appsettings.json file
{
"ConnectionStrings": {
"DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=Telvee32.BlackscarsSheetsSwtor.Db;Trusted_Connection=True;MultipleActiveResultSets=true"
},
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Warning"
}
}
}
This is my first time working with build and release definitions so it's entirely possible I've fessed something up, but the actual definitions were created automatically by Azure and were working fine until I started doing this, which, given that the application is dependent upon a DB, definitely needs to be working properly.
Upvotes: 3
Views: 1249
Reputation: 400
My initial thoughts are that you've misspelt the JSON config name
Service:'BlackscarsSheetsSwtor' 2017-07-09T08:47:07.6978989Z ##[error]Error: NO JSON file matched with specific pattern: appsettings,json.
Here you have a comma ,
instead of a .
.
Have you checked to see if that's the cause of the problem?
Upvotes: 4