Skip to content

Commit 81bf39a

Browse files
Merge pull request #281623 from tomvcassidy/27CSDate
ms.date and acrolinx for three articles
2 parents e9c0241 + 80d7d1b commit 81bf39a

File tree

3 files changed

+66
-65
lines changed

3 files changed

+66
-65
lines changed

articles/cloud-services/cloud-services-nodejs-develop-deploy-express-app.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
title: Build and deploy a Node.js Express app to Azure Cloud Services (classic)
3-
description: Use this tutorial to create a new application using the Express module, which provides an MVC framework for creating Node.js web applications.
3+
description: Use this tutorial to create a new application using the Express module, which provides a Model-View-Control (MVC) framework for creating Node.js web applications.
44
ms.topic: article
55
ms.service: cloud-services
6-
ms.date: 02/21/2023
6+
ms.date: 07/23/2024
77
author: hirenshah1
88
ms.author: hirshah
99
ms.reviewer: mimckitt
@@ -15,11 +15,11 @@ ms.custom: compute-evergreen, devx-track-js
1515
[!INCLUDE [Cloud Services (classic) deprecation announcement](includes/deprecation-announcement.md)]
1616

1717
Node.js includes a minimal set of functionality in the core runtime.
18-
Developers often use 3rd party modules to provide additional
19-
functionality when developing a Node.js application. In this tutorial
20-
you'll create a new application using the [Express](https://github.com/expressjs/express) module, which provides an MVC framework for creating Node.js web applications.
18+
Developers often use non-Microsoft modules to provide more
19+
functionality when developing a Node.js application. In this tutorial,
20+
you create a new application using the [Express](https://github.com/expressjs/express) module, which provides a Model-View-Control framework for creating Node.js web applications.
2121

22-
A screenshot of the completed application is below:
22+
The following screenshot shows the completed application:
2323

2424
![A web browser displaying Welcome to Express in Azure](./media/cloud-services-nodejs-develop-deploy-express-app/node36.png)
2525

@@ -40,9 +40,7 @@ Perform the following steps to create a new cloud service project named `express
4040
```
4141

4242
> [!NOTE]
43-
> By default, **Add-AzureNodeWebRole** uses an older version of Node.js. The **Set-AzureServiceProjectRole** statement above instructs Azure to use v0.10.21 of Node. Note the parameters are case-sensitive. You can verify the correct version of Node.js has been selected by checking the **engines** property in **WebRole1\package.json**.
44-
>
45-
>
43+
> By default, **Add-AzureNodeWebRole** uses an older version of Node.js. The preceding **Set-AzureServiceProjectRole** line instructs Azure to use v0.10.21 of Node. Note the parameters are case-sensitive. You can verify the correct version of Node.js has been selected by checking the **engines** property in **WebRole1\package.json**.
4644
4745
## Install Express
4846
1. Install the Express generator by issuing the following command:
@@ -51,40 +49,44 @@ Perform the following steps to create a new cloud service project named `express
5149
PS C:\node\expressapp> npm install express-generator -g
5250
```
5351
54-
The output of the npm command should look similar to the result below.
52+
The following screenshot shows the output of the npm command. Your output should look similar.
5553
5654
![Windows PowerShell displaying the output of the npm install express command.](./media/cloud-services-nodejs-develop-deploy-express-app/express-g.png)
55+
5756
2. Change directories to the **WebRole1** directory and use the express command to generate a new application:
5857
5958
```powershell
6059
PS C:\node\expressapp\WebRole1> express
6160
```
6261
63-
You'll be prompted to overwrite your earlier application. Enter **y** or **yes** to continue. Express will generate the app.js file and a folder structure for building your application.
62+
To continue, enter **y** or **yes** when prompted to overwrite your earlier application. Express generates the app.js file and a folder structure for building your application.
6463
6564
![The output of the express command](./media/cloud-services-nodejs-develop-deploy-express-app/node23.png)
66-
3. To install additional dependencies defined in the package.json file,
65+
66+
3. To install the other dependencies defined in the package.json file,
6767
enter the following command:
6868
6969
```powershell
7070
PS C:\node\expressapp\WebRole1> npm install
7171
```
7272
7373
![The output of the npm install command](./media/cloud-services-nodejs-develop-deploy-express-app/node26.png)
74-
4. Use the following command to copy the **bin/www** file to **server.js**. This is so the cloud service can find the entry point for this application.
74+
75+
4. Use the following command to copy the **bin/www** file to **server.js**. This step allows the cloud service to find the entry point for this application.
7576
7677
```powershell
7778
PS C:\node\expressapp\WebRole1> copy bin/www server.js
7879
```
7980
8081
After this command completes, you should have a **server.js** file in the WebRole1 directory.
82+
8183
5. Modify the **server.js** to remove one of the '.' characters from the following line.
8284
8385
```js
8486
var app = require('../app');
8587
```
8688
87-
After making this modification, the line should appear as follows.
89+
Once you make this modification, the line should appear as follows:
8890
8991
```js
9092
var app = require('./app');
@@ -101,7 +103,7 @@ Perform the following steps to create a new cloud service project named `express
101103
102104
## Modifying the View
103105
Now modify the view to display the message "Welcome to Express in
104-
Azure".
106+
Azure."
105107
106108
1. Enter the following command to open the index.jade file:
107109
@@ -117,7 +119,7 @@ Azure".
117119
118120
![The index.jade file, the last line reads: p Welcome to \#{title} in Azure](./media/cloud-services-nodejs-develop-deploy-express-app/node31.png)
119121
3. Save the file and exit Notepad.
120-
4. Refresh your browser and you'll see your changes.
122+
4. To see your changes, refresh your browser.
121123
122124
![A browser window, the page contains Welcome to Express in Azure](./media/cloud-services-nodejs-develop-deploy-express-app/node32.png)
123125
@@ -130,7 +132,7 @@ In the Azure PowerShell window, use the **Publish-AzureServiceProject** cmdlet t
130132
PS C:\node\expressapp\WebRole1> Publish-AzureServiceProject -ServiceName myexpressapp -Location "East US" -Launch
131133
```
132134

133-
Once the deployment operation completes, your browser will open and display the web page.
135+
Once the deployment operation completes, your browser opens and displays the web page.
134136

135137
![A web browser displaying the Express page. The URL indicates it is now hosted on Azure.](./media/cloud-services-nodejs-develop-deploy-express-app/node36.png)
136138

articles/cloud-services/cloud-services-performance-testing-visual-studio-profiler.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Profiling a Cloud Service (classic) Locally in the Compute Emulator | Mic
33
description: Investigate performance issues in cloud services with the Visual Studio profiler
44
ms.topic: article
55
ms.service: cloud-services
6-
ms.date: 02/21/2023
6+
ms.date: 07/23/2024
77
author: hirenshah1
88
ms.author: hirshah
99
ms.reviewer: mimckitt
@@ -13,25 +13,25 @@ ms.custom: compute-evergreen
1313

1414
[!INCLUDE [Cloud Services (classic) deprecation announcement](includes/deprecation-announcement.md)]
1515

16-
A variety of tools and techniques are available for testing the performance of cloud services.
16+
Various tools and techniques are available for testing the performance of cloud services.
1717
When you publish a cloud service to Azure, you can have Visual Studio collect profiling
1818
data and then analyze it locally, as described in [Profiling an Azure Application][1].
19-
You can also use diagnostics to track a variety of performance
19+
You can also use diagnostics to track numerous performance
2020
counters, as described in [Using performance counters in Azure][2].
2121
You might also want to profile your application locally in the compute emulator before deploying it to the cloud.
2222

23-
This article covers the CPU Sampling method of profiling, which can be done locally in the emulator. CPU sampling is a method of profiling that is not very intrusive. At a designated sampling interval, the profiler takes a snapshot of the call stack. The data is collected over a period of time, and shown in a report. This method of profiling tends to indicate where in a computationally intensive application most of the CPU work is being done. This gives you the opportunity to focus on the "hot path" where your application is spending the most time.
23+
This article covers the CPU Sampling method of profiling, which can be done locally in the emulator. CPU sampling is a method of profiling that isn't intrusive. At a designated sampling interval, the profiler takes a snapshot of the call stack. The data is collected over a period of time, and shown in a report. This method of profiling tends to indicate where in a computationally intensive application most of the CPU work is being done, giving you the opportunity to focus on the "hot path" where your application is spending the most time.
2424

25-
## 1: Configure Visual Studio for profiling
26-
First, there are a few Visual Studio configuration options that might be helpful when profiling. To make sense of the profiling reports, you'll need symbols (.pdb files) for your application and also symbols for system libraries. You'll want to make sure that you reference the available symbol servers. To do this, on the **Tools** menu in Visual Studio, choose **Options**, then choose **Debugging**, then **Symbols**. Make sure that Microsoft Symbol Servers is listed under **Symbol file (.pdb) locations**. You can also reference https://referencesource.microsoft.com/symbols, which might have additional symbol files.
25+
## Configure Visual Studio for profiling
26+
First, there are a few Visual Studio configuration options that might be helpful when profiling. To make sense of the profiling reports, you need symbols (.pdb files) for your application and also symbols for system libraries. Make sure you reference the available symbol servers; to do so, on the **Tools** menu in Visual Studio, choose **Options**, then choose **Debugging**, then **Symbols**. Make sure that Microsoft Symbol Servers is listed under **Symbol file (.pdb) locations**. You can also reference https://referencesource.microsoft.com/symbols, which might have more symbol files.
2727

2828
![Symbol options][4]
2929

3030
If desired, you can simplify the reports that the profiler generates by setting Just My Code. With Just My Code enabled, function call stacks are simplified so that calls entirely internal to libraries and the .NET Framework are hidden from the reports. On the **Tools** menu, choose **Options**. Then expand the **Performance Tools** node, and choose **General**. Select the checkbox for **Enable Just My Code for profiler reports**.
3131

3232
![Just My Code options][17]
3333

34-
You can use these instructions with an existing project or with a new project. If you create a new project to try the techniques described below, choose a C# **Azure Cloud Service** project, and select a **Web Role** and a **Worker Role**.
34+
You can use these instructions with an existing project or with a new project. If you create a new project to try the following techniques, choose a C# **Azure Cloud Service** project, and select a **Web Role** and a **Worker Role**.
3535

3636
![Azure Cloud Service project roles][5]
3737

@@ -68,24 +68,24 @@ private async Task RunAsync(CancellationToken cancellationToken)
6868
}
6969
```
7070

71-
Build and run your cloud service locally without debugging (Ctrl+F5), with the solution configuration set to **Release**. This ensures that all files and folders are created for running the application locally, and ensures that all the emulators are started. Start the Compute Emulator UI from the taskbar to verify that your worker role is running.
71+
Build and run your cloud service locally without debugging (Ctrl+F5), with the solution configuration set to **Release**. This setting ensures that all files and folders are created for running the application locally and that all the emulators are started. To verify that your worker role is running, start the Compute Emulator UI from the taskbar.
7272

73-
## 2: Attach to a process
73+
## Attach to a process
7474
Instead of profiling the application by starting it from the Visual Studio 2010 IDE, you must attach the profiler to a running process.
7575

76-
To attach the profiler to a process, on the **Analyze** menu, choose **Profiler** and **Attach/Detach**.
76+
To attach the profiler to a process, go to the **Analyze** menu, select **Profiler**, and choose **Attach/Detach**.
7777

7878
![Attach profile option][6]
7979

8080
For a worker role, find the WaWorkerHost.exe process.
8181

8282
![WaWorkerHost process][7]
8383

84-
If your project folder is on a network drive, the profiler will ask you to provide another location to save the profiling reports.
84+
If your project folder is on a network drive, the profiler asks you to provide another location to save the profiling reports.
8585

8686
You can also attach to a web role by attaching to WaIISHost.exe.
8787
If there are multiple worker role processes in your application, you need to use the processID to distinguish them. You can query the processID programmatically by accessing the Process object. For example, if you add this code to the Run method of the RoleEntryPoint-derived class in a role, you can look at the
88-
log in the Compute Emulator UI to know what process to connect to.
88+
sign-in the Compute Emulator UI to know what process to connect to.
8989

9090
```csharp
9191
var process = System.Diagnostics.Process.GetCurrentProcess();
@@ -101,33 +101,33 @@ Open the worker role log console window in the Compute Emulator UI by clicking o
101101

102102
![View process ID][9]
103103

104-
One you've attached, perform the steps in your application's UI (if needed) to reproduce the scenario.
104+
Once you attach, perform the steps in your application's UI (if needed) to reproduce the scenario.
105105

106106
When you want to stop profiling, choose the **Stop Profiling** link.
107107

108108
![Stop Profiling option][10]
109109

110-
## 3: View performance reports
110+
## View performance reports
111111
The performance report for your application is displayed.
112112

113113
At this point, the profiler stops executing, saves data in a .vsp file, and displays a report
114114
that shows an analysis of this data.
115115

116116
![Profiler report][11]
117117

118-
If you see String.wstrcpy in the Hot Path, click on Just My Code to change the view to show user code only. If you see String.Concat, try pressing the Show All Code button.
118+
If you see String.wstrcpy in the Hot Path, select on Just My Code to change the view to show user code only. If you see String.Concat, try pressing the **Show All Code** button.
119119

120120
You should see the Concatenate method and String.Concat taking up a large portion
121121
of the execution time.
122122

123123
![Analysis of report][12]
124124

125-
If you added the string concatenation code in this article, you should see a warning in the Task List for this. You may also see a warning that there is an excessive amount of garbage collection, which is due to the number of strings that are created and disposed.
125+
If you added the string concatenation code in this article, you should see a warning in the Task List for it. You may also see a warning that there's an excessive amount of garbage collection, which is due to the number of strings created and disposed.
126126

127127
![Performance warnings][14]
128128

129-
## 4: Make changes and compare performance
130-
You can also compare the performance before and after a code change. Stop the running process, and edit the code to replace the string concatenation operation with the use of StringBuilder:
129+
## Make changes and compare performance
130+
You can also compare the performance before and after a code change. To replace the string concatenation operation with the use of StringBuilder, stop the running process and edit the code:
131131

132132
```csharp
133133
public static string Concatenate(int number)
@@ -150,19 +150,19 @@ The reports highlight differences between the two runs.
150150

151151
![Comparison report][16]
152152

153-
Congratulations! You've gotten started with the profiler.
153+
Congratulations! You got started with the profiler.
154154

155155
## Troubleshooting
156-
* Make sure you are profiling a Release build and start without debugging.
157-
* If the Attach/Detach option is not enabled on the Profiler menu, run the Performance Wizard.
156+
* Make sure you profile a Release build and start without debugging.
157+
* If the Attach/Detach option isn't enabled on the Profiler menu, run the Performance Wizard.
158158
* Use the Compute Emulator UI to view the status of your application.
159159
* If you have problems starting applications in the emulator, or attaching the profiler, shut down the compute emulator and restart it. If that doesn't solve the problem, try rebooting. This problem can occur if you use the Compute Emulator to suspend and remove running deployments.
160-
* If you have used any of the profiling commands from the
161-
command line, especially the global settings, make sure that VSPerfClrEnv /globaloff has been called and that VsPerfMon.exe has been shut down.
162-
* If when sampling, you see the message "PRF0025: No data was collected," check that the process you attached to has CPU activity. Applications that are not doing any computational work might not produce any sampling data. It's also possible that the process exited before any sampling was done. Check to see that the Run method for a role that you are profiling does not terminate.
160+
* If you used any of the profiling commands from the
161+
command line, especially the global settings, make sure you call VSPerfClrEnv /globaloff and shut down VsPerfMon.exe.
162+
* When sampling, you see the message "PRF0025: No data was collected," check the CPU activity of the process. Applications that aren't doing any computational work might not produce any sampling data. It's also possible that the process exited before any sampling was done. Check to see that the Run method for a role that you profile doesn't terminate.
163163

164164
## Next Steps
165-
Instrumenting Azure binaries in the emulator is not supported in the Visual Studio profiler, but if you want to test memory allocation, you can choose that option when profiling. You can also choose concurrency profiling, which helps you determine whether threads are wasting time competing for locks, or tier interaction profiling, which helps you track down performance problems when interacting between tiers of an application, most frequently between the data tier and a worker role. You can view the database queries that your app generates and use the profiling data to improve your use of the database. For information about tier interaction profiling, see the blog post [Walkthrough: Using the Tier Interaction Profiler in Visual Studio Team System 2010][3].
165+
Instrumenting Azure binaries in the emulator isn't supported in the Visual Studio profiler, but if you want to test memory allocation, you can choose that option when profiling. You can also choose concurrency profiling, which helps you determine whether threads are wasting time competing for locks, or tier interaction profiling, which helps you track down performance problems when interacting between tiers of an application, most frequently between the data tier and a worker role. You can view the database queries that your app generates and use the profiling data to improve your use of the database. For information about tier interaction profiling, see the blog post [Walkthrough: Using the Tier Interaction Profiler in Visual Studio Team System 2010][3].
166166

167167
[1]: ../azure-monitor/app/profiler.md
168168
[2]: /previous-versions/azure/hh411542(v=azure.100)

0 commit comments

Comments
 (0)