Skip to content

sqlpackage deployment script is recognized differently due to CR/LF. #588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sqlmvp opened this issue Mar 12, 2025 · 2 comments
Open

sqlpackage deployment script is recognized differently due to CR/LF. #588

sqlmvp opened this issue Mar 12, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@sqlmvp
Copy link

sqlmvp commented Mar 12, 2025

  • SqlPackage or DacFx Version: SqlPackage 162.5.57.1
  • .NET Framework (Windows-only) or .NET Core: .NET Frameworkd and .NET Core
  • Environment (local platform and source/target platforms): Windows and Linux(docker)

Steps to Reproduce:
I am developing a deployment pipeline using SqlPackage. The build (creating a Nuget package) is done on a Windows server. The deployment is executed on a Linux container. When I generate a deployment script using the Action:Script command in SqlPackage, it recognizes that the versions are different due to the CR/LF problem, and recognizes it as a new version even though there are no changes.

  1. Create Nuget on Windows
    msbuild.exe" "${{ inputs.projectFile }}" /p:Configuration=Release /p:platform="any cpu" /p:OutputPath="${{ env.releasePath }})

  2. Create deploy script on Linux (Conteriner)
    sqlpackage /action:script
    /sf: DB.dacpac
    /pr:DB.publish.xml
    /op:output.sql
    /tsn:TARGET_SERVER_DOMAIN
    /tdn:TARGET_DB_NAME
    /tu:TARGET_USER_ID /ttsc:true
    /tp:TARGET_USER_PWD \

Did this occur in prior versions? If not - which version(s) did it work in?

(DacFx/SqlPackage/SSMS/Azure Data Studio)

@sqlmvp sqlmvp added the bug Something isn't working label Mar 12, 2025
@SimonSQLML
Copy link

SimonSQLML commented Mar 12, 2025

I'm coming from the same team with @sqlmvp .

Reading dacpac from windows machine and linux machine are treated differently for CR/LF.
Even though, the target DB have exactly same SP. the SqlPackage publish or script feature does update to all SP to replace CRLF to LF to the target server.
Target servers are windows.

This is a critical bug.

We need a option to ignore similar like IgnoreWhitespace.
In addition, option to enforce use CR/LF only when we run the deployment from linux to windows.

Thanks,

@dzsquared
Copy link
Contributor

dzsquared commented Mar 14, 2025

Completely agree that there should be an easier way to normalize the line endings in the deployment - I'm curious though why you are building from a windows pipeline?

edit: you mentioned "we need a option to ignore similar like IgnoreWhitespace" - this property defaults to true, but it's missing the CR/LF differences as whitespace (the bug)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants