4

I know that Azure uses some runtime magic to override the connection string for my .NET applications. However, I'm trying to port over a wordpress blog and it appears the connection information is stored in a file called wp-config.php. If I input the proper values for the blog into that file then all works fine, but I want to deploy from a public github repository. How do I exclude the connection info from wp-config.php and allow azure to override it at runtime?

1 Answer 1

2

Unless your repository is private you will need to store the wp-config.php file on your Windows Azure instance (or upload it after the fact somehow). Then when the files are pulled into that directory from Github the wp-config.php (assuming no wp-config.php file is in the repo) file will already exist with the connection details.

If you have a private Github repository then it is probably safe to leave the wp-config.php file and values in the repository itself, as only users you give access to the repo can see it.

Sign up to request clarification or add additional context in comments.

3 Comments

That's what I've done for now. So is there no way to get the value from the azure portal?
You can set values in the "app settings" for a website (Look at the CONFIGURE tab for your site in the portal). You could set a variable there with the connection string value, and that variable is available to your application. This article might shed more light: blog.syntaxc4.net/post/2012/07/26/…
@BrianSwan 's comment I think should actually be an answer. He wrote 2 good blog posts about this: blogs.msdn.com/b/silverlining/archive/2012/10/23/… and blogs.msdn.com/b/silverlining/archive/2012/09/26/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.