Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4018666
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:00:40+00:00 2026-05-20T10:00:40+00:00

I have an application that I am just migrating to Azure. Currently I use

  • 0

I have an application that I am just migrating to Azure. Currently I use web.config transformation to manage changing the database connecting string dev/staging/prod environments. How is it best to manage these multiple connection strings in Azure?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T10:00:41+00:00Added an answer on May 20, 2026 at 10:00 am

    In cases where it doesn’t matter if the developer can see production credentials, you can use the built-in Visual Studio 10 config transformations. If this is what you’re looking for, follow these steps:

    1.Navigate to your Azure project folder in file explorer
    2. Make a copy of ServiceConfiguration.cscfg
    3. Rename copy to ServiceConfiguration.Base.cscfg
    4. For each build configuration (e.g. Dev, Staging, Production), create a ServiceConfiguration.<build config name>.cscfg file. In these files, you can use the normal config transformation syntax
    5. Open your .ccproj file in a text editor
    6. Find the following node,

    <ItemGroup>
        <ServiceDefinition Include="ServiceDefinition.csdef" />
        <ServiceConfiguration Include="ServiceConfiguration.cscfg" />
    </ItemGroup>
    

    and replace it with this (you will have to edit this block to match your build configs):

    <ItemGroup>
        <ServiceDefinition Include="ServiceDefinition.csdef" />
        <ServiceConfiguration Include="ServiceConfiguration.cscfg" />
        <None Include="ServiceConfiguration.Base.cscfg">
            <DependentUpon>ServiceConfiguration.cscfg</DependentUpon>
        </None>
        <None Include="ServiceConfiguration.Dev.cscfg">
            <DependentUpon>ServiceConfiguration.cscfg</DependentUpon>
        </None>
        <None Include="ServiceConfiguration.Staging.cscfg">
            <DependentUpon>ServiceConfiguration.cscfg</DependentUpon>
        </None>
        <None Include="ServiceConfiguration.Production.cscfg">
            <DependentUpon>ServiceConfiguration.cscfg</DependentUpon>
        </None>
    </ItemGroup>
    

    7.Add the following at the end of the .ccproj file, just above </Project>:

    <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets" />
    <Target Name="BeforeBuild">
        <TransformXml Source="ServiceConfiguration.Base.cscfg" Transform="ServiceConfiguration.$(Configuration).cscfg" Destination="ServiceConfiguration.cscfg" />
    </Target>
    

    8.If you’re using a CI server that doesn’t have Visual Studio 10 installed, you’ll probably have to copy the C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\Web folder and its contents from a development machine to the server.

    Update: As @SolarSteve noted, you might have to add a namespace to your ServiceConfiguration.*.cscfg files. Here’s an example of ServiceConfiguration.Base.cscfg:

    <sc:ServiceConfiguration serviceName="MyServiceName" osFamily="1" osVersion="*" xmlns:sc="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
      <sc:Role name="MyRoleName">
        <sc:Instances count="1" />
        <sc:ConfigurationSettings>
          <sc:Setting name="DataConnectionString" value="xxx" />
        </sc:ConfigurationSettings>
      </sc:Role>
    </sc:ServiceConfiguration>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a UINavigationController based application that works just fine. I'd like to
I have a web application that runs fine under IIS5 or IIS6. I just
I just started to use SQL Server 2008. I have a winforms application that
I have just been involved in writing an application that does not use Doctype's
I have a WCF service and a Silverlight application that work just fine when
In my application I have groups which are essentially just tags that can be
I just want to know that can i make an application which have some
Can I create an application with Flex Builder Trial ( that I have just
I have a simple MVC 4 (Beta) Application and just observed something that I
I have an ASP.NET Web Application project that used to target ASP.NET 2.0. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.