I have a Visual Studio 2013 web application project that publishes to an Azure Web Site. However, it only does so when I explicitly do a Publish command. Is there a way to configure VS so that if I change some files locally and hit F5 (Debug), it will publish the changed files to the website and then open the page I've designated? In other words, I shouldn't have to do Publish and then type F5, just F5.

- 98,240
- 88
- 296
- 433

- 341
- 2
- 10
-
I don't know how you would do this, but it doesn't seem a good idea. Why can't you test it locally? – Maria Ines Parnisari Jan 31 '15 at 03:34
-
Azure is a cloud-based service so testing is on one of their servers. They support remote debugging of several languages that are used to write web apps: PHP, .NET, Python, JavaScript (Node.js). As I understand it, Azure does have an emulator for their storage service that will run locally but not an Azure server. I expect they will allow Azure servers to be run as a VM soon. Even if I could test locally, I would still want to hit F5 and have VS upload changed files to the server before running the test server on the new code. – Paul Topping Jan 31 '15 at 16:43
-
You can create a keyboard shortcut for publish.. – Amit Apple Feb 01 '15 at 16:51
2 Answers
I don't know if you're just looking for 1 keystroke to do everything, or if you're ok with a multi-keystroke approach as long as you don't have to right-click your project to publish.
Here's a summary of a multi-keystroke approach that I tried:
- Keyboard shortcut to publish web app
- Keyboard shortcut to launch browser with server URL
Details:
If you're just looking for a keyboard shortcut to publish and view (not necessarily F5) you can use the Publish short command, which includes 2 pairs of keys in rapid succession.
First, make sure that you have selected all the files in your project you want to publish in the Solution Explorer.
Then, press Alt and semicolon together, and immediately press Alt and P together.
- Shortcut: Alt+; , Alt+P
- Reference:https://msdn.microsoft.com/en-us/library/da5kh0wa.aspx
Normally, pressing F5 will launch the web app locally. In order to launch the published version, you could add a command under External Tools (accessed from the Tools menu) to launch a browser instance with a hard-coded server URL for your deployed application. Then, add a keyboard shortcut to trigger it.
To add a keyboard shortcut, click Tools->Options, expand Environment, then click on Keyboard. Add a command for Tools.ExternalCommandX, where X is the Xth external command in your list of external commands.
Hope that helps!

- 1
- 1

- 2,831
- 23
- 26
You can create a new keyboard shortcut to publish your project to Azure and open your browser.
How to create a Publish...
keyboard shortcut
Click the Tools
menu, Options...
, Keyboard
(in the Environment
section). In the Show commands containing
text box, start typing ClassViewContextMenus.ClassViewProject.Publish
and then select it. Next, click in the Press shortcut keys
text box and type the shortcut you would like to use. I ended up using Ctrl+P, Ctrl+P (Global)
. To save, click the Assign
button. You use it like Ctrl+PP
(no need to hit Ctrl
twice, just hold it down). I believe this command is tied to the Startup Project. You'll notice that this will only open the Publish
window. You still have to click the Publish
button or type Alt+P
. After the publish completes, Visual Studio will open a new browser window automatically.
So all I have to do now is type Ctrl+PP
, Alt+P
to publish.

- 853
- 1
- 7
- 14