Slowcheetah Transforms for Azure Webjobs

青春壹個敷衍的年華 提交于 2019-12-12 14:33:27

问题


In my experience, Slowcheetah does not work with Azure Webjobs.

I'm just looking for confirmation as to whether this is the case (or not).

Cheers


回答1:


I've used this tutorial and it work fine : SlowCheetah VS 2015. Keep in mind that a webjob is just a console app (and more...)

  1. Add the slowcheetah nuget package to your webjob project.
  2. Add the app.config transform to your project, for example app.Debug.config and app.Release.config
  3. Edit your *.csproj file and add these lines (depending on the name and number of transformation you want :

    <None Include="App.Release.config">
        <DependentUpon>App.config</DependentUpon>
        <TransformOnBuild>True</TransformOnBuild>
    </None>
    <None Include="App.Debug.config">
        <DependentUpon>App.config</DependentUpon>
        <TransformOnBuild>True</TransformOnBuild>
    </None>
    

above these lines :

    <None Include="App.config">
        <TransformOnBuild>true</TransformOnBuild>
        <SubType>Designer</SubType>
    </None>

4. Reload your project and it should work.




回答2:


I've created a Web API project that deploys an Azure WebJob (SDK 2.5), which uses SlowCheetah transforms. When my Web App is published to Azure, the WebJob App.config contains the transformed values from the SlowCheetah transform. I'm confident it works as you'd expect.




回答3:


I have solved the mystery, I believe, regarding the reason this is failing for some and not for others.

To ensure this works, in your Package Manger Console, before installing the SlowCheetah nuget package, run the command "Set-ExecutionPolicy Unrestricted".

I bet everyone who has this failing, if they check their output log during install of the package, will see the ps1 script failing to execute which is setting up the necessary build settings for the transformation to take place.

Be sure to set your execution policy back to a desired security configuration after this is complete since the unrestricted policy is a potential threat.




回答4:


I've found that SlowCheetah does not work for me when publishing console applications to Azure as Web Jobs from Visual Studio 2015.

My issue is described in this stackoverflow question: Why are config transforms not applied when I manually publish a console app as an Azure webjob? and there's also an answer there that provides a quick fix for the problem.

Additionally I've opened a GitHub Issue in the SlowCheetah repo.




回答5:


For me it was also not working with the Publishing Profiles and the Azure WebJob. The workaround was that i've created a new Build Configuration with the full name of the publishing profile and then it started working and transformed the app.config.



来源:https://stackoverflow.com/questions/29598097/slowcheetah-transforms-for-azure-webjobs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!