-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Alert Monitor Alert - Move Rest Client to Common #7738
Conversation
"requires": { | ||
"q": "1.4.1", | ||
"typed-rest-client": "0.12.0", | ||
"vsts-task-lib": "2.0.1-preview" | ||
"vsts-task-lib": "2.0.5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any new nested modules coming in part of this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Task brings the same modules with different version, but all the new versions are IP scanned.
@@ -1,13 +1,9 @@ | |||
import * as tl from "vsts-task-lib/task"; | |||
import * as path from "path"; | |||
import { AzureRMEndpoint } from 'azure-arm-rest/azure-arm-endpoint'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@asranja - Can you review this PR.
|
||
tl.debug(`Getting AzureRm resource details - '${resourceName}' in resource group '${resourceGroupName}'`); | ||
|
||
let resources: Resources = new Resources(this._azureEndpoint); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation
Tasks/AzureMonitorAlertsV0/task.json
Outdated
@@ -13,7 +13,7 @@ | |||
"version": { | |||
"Major": 0, | |||
"Minor": 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0.2.0
Tasks/AzureMonitorAlertsV0/task.json
Outdated
@@ -130,6 +130,7 @@ | |||
"UpdatedRule": "Updated rule : '%s'", | |||
"Couldnotfetchaccesstoken": "Could not fetch access token for Azure. Status Code: %s (%s) %s.", | |||
"SPNExpiredCheck": "Check if the SPN is valid and not expired.", | |||
"MSINotSupported": "Managed Service Identity(MSI) authentication is not supported for this task." | |||
"FailedToGetApplicationInsightsResourceAlerts": "Failed to get Application Insights Alert rule: %s. Error: %s", | |||
"FailedToUpdateApplicationInsightsResourceAlerts": "Failed to update Application Insights Alert rule '%s' Resource. Error: %s" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation
let buildUri = tl.getVariable("Build.BuildUri"); | ||
let releaseWebUrl = tl.getVariable("Release.ReleaseWebUrl"); | ||
let collectionUrl = tl.getVariable('System.TeamFoundationCollectionUri'); | ||
let teamProject = tl.getVariable('System.TeamProjectId'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation
|
||
let resourceId: string = `/subscriptions/${this._azureEndpoint.subscriptionID}/resourceGroups/${this._resourceGroupName}/providers/${this._resourceType}/${this._resourceName}`; | ||
|
||
let azureApplicationInsightsAlerts :AzureMonitorAlerts = new AzureMonitorAlerts(this._azureEndpoint, this._resourceGroupName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename azureApplicationInsightsAlerts to azureMetricAlerts or AzureMontiorAlerts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
|
||
private async _getRequestBodyForAddingAlertRule( | ||
azureApplicationInsightsAlerts :AzureMonitorAlerts, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename azureApplicationInsightsAlerts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
console.log(tl.loc("AlertRuleExists", rule.alertName, resourceGroupName)); | ||
} | ||
catch (error) { | ||
console.log(error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
} | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too many empty lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
{ | ||
'{resourceGroupName}': this._resourceGroupName, | ||
'{resourceName}': alertRuleName, | ||
}, null, APIVersions.azure_arm_appinsights_alerts); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename azure_arm_appinsights_alerts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -9,7 +9,8 @@ export const productionSlot: string = "production"; | |||
export const mysqlApiVersion: string = '2017-12-01'; | |||
|
|||
export const APIVersions = { | |||
azure_arm_appinsights: '2015-05-01' | |||
azure_arm_appinsights: '2015-05-01', | |||
azure_arm_appinsights_alerts: '2016-03-01' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename azure_arm_appinsights_alerts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -135,6 +135,8 @@ | |||
"FailedToGetDeploymentLogs": "Failed to get deployment logs. Error: %s", | |||
"ARG_RedirectResponseInvalidStatusCode": "The HTTP response code: '%s' is not a valid redirect status code.", | |||
"ARG_RedirectResponseLocationHeaderIsNull": "Location header is null for HTTP response with status code: %s", | |||
"ASE_SSLIssueRecommendation": "To use a certificate in App Service, the certificate must be signed by a trusted certificate authority. If your web app gives you certificate validation errors, you're probably using a self-signed certificate and to resolve them you need to set a variable named VSTS_ARM_REST_IGNORE_SSL_ERRORS to the value true in the build or release definition" | |||
"ASE_SSLIssueRecommendation": "To use a certificate in App Service, the certificate must be signed by a trusted certificate authority. If your web app gives you certificate validation errors, you're probably using a self-signed certificate and to resolve them you need to set a variable named VSTS_ARM_REST_IGNORE_SSL_ERRORS to the value true in the build or release definition", | |||
"FailedToGetApplicationInsightsResourceAlerts": "Failed to get Application Insights Alert rule: %s. Error: %s", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename FailedToGetApplicationInsightsResourceAlerts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
"ASE_SSLIssueRecommendation": "To use a certificate in App Service, the certificate must be signed by a trusted certificate authority. If your web app gives you certificate validation errors, you're probably using a self-signed certificate and to resolve them you need to set a variable named VSTS_ARM_REST_IGNORE_SSL_ERRORS to the value true in the build or release definition" | ||
"ASE_SSLIssueRecommendation": "To use a certificate in App Service, the certificate must be signed by a trusted certificate authority. If your web app gives you certificate validation errors, you're probably using a self-signed certificate and to resolve them you need to set a variable named VSTS_ARM_REST_IGNORE_SSL_ERRORS to the value true in the build or release definition", | ||
"FailedToGetApplicationInsightsResourceAlerts": "Failed to get Application Insights Alert rule: %s. Error: %s", | ||
"FailedToUpdateApplicationInsightsResourceAlerts": "Failed to update Application Insights Alert rule '%s' Resource. Error: %s" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename FailedToUpdateApplicationInsightsResourceAlerts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take care of the renaming.
Move Rest Client to Common
L0 Tests
E2E Tests