OfficeDev / microsoft-teams-apps-greatideas

An “innovation challenge” system that lets employees submit and share ideas and insights, with voting and contests. An app using which employees can submit an innovative idea in a selected category to be visible to all colleagues and leadership, ideas can be voted upon and a leader board of best idea contributors can be shared. This app can also be a route to file patent ideas by anyone in an organization.
MIT License
84 stars 35 forks source link

Source Control Deployment Failure #50

Open sofbkeller opened 2 years ago

sofbkeller commented 2 years ago

During the one click deployment of the template the process hangs and fails with a conflict on the deployment of the /web Microsoft.Web/sites/sourcecontrols segment.

Generic error is produced:

{
  "code": "DeploymentFailed",
  "message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.",
  "details": [
    {
      "code": "Conflict",
      "message": "{\r\n  \"status\": \"Failed\",\r\n  \"error\": {\r\n    \"code\": \"ResourceDeploymentFailure\",\r\n    \"message\": \"The resource operation completed with terminal provisioning state 'Failed'.\"\r\n  }\r\n}"
    }
  ]
}

If the template is redeployed to the same RG the process completes and shows as fully provisioned but doesn't seem to work correctly. A 503 error is generated alerting issues communicating with the webserver.

In the deployment history an intermediary action is created "Failure Anomalies". Inside of it is the following:

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "resources": [
        {
            "type": "microsoft.alertsmanagement/smartdetectoralertrules",
            "apiVersion": "2021-04-01",
            "name": "Failure Anomalies - greatideasapp",
            "location": "global",
            "properties": {
                "description": "Failure Anomalies notifies you of an unusual rise in the rate of failed HTTP requests or dependency calls.",
                "state": "Enabled",
                "severity": "Sev3",
                "frequency": "PT1M",
                "detector": {
                    "id": "FailureAnomaliesDetector",
                    "parameters": null
                },
                "scope": [
                    "/subscriptions/xxxx/resourceGroups/rg-sofgreatideasapp-cacentral-dev/providers/microsoft.insights/components/greatideasapp"
                ],
                "actionGroups": {
                    "customEmailSubject": null,
                    "customWebhookPayload": null,
                    "groupIds": [
                        "/subscriptions/xxxx/resourceGroups/rg-wvd-dev-westus2/providers/microsoft.insights/actionGroups/Application Insights Smart Detection"
                    ]
                },
                "throttling": null
            }
        }
    ]
}
petemessina commented 1 year ago

Hi @sofbkeller, on the app configuration for the app service change the node version to ~16 and give that a try.

sofbkeller commented 1 year ago

@petemessina where do I set that when deploying with the "Deploy to Azure" button? Do I need to let the deployment fail then change the node version. In this case I expect you are referring to NodeJS?

Thanks for your guidance.

petemessina commented 1 year ago

Set the node version on the App Service configuration for the application that was created as apart of the deployment. Yes let the deployment finish. Make the change and then redeploy the application in the deployment manager.