4

I have an Azure Cloud Service that hits an Azure SQL Server. When I first set this up, I really didn't know much about what I was doing and just wanted to get familiar with Azure. So now I'm at the spot where I want to take what I have and turn it into a solid deployment structure. Assuming what I have is Prod for now, let's say I am going to create a Dev and Test instance.

The way I understand it, I should simply create 2 additional sets of Cloud Services/SQL Servers for Dev and Test respectively.

So here are my questions, still being a bit of a novice:

1) If I do this, do I create additional Azure projects within my solution to represent each environment, or are they separate configurations within the same Azure Project? Or neither?

2) What would be the best way to handle the different connection strings?

Mike Homol
  • 481
  • 5
  • 19

1 Answers1

1

I assume you want dev, test and prod services because you will have dev, test and prod versions of your visual studio solution.

  1. Neither. Each solution has it's own cloud service project.

  2. You have 6 configuration files (3 solutions, each having one ServiceConfiguration.Local.cscfg and one ServiceConfiguration.Cloud.cscfg). Simply set the configuration strings in the related configuration file. You can do this either by editing the file directly or by expanding the "Roles" folder and double-clicking a role to open the graphical configuration editor.

lightbricko
  • 2,649
  • 15
  • 21
  • So, if I understand correctly, I would have 3 solutions, which would refer to the same code-base, with one major exception, there would be a different Azure Cloud Service Project in each. Then, within those Cloud Service Projects, I would edit the configuration so that my connection string in my web.config would get set differently per solution? – Mike Homol Jun 05 '13 at 13:08
  • @MikeHomol: "same code-base, with one major exception, there would be a different Azure Cloud Service Project in each." I don't understand why you would run dev, test and prod cloud services if they have the same code? Regarding the config file, I use ServiceConfiguration.Local.cscfg and ServiceConfiguration.Cloud.cscfg, but maybe you can use the web.config file for the connection string, I don't know. Apart from this, you understand it correctly. – lightbricko Jun 05 '13 at 13:31
  • So I have an MVC 4.5 site project, called "MySite.csproj". I have a solution called "MySolution.sln" which holds this project, along with an Azure Cloud Service Project, called "Azure.ccproj". I do _not_ have 3 different MVC 4.5 site projects that each represent my different environments. Is that what you would have? If so, I don't understand why you would. What I do see you saying though is that I should have 3 different solutions, called "Prod.sln", "Test.sln", and "Dev.sln", which would each still have "MySite.csproj" but 3 different Azure Cloud Service Projects. – Mike Homol Jun 05 '13 at 14:01
  • @MikeHomol: Why do you want to run dev, test and prod cloud services if they have the same code? – lightbricko Jun 05 '13 at 14:12
  • for testing - my ultimate goal is to have automated builds out of TFS, which would deploy into dev or testing, then once there's consensus, we would move it to production. Make sense? – Mike Homol Jun 05 '13 at 14:20
  • @MikeHomol: No it doesn't make sense to me. It would make sense to have **different** code for the different cloud services. Then you can deploy a stable version to the prod service and unstable versions to dev/test services. – lightbricko Jun 05 '13 at 14:42