Reputation: 802
Im following this github repo for setting up ci-cd pipeline for synapse using dacpac : https://github.com/santiagxf/synapse-cicd
In the github workflow for CI , AT BUILD DACPAC step , im getting following error :
Build FAILED.
/usr/share/azuredatastudio/resources/app/extensions/mssql/sqltoolsservice/Linux/3.0.0-
release.110/Microsoft.Data.Tools.Schema.SqlTasks.targets(1216,24): error MSB4057: The
target "BuildOnlySettings" does not exist in the project.
Im using SQL Database Projects plugin in Azure Data Studio to create the project. It by default uses .sqlproj .
Following is the dotnet details in teh github runner :
Version: 3.1.416
Commit: 8d3765c609
Runtime Environment:
OS Name: ubuntu
OS Version: 20.04
OS Platform: Linux
RID: ubuntu.20.04-x64
Base Path: /home/runner/.dotnet/sdk/3.1.416/
Host (useful for support):
Version: 3.1.22
Commit: 35fa579a30
.NET Core SDKs installed:
3.1.416 [/home/runner/.dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.22 [/home/runner/.dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.22 [/home/runner/.dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Microsoft (R) Build Engine version 16.7.2+b60ddb6f4 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
/usr/share/azuredatastudio/resources/app/extensions/mssql/sqltoolsservice/Linux/3.0.0-release.110/Microsoft.Data.Tools.Schema.SqlTasks.targets(1216,24): error MSB4057: The target "BuildOnlySettings" does not exist in the project.```
I have also tried using dotnet 5
Upvotes: 0
Views: 764
Reputation: 1
Hopefully you've resolved this issue by now, but in case someone else is searching for a resolution for this issue, I believe this is probably what you're missing in your .sqlproj file:
SQLProj file example with Build Target and other properties illustrated
If you open your .sqlproj file in a text editor you'll see the properties of that file. You should have an XML element named "Project" with a property and value of "DefaultTargets="Build" It would look like this:
enter code here
I tried to add the code for my entire .sqlproj as there are some other important elements to consider when building from Azure Data Studio, especially regarding references to master database, sqlCMDVariables, etc...but I don't post here much at all and the whole "insert code here" thing is super wonky and I don't care to spend an hour trying to figure out how to use it, so...whatever. If there's enough interest I'll figure it out later, but the image will have to do.
Hopefully this helps someone. You'll also see the (usually required) reference to Master Database for any builds, as well as the "Configuration Condition=" within the property group element. That's another important thing to have if you're building using a yml file since you need to explicitly declare your dotnet build in the CI pipeline and all that.
Upvotes: 0