Copied to clipboard

Flag this post as spam?

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


  • Ole Kristian Losvik 22 posts 73 karma points
    Mar 22, 2016 @ 19:14
    Ole Kristian Losvik
    0

    Use AppSetting value in FileSystemsProviders.config (UmbracoFileSystemProviders.Azure)

    I am trying to use the excellent Azure blob storage providere from https://our.umbraco.org/projects/collaboration/umbracofilesystemprovidersazure/

    However I want to get the connectionString from a file named /AppSettings.config to make it possible to have control over the keys in source control.

    <?xml version="1.0"?>
    <FileSystemProviders>
    
      <!-- Media -->
      <Provider alias="media" type="Our.Umbraco.FileSystemProviders.Azure.AzureBlobFileSystem, Our.Umbraco.FileSystemProviders.Azure">
        <Parameters>
            <add key="containerName" value="media"/>
            <add key="rootUrl" value="https://xx.blob.core.windows.net/"/>
            <add key="connectionString"
                value=System.Configuration.ConfigurationManager.AppSettings["AzureFilesConnectionString"]/>
            <!--
            Optional configuration value determining the maximum number of days to cache items in the browser.
            Defaults to 365 days.
          -->
            <add key="maxDays" value="365"/>
        </Parameters>
      </Provider>
    
    </FileSystemProviders>
    

    And the AppSettings.config

    <appSettings>
      <!-- Azure File blob connection string-->
      <add key="AzureFilesConnectionString" value="xxx" />
      <!-- SendGrid-->
      <add key="mailAccount" value="My mail account." />
      <add key="mailPassword" value="My mail password." />
      <!-- Google -->
      <add key="GoogleClientID" value="1.apps.googleusercontent.com" />
      <add key="GoogleClientSecret" value="My Google client secret." />
    </appSettings>
    
  • Damiaan 442 posts 1301 karma points MVP 6x c-trib
    Mar 22, 2016 @ 20:42
    Damiaan
    0

    And what is your question exactly?

  • Ole Kristian Losvik 22 posts 73 karma points
    Mar 22, 2016 @ 20:49
    Ole Kristian Losvik
    0

    Is it possible to use the value from AppSettings in another config file in a way like this?

  • Ole Kristian Losvik 22 posts 73 karma points
    Apr 02, 2016 @ 23:32
    Ole Kristian Losvik
    0

    There seems to be a perfect pull request on the github site for this plugin, which will be solving this issue. Hopefully it will be merged: https://github.com/JimBobSquarePants/UmbracoFileSystemProviders.Azure/pull/35

Please Sign in or register to post replies

Write your reply to:

Draft