Azure pipeline cannot find seed data txt file to deploy on azure sql using redgate deploy automation

ldelpozoldelpozo Posts: 1 New member
edited April 21, 2022 2:02PM in SQL Change Automation
I'm running a redgate deployment task  on my azurepipeline (RedgateSqlChangeAutomationRelease@4) to deploy my nuget package file on azure sql database Elastic pool but I'm getting the error: 

Cannot bulk load because the file "C:\Users\VssAdministrator\AppData\Local\Temp\DLM Automation\djirrmiq.kal\Seed\DataDictionary.txt" could not be opened. Operating system error code (null).
##[warning]RedGate.Versioning.Engine.Core.DatabaseInteraction.ScriptExecution.Exceptions.DeploymentException: An error occurred during script deployment. Output from SQL Server follows.
---------------------------------------------------------------
Msg 4861, Level 16, State 1, Server usndtaxidmsql01, Line 1
Cannot bulk load because the file "C:\Users\VssAdministrator\AppData\Local\Temp\DLM Automation\djirrmiq.kal\Seed\DataDictionary.txt" could not be opened. Operating system error code (null).
---------------------------------------------------------------

I have in my migration directory an .sql file with the:
BULK INSERT [Core].[DataDictionary]
FROM '$(DeployPath)Seed\DataDictionary.txt'  
WITH (FIELDTERMINATOR = '|', FIRSTROW = 2);
GO

also in my project I have set:
  
<ItemGroup>
   
<Folder Include="Seed" />
  </ItemGroup>
  <ItemGroup>
    <None Include="Seed\DataDictionary.txt">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
  
</ItemGroup>

During pipeline build redgate I can see the file being copied:

##[debug] Copy: Creating directory "bin\Debug\Seed".
##[debug] Copy: Copying file from "D:\a\1\s\EY.Raptor.Forms.Efile\EY.Raptor.Forms.Efile.EFileCatalogDB\Seed\DataDictionary.txt" to "bin\Debug\Seed\DataDictionary.txt".

I'm following this documentation: https://documentation.red-gate.com/sca4/developing-databases/working-with-the-visual-studio-extension/advanced-scenarios-for-visual-studio/using-seed-data-in-visual-studio

Any ideas to share are really appreciated. 

Thank you
Luis

Answers


  • Hello Luis,

    A support ticket has already been opened for this issue by your colleague Pablo Lin. Ticket reference is 271393.

    It appears that the agent is unable to access the local path. We recommend using a hosted agent and adding the file to the Azure repo.

    Please let me know if this helps or if you have any questions.

    Pete Ruiz
    Product Support Engineer
    Redgate





Sign In or Register to comment.