Hi @JingJing Gao,
thanks for the details. A few new things to try that often resolve SQL72018: SqlJsonIndex even when your code has none:
- Prove what’s inside the DACPAC (new)
• Download the built
.dacpac, rename to.zip, openmodel.xml, and search forJsonIndex/SqlJsonIndex. • If found, it’s being injected during build (not from the target DB). Share the small<JsonIndex …>block if you see it. - Correct the exclude switch (new: plural + exact spelling)
In YAML
AdditionalArguments, use the plural form exactly:
/p:ExcludeObjectTypes=JsonIndexes /p:AllowIncompatiblePlatform=True
(Your screenshot shows JsonIndex singular—DacFx ignores that.)
- Lock the provider/tooling (new) • Print the versions used by the agent:
SqlPackage /Version
dotnet --info
• Update to the latest DacFx/SqlPackage on the agent or bump the “Azure SQL Dacpac Deployment” task to its newest major. Mismatched DacFx can light up JSON index types in the model.
- Pin the project target (new)
In the
.sqlproj, set
<TargetPlatform>Microsoft.Data.Tools.Schema.Sql.AzureV12DatabaseSchemaProvider</TargetPlatform>
or choose “Microsoft Azure SQL Database (V12)” in VS. Then Clean and Rebuild. Building against higher providers (e.g., v160) can surface JSON index artifacts even if you don’t author them.
- Isolate references (new) If you reference other DACPACs (master/custom), temporarily remove them and rebuild. One of them may carry a JSON index into your model.
- Sanity check on target (you already ran)
SELECT * FROM sys.json_indexes;
It’s fine if this returns zero—this error is usually about the model.
If it still fails, please share:
• The exact AdditionalArguments line you now use (with JsonIndexes plural),
• SqlPackage /Version from the build log,
• The <TargetPlatform> line from .sqlproj,
• Any <JsonIndex …> snippet found in model.xml.
With those, we can pinpoint which step is injecting SqlJsonIndex and give a precise fix.