Skip to content

Latest dll v1.6.1 is touching index on schemas that are ignored #52

@sboregowda-liventusl2

Description

@sboregowda-liventusl2

Since the Azure Pipelines are upgraded to use version 170\dac\bin\sqlpackage.exe, I used the latest v1.6.1 dll and deployed to the development database.
Interestingly Latest dll v1.6.1 is touching index on schemas that are ignored on Azure SQL dacpac deploy task.

Could you please help me here? Thank you.

publish profile.xml

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <IncludeCompositeObjects>True</IncludeCompositeObjects>
    <TargetDatabaseName>Profisee</TargetDatabaseName>
    <DeployScriptFileName>DB_Dev.sql</DeployScriptFileName>
    <TargetConnectionString>Data Source=az-abc.database.windows.net;Initial Catalog=DB1;Connect Timeout=30;Encrypt=True</TargetConnectionString>
    <ScriptDatabaseOptions>False</ScriptDatabaseOptions>
    <BlockOnPossibleDataLoss>True</BlockOnPossibleDataLoss>
    <AllowIncompatiblePlatform>True</AllowIncompatiblePlatform>
    <DropStatisticsNotInSource>False</DropStatisticsNotInSource>
    <ScriptNewConstraintValidation>False</ScriptNewConstraintValidation>
    <DropObjectsNotInSource>True</DropObjectsNotInSource>
    <DropConstraintsNotInSource>False</DropConstraintsNotInSource>
    <DropDmlTriggersNotInSource>False</DropDmlTriggersNotInSource>
    <DropExtendedPropertiesNotInSource>False</DropExtendedPropertiesNotInSource>
    <DropIndexesNotInSource>True</DropIndexesNotInSource>
    <DoNotDropCertificates>True</DoNotDropCertificates>
    <DoNotDropDatabaseRoles>True</DoNotDropDatabaseRoles>
    <DoNotDropLogins>True</DoNotDropLogins>
    <DoNotDropPermissions>True</DoNotDropPermissions>
    <DoNotDropRoleMembership>True</DoNotDropRoleMembership>
    <DoNotDropUsers>True</DoNotDropUsers>
    <IgnoreIndexOptions>True</IgnoreIndexOptions>
    <IgnoreColumnOrder>True</IgnoreColumnOrder>
    <IgnoreIdentitySeed>True</IgnoreIdentitySeed>
    <IgnoreRoleMembership>True</IgnoreRoleMembership>
    <ExcludeDatabaseRoles>True</ExcludeDatabaseRoles>
    <ExcludeLogins>True</ExcludeLogins>
    <ExcludeUsers>True</ExcludeUsers>
    <IgnorePermissions>True</IgnorePermissions>
    <IgnoreTableOptions>True</IgnoreTableOptions>
    <ProfileVersionNumber>1</ProfileVersionNumber>
    <AdditionalDeploymentContributorPaths>C:\Program Files (x86)\Microsoft SQL Server\120\DAC\bin\</AdditionalDeploymentContributorPaths>
    <AdditionalDeploymentContributors>AgileSqlClub.DeploymentFilterContributor</AdditionalDeploymentContributors>
    <AdditionalDeploymentContributorArguments>SqlPackageFilter0=IgnoreSchema!(xyz*.*);SqlPackageFilter1=KeepSchema(xyz_temp);SqlPackageFilter2=IgnoreSchema(xyz_analytics)</AdditionalDeploymentContributorArguments>
  </PropertyGroup>
</Project>

IgnoreSchema!(xyz*.*) --> Intention is to exclude all schemas other than the ones starting wtih xyz

2025-05-05T11:53:02.7160105Z Starting AgileSqlClub.DeploymentFilterContributor
** 2025-05-05T11:53:02.7167256Z - Command Line Filter: IgnoreSchema!(xyz*.*) **
2025-05-05T11:53:02.7174295Z - Command Line Filter: KeepSchema(xyz_temp)
2025-05-05T11:53:02.7182517Z - Command Line Filter: IgnoreSchema(xyz_analytics)
2025-05-05T11:53:02.7188776Z - adding ruleDefinition: Schema
2025-05-05T11:53:02.7195440Z - adding ruleDefinition: Schema
2025-05-05T11:53:02.7202247Z - adding ruleDefinition: Schema
2025-05-05T11:53:02.7209669Z Step removed from deployment by SqlPackageFilter, object: [messaging].[Error].[Error_Index_RowVersion], step type: Drop
2025-05-05T11:53:02.7216697Z Step removed from deployment by SqlPackageFilter, object: [messaging].[Services.Attachments].[Index_RowVersion], step type: Drop
...
...
2025-05-05T11:53:03.5543816Z Step removed from deployment by SqlPackageFilter, object: [stg].[tbl1], step type: Create
2025-05-05T11:53:03.5551121Z Step removed from deployment by SqlPackageFilter, object: [stg].[tbl2], step type: Create
2025-05-05T11:53:03.5558310Z Step removed from deployment by SqlPackageFilter, object: [data].[tb1], step type: Create
2025-05-05T11:53:03.5565473Z -- [data].[tbl2] flagged for future consideration
2025-05-05T11:53:03.5572606Z Step removed from deployment by SqlPackageFilter, object: [data].[tbl2], step type: Alter
2025-05-05T11:53:03.5579744Z -- [data].[tbl3] flagged for future consideration
2025-05-05T11:53:03.5586860Z Step removed from deployment by SqlPackageFilter, object: [data].[tbl3], step type: Alter
2025-05-05T11:53:03.5593969Z -- [data].[tbl3].[ix_100] of type Index has been replaced with an alternate TryDropIndexDeploymentStep
2025-05-05T11:53:03.5601229Z Step REPLACED from deployment by SqlPackageFilter, object: [data].[tbl3].[ix_100], step type: Create , replaced with type: TryDropIndexDeploymentStep
2025-05-05T11:53:03.5608361Z -- [data].[tbl3].[ix_101] of type Index has been replaced with an alternate TryDropIndexDeploymentStep
2025-05-05T11:53:03.5615620Z Step REPLACED from deployment by SqlPackageFilter, object: [data].[tbl3].[ix_101], step type: Create , replaced with type: TryDropIndexDeploymentStep
2025-05-05T11:53:03.5622828Z -- [data].[tbl3].[ix_102] of type Index has been replaced with an alternate TryDropIndexDeploymentStep

...
...
2025-05-05T11:53:04.0109064Z Step removed from deployment by SqlPackageFilter, object: [meta].[tbl1], step type: Alter
2025-05-05T11:53:04.0116326Z Step removed from deployment by SqlPackageFilter, object: [stg].[tbl3_Merge], step type: Alter
...
...
2025-05-05T11:53:04.9830457Z Step removed from deployment by SqlPackageFilter, object: [meta].[tbl2], step type: Alter
2025-05-05T11:53:04.9830709Z Completed AgileSqlClub.DeploymentFilterContributor
2025-05-05T11:53:04.9830922Z Initializing deployment (Complete)
2025-05-05T11:53:04.9831136Z Analyzing deployment plan (Start)
2025-05-05T11:53:05.2164631Z Analyzing deployment plan (Complete)
2025-05-05T11:53:05.2170454Z Updating database (Start)
2025-05-05T11:53:05.5733466Z Creating Index [data].[tbl3].[ix_100]...
2025-05-05T11:53:09.5696006Z Creating Index [data].[tbl3].[ix_101]...
2025-05-05T11:53:17.5155147Z Creating Index [data].[tbl4].[ix_113]...
2025-05-05T11:53:17.6647198Z Creating Index [data].[tbl4].[ix_115]...

...
...
2025-05-05T11:53:27.0023628Z Refreshing View [xyz_rpt].[vw1]...
2025-05-05T11:53:27.0950092Z Refreshing View [xyz_etl].[vw1]...
...
...
2025-05-05T11:53:29.6624649Z Refreshing Procedure [xyz_etl].[sp1]...
2025-05-05T11:53:29.6684535Z Refreshing Procedure [xyz_etl].[sp2]...
2025-05-05T11:53:29.6741132Z Update complete.
2025-05-05T11:53:29.7706329Z Updating database (Complete)
2025-05-05T11:53:29.9198976Z Successfully published database.
2025-05-05T11:53:29.9205205Z Time elapsed 0:01:10.20
2025-05-05T11:53:30.0236640Z ##[section]Finishing: Azure SQL DacpacTask - Publish

I created a "script" action before "publish" and I can see it generated statements to DROP index and CREATE them.

2025-05-05T11:52:02.2388525Z /*
2025-05-05T11:52:02.2389270Z The column [data].[tbl1].[$LastChgDataTransactionID] is being dropped, data loss could occur.
2025-05-05T11:52:02.2389693Z
2025-05-05T11:52:02.2390666Z The column [data].[tbl1].[$LastChgTypeID] is being dropped, data loss could occur.
2025-05-05T11:52:02.2391069Z
2025-05-05T11:52:02.2392021Z The column [data].[tbl1].[$RecordAvatar] is being dropped, data loss could occur.
2025-05-05T11:52:02.2392534Z
2025-05-05T11:52:02.2393587Z The column [data].[tbl1].[$ValidFromDTM] is being dropped, data loss could occur.
2025-05-05T11:52:02.2393986Z
2025-05-05T11:52:02.2394980Z The column [data].[tbl1].[$ValidToDTM] is being dropped, data loss could occur.
2025-05-05T11:52:02.2395558Z */
2025-05-05T11:52:02.2396213Z GO
2025-05-05T11:52:02.2396813Z DROP INDEX IF EXISTS [data].[tbl1].[ix_113]
2025-05-05T11:52:02.2397374Z GO
2025-05-05T11:52:02.2398100Z PRINT N'Creating Index [data].[tbl1].[ix_113]...';
2025-05-05T11:52:02.2398507Z
2025-05-05T11:52:02.2399296Z
2025-05-05T11:52:02.2400062Z GO
2025-05-05T11:52:02.2400614Z CREATE NONCLUSTERED INDEX [ix_113]
2025-05-05T11:52:02.2401210Z ON [data].[tbl1]([list_id] ASC) WITH (FILLFACTOR = 80);
2025-05-05T11:52:02.2401635Z
2025-05-05T11:52:02.2402439Z
2025-05-05T11:52:02.2403118Z GO
2025-05-05T11:52:02.2403784Z DROP INDEX IF EXISTS [data].[tbl1].[ix_115]
2025-05-05T11:52:02.2404368Z GO
2025-05-05T11:52:02.2405022Z PRINT N'Creating Index [data].[tbl1].[ix_115]...';
2025-05-05T11:52:02.2405486Z
2025-05-05T11:52:02.2406022Z
2025-05-05T11:52:02.2406692Z GO
2025-05-05T11:52:02.2407339Z CREATE NONCLUSTERED INDEX [ix_115]
2025-05-05T11:52:02.2408204Z ON [data].[tbl1]([record_source] ASC) WITH (FILLFACTOR = 80);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions