Azure / Azure/azure-cli

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

Open
#13,649 4 comments 0 reactions 1 assignee Claimed by @zhoxing-ms View on GitHub
act-identity-squad ARM Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

## 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](url) 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.