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

Alert Monitor Alert - Move Rest Client to Common #7738

Merged
merged 7 commits into from
Jul 24, 2018

Conversation

vincent1173
Copy link
Contributor

@vincent1173 vincent1173 commented Jul 16, 2018

  • Move Rest Client to Common

  • L0 Tests

  • E2E Tests

@vincent1173 vincent1173 added Area: Release Area: AzureAppService Label to monitor Azure App Service issues labels Jul 16, 2018
@vincent1173 vincent1173 requested review from kmkumaran and asranja July 16, 2018 09:37
"requires": {
"q": "1.4.1",
"typed-rest-client": "0.12.0",
"vsts-task-lib": "2.0.1-preview"
"vsts-task-lib": "2.0.5"
Copy link
Member

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?

Copy link
Contributor Author

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';
Copy link
Member

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);
Copy link
Contributor

Choose a reason for hiding this comment

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

Indentation

@@ -13,7 +13,7 @@
"version": {
"Major": 0,
"Minor": 1,
Copy link
Contributor

Choose a reason for hiding this comment

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

0.2.0

@@ -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"
Copy link
Contributor

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');
Copy link
Contributor

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);
Copy link
Contributor

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

Copy link
Contributor Author

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,
Copy link
Contributor

Choose a reason for hiding this comment

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

rename azureApplicationInsightsAlerts.

Copy link
Contributor Author

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);
Copy link
Contributor

Choose a reason for hiding this comment

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

indentation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

}



Copy link
Contributor

Choose a reason for hiding this comment

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

Too many empty lines.

Copy link
Contributor Author

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);
Copy link
Contributor

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.

Copy link
Contributor Author

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'
Copy link
Contributor

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

Copy link
Contributor Author

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",
Copy link
Contributor

Choose a reason for hiding this comment

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

rename FailedToGetApplicationInsightsResourceAlerts.

Copy link
Contributor Author

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"
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename FailedToUpdateApplicationInsightsResourceAlerts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

@asranja asranja left a 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.

@vincent1173 vincent1173 merged commit 2a6e2da into master Jul 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: AzureAppService Label to monitor Azure App Service issues Area: Release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants