Azure Pipeline File Transformation is not working.

2019-07-08 04:24发布

I'm still trying to create my first Azure Pipeline CI / CD. My CI part is working fine, my CD is also working except I cannot apply my Web.config file transformations.

Let me first show you what I have then I will ask several questions below. The build with generated artifact. I also copy manually my 3 config files.

enter image description here

Wen I open my WebAPI.zip file here is the path and content:

enter image description here

Here is my pipeline project

enter image description here

And the details of my staging phase:

enter image description here

When I run this full pipeline my config file is never transformed but I get no error. I just get a

2019-05-02T03:27:23.5778958Z ##[warning]Unable to apply transformation for the given package.

I also have the debug log with full information but it doesn't give me much information for now. I will add it here later.

Questions

  • Azure Pipeline File Transformation is not working. Why?
  • Is it because the File Tranform task only look for config file in zip?
  • Is this system then just ignoring my tranformation file in root of artifact?
  • So I think my manual copy of config transformation file is obsolete?
  • How can I then add my transformation file into my zip?
  • In my csproj I already set all my tranformation files on Build action content, copy always, this is ignored too, is it normal?

EDIT 1

One more important question: Is it possible to simply ask the deployment system to ignore or not deploy my config file. It is not something I want to deploy every time. I like the idea I have to do it manually or from alternative deployment system. With this solution I can have some other issues if I save a version or build variable in my config file. Then is it possible to modify a already deployed file after deployment? I'm looking for workaround here. Example: I read a value in my existing config file then I increment this value by one or simply replace this value with another?

EDIT 2

I'm now able to add the config file to the WebApi.zip package on root and/or in bin folder. I followed the comment of Shayki Abramczyk bu using the xml transform of deploy. Still not working. And the errors messages are so poor. Seriously Microsoft? Is your transformation system even working? I see question similar to mine everywhere.

And now I get

enter image description here

The file is correct, transform works fine from Visual Studio Publish tool. I really think the xml transform tool from Microsoft in Azure is just not working.

EDIT 3

Is it possible to issues from my transformmations come from NLog because of the name and then special rule I apply on it?

enter image description here

0条回答
登录 后发表回答