Skip to content

Commit 6e8fe34

Browse files
committed
filename changes
1 parent 8d289eb commit 6e8fe34

File tree

2 files changed

+239
-0
lines changed

2 files changed

+239
-0
lines changed
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
---
2+
title: "Publish to Azure by importing publish settings"
3+
ms.custom: "Create and import a publishing profile to deploy an application from Visual Studio to Azure App Service"
4+
ms.date: "05/07/2018"
5+
ms.technology: vs-ide-deployment
6+
ms.topic: "tutorial"
7+
helpviewer_keywords:
8+
- "deployment, publish settings"
9+
author: mikejo5000
10+
ms.author: mikejo
11+
manager: douge
12+
ms.workload:
13+
- "multiple"
14+
---
15+
# Publish an application to Azure App Service by importing publish settings in Visual Studio
16+
17+
You can use the **Publish** tool to import publish settings and then deploy your app. In this article, we use publish settings for Azure App Service, but you can use similar steps to import publish settings from [IIS](../deployment/tutorial-import-publish-settings-iis.md). In some scenarios, use of a publish settings profile can be faster than manually configuring deployment to the service for each installation of Visual Studio.
18+
19+
These steps apply to ASP.NET, ASP.NET Core, and .NET Core apps in Visual Studio. The steps correspond to Visual Studio 2017 version 15.6.
20+
21+
In this tutorial, you will:
22+
23+
> [!div class="checklist"]
24+
> * Generate a publish settings file from Azure App Service
25+
> * Import the publish settings file into Visual Studio
26+
> * Deploy the app to Azure App Service
27+
28+
A publish settings file (*.publishsettings) is different than a publishing profile (*.pubxml) created in Visual Studio. A publish settings file is created by Azure App Service, and then it can be imported into Visual Studio.
29+
30+
> [!NOTE]
31+
> If you just need to copy a Visual Studio publishing profile (\*.pubxml file) from one installation of Visual Studio to another, you can find the publishing profile, *\<profilename\>.pubxml*, in the *\\<projectname\>\Properties\PublishProfiles* folder for managed project types. For websites, look under the *\App_Data* folder. The publishing profiles are MSBuild XML files.
32+
33+
## Prerequisites
34+
35+
* You must have Visual Studio installed and the **ASP.NET** and **.NET Framework** development workload. For a .NET Core app, you also need the **.NET Core** workload.
36+
37+
If you haven't already installed Visual Studio, install it for free [here](http://www.visualstudio.com).
38+
39+
* Create an Azure App Service. For detailed instructions, see [Deploy an ASP.NET Core web app to Azure using Visual Studio](/aspnet/core/tutorials/publish-to-azure-webapp-using-vs).
40+
41+
## Create a new ASP.NET project in Visual Studio
42+
43+
1. On the computer running Visual Studio, choose **File > New Project**.
44+
45+
1. Under **Visual C#** or **Visual Basic**, choose **Web**, and then in the middle pane choose either **ASP.NET Web Application (.NET Framework)** or (C# only) **ASP.NET Core Web Application**, and then click **OK**.
46+
47+
If you don't see the specified project templates, click the **Open Visual Studio Installer** link in the left pane of the **New Project** dialog box. The Visual Studio Installer launches. See the prerequisites in this article to identify the required Visual Studio workloads, which you must install.
48+
49+
1. Choose either **MVC** (.NET Framework) or **Web Application (Model-View-Controller)** (for .NET Core), and make sure that **No Authentication** is selected, and then click **OK**.
50+
51+
1. Type a name like **MyWebApp** and click **OK**.
52+
53+
Visual Studio creates the project.
54+
55+
1. Choose **Build > Build Solution** to build the project.
56+
57+
## Create the publish settings file in Azure App Service
58+
59+
1. In the Azure portal, open the Azure App Service.
60+
61+
1. Click **Get publish profile** and save the profile locally.
62+
63+
![Get the publish profile](../deployment/media/tutorial-azure-app-service-get-publish-profile.png)
64+
65+
A file with a *.publishsettings* file extension has been generated in the location where you saved it. The following code shows a partial example of the file (in a more readable formatting).
66+
67+
```xml
68+
<publishData>
69+
<publishProfile
70+
profileName="DeployASPDotNetCore - Web Deploy"
71+
publishMethod="MSDeploy"
72+
publishUrl="deployaspdotnetcore.scm.azurewebsites.net:443"
73+
msdeploySite="DeployASPDotNetCore"
74+
userName="$DeployASPDotNetCore"
75+
userPWD="abcdefghijklmnopqrstuzwxyz"
76+
destinationAppUrl="http://deployaspdotnetcore20180508031824.azurewebsites.net"
77+
SQLServerDBConnectionString=""
78+
mySQLDBConnectionString=""
79+
hostingProviderForumLink=""
80+
controlPanelLink="http://windows.azure.com"
81+
webSystem="WebSites">
82+
<databases />
83+
</publishProfile>
84+
</publishData>
85+
```
86+
Typically, the preceding *.publishsettings file contains two publishing profiles that you can use in Visual Studio, one to deploy using Web Deploy, and one to deploy using FTP. The preceding code shows the Web Deploy profile. Both profiles will be imported later when you import the profile.
87+
88+
## Import the publish settings in Visual Studio and deploy
89+
90+
1. On the computer where you have the ASP.NET project open in Visual Studio, right-click the project in Solution Explorer, and choose **Publish**.
91+
92+
1. If you have previously configured any publishing profiles, the **Publish** pane appears. Click **Create new profile**.
93+
94+
1. In the **Pick a publish target** dialog box, click **Import Profile**.
95+
96+
![Choose Publish](../deployment/media/tutorial-publish-tool-import-profile.png)
97+
98+
1. Navigate to the location of the publish settings file that you created in the previous section.
99+
100+
1. In the **Import Publish Settings File** dialog box, select the profile that you created in the previous section, and click **Open**.
101+
102+
1. Select one of the two imported profiles, and click **Publish**.
103+
104+
Visual Studio begins the deployment process, and the Output window shows progress and results.
105+
106+
## Next steps
107+
108+
In this tutorial, you created a publish settings file, imported it into Visual Studio, and deployed an ASP.NET app to Azure App Service.
109+
110+
> [!div class="nextstepaction"]
111+
> [First look at deployment](../deployment/deploying-applications-services-and-components.md)
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
---
2+
title: "Publish to IIS by importing publish settings"
3+
ms.custom: "Create and import a publishing profile to deploy an application from Visual Studio to IIS"
4+
ms.date: "05/07/2018"
5+
ms.technology: vs-ide-deployment
6+
ms.topic: "tutorial"
7+
helpviewer_keywords:
8+
- "deployment, publish settings"
9+
author: mikejo5000
10+
ms.author: mikejo
11+
manager: douge
12+
ms.workload:
13+
- "multiple"
14+
---
15+
# Publish an application to IIS by importing publish settings in Visual Studio
16+
17+
You can use the **Publish** tool to import publish settings and then deploy your app. In this article, we use publish settings for IIS, but you can use similar steps to import publish settings for [Azure App Service](../deployment/tutorial-import-publish-settings-azure.md). In some scenarios, use of a publish settings profile can be faster than manually configuring deployment to IIS for each installation of Visual Studio.
18+
19+
These steps apply to ASP.NET, ASP.NET Core, and .NET Core apps in Visual Studio. The steps correspond to Visual Studio 2017 version 15.6.
20+
21+
In this tutorial, you will:
22+
23+
> [!div class="checklist"]
24+
> * Configure IIS so that you can generate a publish settings file
25+
> * Create a publish settings file
26+
> * Import the publish settings file into Visual Studio
27+
> * Deploy the app to IIS
28+
29+
A publish settings file (\*.publishsettings) is different than a publishing profile (\*.pubxml) created in Visual Studio. A publish settings file is created by IIS or Azure App Service, or it can be manually created, and then it can be imported into Visual Studio.
30+
31+
> [!NOTE]
32+
> If you just need to copy a Visual Studio publishing profile (\*.pubxml file) from one installation of Visual Studio to another, you can find the publishing profile, *\<profilename\>.pubxml*, in the *\\<projectname\>\Properties\PublishProfiles* folder for managed project types. For websites, look under the *\App_Data* folder. The publishing profiles are MSBuild XML files.
33+
34+
## Prerequisites
35+
36+
* You must have Visual Studio installed and the **ASP.NET** and **.NET Framework** development workload. For a .NET Core app, you also need the **.NET Core** workload.
37+
38+
If you haven't already installed Visual Studio, install it for free [here](http://www.visualstudio.com).
39+
40+
The steps in this article are based on Visual Studio 2017
41+
42+
* To generate the publish settings file from IIS, you must have another computer running Windows Server 2012 with the IIS 8.0 Web Server role correctly configured and either ASP.NET 4.5 or ASP.NET Core installed. For ASP.NET Core, see [Publishing to IIS](/aspnet/core/publishing/iis?tabs=aspnetcore2x#iis-configuration). For ASP.NET 4.5, see [IIS 8.0 Using ASP.NET 3.5 and ASP.NET 4.5](/iis/get-started/whats-new-in-iis-8/iis-80-using-aspnet-35-and-aspnet-45).
43+
44+
## Create a new ASP.NET project in Visual Studio
45+
46+
1. On the computer running Visual Studio, choose **File > New Project**.
47+
48+
1. Under **Visual C#** or **Visual Basic**, choose **Web**, and then in the middle pane choose either **ASP.NET Web Application (.NET Framework)** or (C# only) **ASP.NET Core Web Application**, and then click **OK**.
49+
50+
If you don't see the specified project templates, click the **Open Visual Studio Installer** link in the left pane of the **New Project** dialog box. The Visual Studio Installer launches. See the prerequisites in this article to identify the required Visual Studio workloads, which you must install.
51+
52+
1. Choose either **MVC** (.NET Framework) or **Web Application (Model-View-Controller)** (for .NET Core), and make sure that **No Authentication** is selected, and then click **OK**.
53+
54+
1. Type a name like **MyWebApp** and click **OK**.
55+
56+
Visual Studio creates the project.
57+
58+
1. Choose **Build > Build Solution** to build the project.
59+
60+
## Install and configure Web Deploy on Windows Server
61+
62+
[!INCLUDE [install-web-deploy-with-hosting-server](../deployment/includes/install-web-deploy-with-hosting-server.md)]
63+
64+
## Create the publish settings file in IIS on Windows Server
65+
66+
1. In IIS, right-click the **Default Web Site**, choose **Deploy** > **Configure Web Deploy Publishing**.
67+
68+
![Configure Web Deploy configuration](../deployment/media/tutorial-configure-web-deploy-publishing.png)
69+
70+
1. In the **Configure Web Deploy Publishing** dialog box, examine the settings.
71+
72+
1. Click **Setup**.
73+
74+
In the **Results** panel, the output shows that access rights have been granted to the specified user, and that a file with a *.publishsettings* file extension has been generated in the location shown in the dialog box.
75+
76+
```xml
77+
<?xml version="1.0" encoding="utf-8"?>
78+
<publishData>
79+
<publishProfile
80+
publishUrl="https://myhostname:8172/msdeploy.axd"
81+
msdeploySite="Default Web Site"
82+
destinationAppUrl="http://myhostname:80/"
83+
mySQLDBConnectionString=""
84+
SQLServerDBConnectionString=""
85+
profileName="Default Settings"
86+
publishMethod="MSDeploy"
87+
userName="myhostname\myusername" />
88+
</publishData>
89+
```
90+
91+
Depending on your Windows Server and IIS configuration, you will see different values. Here are a few details about the values that you see:
92+
93+
* The *msdeploy.axd* file referenced in the `publishUrl` attribute is a dynamically-generated HTTP handler file for Web Deploy. (For testing purposes, `http://myhostname:8172` will generally work as well.)
94+
* The `publishUrl` port is usually set to port 8172, which is the default for Web Deploy.
95+
* The `destinationAppUrl` port is usually set to port 80, which is the default for IIS.
96+
* If you are unable to connect to the remote host in Visual Studio using the host name (in later steps), test the IP address in place of the host name.
97+
98+
> [!NOTE]
99+
> If you are publishing to IIS running on an Azure VM, the Web Deploy and IIS ports must be opened in the Network Security group. For detailed information, see [Install and run IIS](/azure/virtual-machines/windows/quick-create-portal#open-port-80-for-web-traffic).
100+
101+
1. Copy this file to the computer where you are running Visual Studio.
102+
103+
## Import the publish settings in Visual Studio and deploy
104+
105+
1. On the computer where you have the ASP.NET project open in Visual Studio, right-click the project in Solution Explorer, and choose **Publish**.
106+
107+
1. If you have previously configured any publishing profiles, the **Publish** pane appears. Click **Create new profile**.
108+
109+
1. In the **Pick a publish target** dialog box, click **Import Profile**.
110+
111+
![Choose Publish](../deployment/media/tutorial-publish-tool-import-profile.png)
112+
113+
1. Navigate to the location of the publish settings file that you created in the previous section.
114+
115+
1. In the **Import Publish Settings File** dialog box, navigate to and select the profile that you created in the previous section, and click **Open**.
116+
117+
Visual Studio begins the deployment process, and the Output window shows progress and results.
118+
119+
If you get an any deployment errors, click **Settings** to edit settings. Modify settings and click **Validate** to test new settings.
120+
121+
![Edit settings in the Publish tool](../deployment/media/tutorial-configure-publish-settings-in-tool.png)
122+
123+
## Next steps
124+
125+
In this tutorial, you created a publish settings file, imported it into Visual Studio, and deployed an ASP.NET app to IIS.
126+
127+
> [!div class="nextstepaction"]
128+
> [First look at deployment](../deployment/deploying-applications-services-and-components.md)

0 commit comments

Comments
 (0)