Azure / azure-cli

Azure Command-Line Interface
MIT License
3.99k stars 2.98k forks source link

az group deployment create : deployment failed ( deployment actually succedes afaik) #13649

Open vllama opened 4 years ago

vllama commented 4 years ago

Deployment failed message, even though all the resources in the template have been deployed.

Command Name az group deployment create

Errors:

Deployment failed. Correlation ID: e9065e2b-d965-4051-857b-ceead466fd4e. {
  "status": "Failed",
  "error": {
    "code": "ResourceDeploymentFailure",
    "message": "The resource operation completed with terminal provisioning state 'Failed'."
  }
}

To Reproduce:

Deploying a WebApp which has a sourcecontrols resource as defined in https://docs.microsoft.com/en-us/azure/templates/microsoft.web/2018-11-01/sites/sourcecontrols#SiteSourceControlProperties causes the deployment to fail. I believe the reason is that it can't actually connect to the repository url, because the kudu ssh key does not exist yet, and it is not imported in git ( gitLab in our case) as can bee seen in the resource explorer sourceControls Node under the webapp:

{
  "id": "/subscriptions/123/resourceGroups/XXTest/providers/Microsoft.Web/sites/xx-test2/sourcecontrols/web",
  "name": "xx-test2",
  "type": "Microsoft.Web/sites/sourcecontrols",
  "location": "Canada Central",
  "tags": {
    "applicationType": "webapp",
    "environment": "test"
  },
  "properties": {
    "repoUrl": "dummy",
    "branch": "dummy",
    "isManualIntegration": true,
    "isGitHubAction": false,
    "deploymentRollbackEnabled": false,
    "isMercurial": false,
    "provisioningState": "Failed",
    "provisioningDetails": "System.Net.WebException: The remote server returned an error: (500) Internal Server Error.\r\n   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)\r\n   at Microsoft.Web.Hosting.Administration.SiteRepositoryProvider.AsyncOperation`1.OnEndMethod(IAsyncResult result)"
  }
}

Expected Behavior

Deployment should not fail. At most it should warn that it was unable to connect to source control to pull the source. Also, "isManualIntegration" is set to true, so it should not try to run the deployment until we kick it off manually. OR an enabled/disabled flag property might make sense.

Environment Summary

Windows-10-10.0.18362-SP0
Python 3.6.6
Shell: powershell.exe

azure-cli 2.0.81 *

Extensions:
application-insights 0.1.3

Additional Context

yonzhan commented 4 years ago

add to S171

vllama commented 4 years ago

Additional Detail:

Even this sample deployment script @davidebbo provided fails if the git repository specified is not public https://github.com/Azure/azure-functions-host/issues/416

The error from the resource group deployments log: tracking id : 83e6fcef-09ed-455e-a9bc-6b906692a6c7. In the portal the status says "Conflict" but the json says "status": "Failed" as below.


{
    "status": "Failed",
    "error": {
        "code": "ResourceDeploymentFailure",
        "message": "The resource operation completed with terminal provisioning state 'Failed'."
    }
}
``
ghost commented 4 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @armleads-azure.

yonzhan commented 4 years ago

add to backlog