Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Wiebe Tijsma 16 posts 92 karma points
    Apr 16, 2014 @ 20:18
    Wiebe Tijsma
    0

    Configuration management when deploying to azure using GIT

    Hi,

    I just started to use Umbraco, and I have a test/staging/production environment that I deploy as an Azure website using git.

    Azure allows me to specify different appSettings and connectionStrings from the management console, but how about the umbraco settings that are different per environment, such as the FileSystemProviders.config?

    Is there a way that the path to FileSystemProviders.config file used can be specified in the appSettings, or can I use variables from the appSettings in the FileSystemProviders.config?

    What's the recommended approach here?

    Thanks,

    Wiebe

  • Wiebe Tijsma 16 posts 92 karma points
    Apr 17, 2014 @ 10:47
    Wiebe Tijsma
    0

    Is it possible perhaps to configure the FileSystemProviders in code somewhere?

  • Wiebe Tijsma 16 posts 92 karma points
    Apr 23, 2014 @ 18:05
    Wiebe Tijsma
    0

    If anyone's interested, I've found this excellent article that helped me set up the configuration management:

    http://brian.vallelunga.com/blog/chaining-azure-web-config-transforms-when-deploying-from-source-control

    Basically, you can 'chain' web config transformations and pick one based on a setting you can configure in the Azure control panel:

    Add this and for example a Web.Staging.config and a config\FileSystemProviders.Staging.config to your project file:

    <Target Name="AfterBuild">
        <TransformXml Condition=" '$(Environment)' != '' " Source="Web.config" Transform="Web.$(Environment).config" Destination="Web.config" />
    </Target>
    

    The configure this as an 'App Setting' in the Azure control panel:

    key:SCM_BUILD_ARGS value: /p:Environment=Staging 
    

    note that I explicitly had to add a space in front of the /p to prevent getting a build error

    Then I have this in my Web.Staging.config:

     <umbracoConfiguration>
        <FileSystemProviders configSource="config\FileSystemProviders.Staging.config" xdt:Transform="Replace" />
      </umbracoConfiguration>
    

    And miraculously it worked.

    Though I would like to still hear if there's a place that allows me to to Umbraco service configuration in code.

    Cheers!

    Wiebe

Please Sign in or register to post replies

Write your reply to:

Draft