Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Azure Monitor Exporter] Add resource and outputs for ARM template to fix pipeline build #16390

Merged
merged 6 commits into from
Jul 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ import http from "http";
* HTTP SERVER SETUP
**********************************************************************/
/** Starts a HTTP server that receives requests on sample server port. */
let server: http.Server;
function startServer(port: number) {
// Creates a server
const server = http.createServer(handleRequest);
server = http.createServer(handleRequest);
// Starts the server
server.listen(port, () => {
console.log(`Node HTTP listening on ${port}`);
Expand Down Expand Up @@ -74,6 +75,8 @@ function handleRequest(request: any, response: any) {
setTimeout(() => {
span.end();
response.end("Hello World!");
// terminate the process to stop CI pipeline from running forever
server.close();
}, 2000);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ const http = require("http");
* HTTP SERVER SETUP
**********************************************************************/
/** Starts a HTTP server that receives requests on sample server port. */
let server;
function startServer(port) {
// Creates a server
const server = http.createServer(handleRequest);
server = http.createServer(handleRequest);
// Starts the server
server.listen(port, () => {
console.log(`Node HTTP listening on ${port}`);
Expand Down Expand Up @@ -74,6 +75,8 @@ function handleRequest(request, response) {
setTimeout(() => {
span.end();
response.end("Hello World!");
// terminate the process to stop CI pipeline from running forever
server.close();
}, 2000);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ import http from "http";
* HTTP SERVER SETUP
**********************************************************************/
/** Starts a HTTP server that receives requests on sample server port. */
let server: http.Server;
function startServer(port: number) {
// Creates a server
const server = http.createServer(handleRequest);
server = http.createServer(handleRequest);
// Starts the server
server.listen(port, () => {
console.log(`Node HTTP listening on ${port}`);
Expand Down Expand Up @@ -74,6 +75,8 @@ function handleRequest(request: any, response: any) {
setTimeout(() => {
span.end();
response.end("Hello World!");
// terminate the process to stop CI pipeline from running forever
server.close();
}, 2000);
});
}
Expand Down
17 changes: 16 additions & 1 deletion sdk/monitor/test-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"logReaderRoleId": "73c42c96-874c-492b-b04d-ab87d138a893",
"metricPublisherRoleId": "3913510d-42f4-4e42-8a64-420c390055eb",
"workspaceName": "[concat(parameters('baseName'), '-logs')]",
"secondaryWorkspaceName": "[concat(parameters('baseName'), '-logs2')]"
"secondaryWorkspaceName": "[concat(parameters('baseName'), '-logs2')]",
"appInsightsName": "[concat(parameters('baseName'), '-ai')]"
},
"resources": [
{
Expand Down Expand Up @@ -92,6 +93,16 @@
"principalId": "[parameters('testApplicationOid')]",
"scope": "[resourceGroup().id]"
}
},
{
"type": "Microsoft.Insights/components",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this going to create an Application Insights resource when you execute the tests?

"apiVersion": "2015-05-01",
"location": "[parameters('location')]",
"name": "[variables('appInsightsName')]",
"properties": {
"Application_Type": "web",
"applicationId": "[variables('appInsightsName')]"
}
}
],
"outputs": {
Expand All @@ -114,6 +125,10 @@
"METRICS_RESOURCE_NAMESPACE": {
"value": "Microsoft.OperationalInsights/workspaces",
"type": "string"
},
"APPLICATIONINSIGHTS_CONNECTION_STRING": {
"value": "[reference(resourceId('Microsoft.Insights/components', variables('appInsightsName')), '2015-05-01').ConnectionString]",
"type": "string"
}
}
}