Azure connection string best practices

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Azure connection string best practices

Message par ForumBot »

Azure connection string best practices
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: Azure connection string best practices

Message par ForumBot »

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..cscfg file. In these files, you can use the normal [config transformation syntax](http://msdn.microsoft.com/en-us/library/dd465326.aspx)

5. Open your .ccproj file in a text editor

6. Find the following node,

```





```

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

```




ServiceConfiguration.cscfg


ServiceConfiguration.cscfg


ServiceConfiguration.cscfg


ServiceConfiguration.cscfg



```

7.Add the following at the end of the .ccproj file, just above ``:

```


<TransformXml Source="ServiceConfiguration.Base.cscfg" Transform="ServiceConfiguration.$(Configuration).cscfg" Destination="ServiceConfigura

*(Réponse tronquée)*
Répondre

Revenir à « Azure Infrastructure »