Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Devops release pipeline Failed to deploy web package to App Service. Ip Forbidden 403

My release pipeline has started to fail today after working fine for months.. I'm unable to find any information regarding this error. Here is the relevant log after setting System.Debug=true.

2019-06-03T09:12:56.1141807Z Package deployment using ZIP Deploy initiated.
2019-06-03T09:12:56.1227504Z ##[debug][POST]https://$DuoCore__staging:***@xxx-staging.scm.azurewebsites.net/api/zipdeploy?deployer=VSTS&message=%7B%22type%22%3A%22deployment%22%2C%22commitId%22%3A%2241ea351fc04ac594f9a979d19117e494e03c30aa%22%2C%22buildId%22%3A%223477%22%2C%22releaseId%22%3A%221780%22%2C%22buildNumber%22%3A%2220190602.1%22%2C%22releaseName%22%3A%22Release-37%22%2C%22repoProvider%22%3A%22TfsGit%22%2C%22repoName%22%3A%22xxxFront%22%2C%22collectionUrl%22%3A%22https%3A%2F%2Fvectorcuatrogroup.visualstudio.com%2F%22%2C%22teamProject%22%3A%223a39c617-c412-480d-aa54-be5cca265a43%22%2C%22slotName%22%3A%22Staging%22%7D
2019-06-03T09:12:56.2135188Z ##[debug]Could not parse response: {}
2019-06-03T09:12:56.2135454Z ##[debug]Response: undefined
2019-06-03T09:12:56.2137686Z ##[debug]ZIP Deploy response: {"statusCode":403,"statusMessage":"Ip Forbidden","headers":{"content-type":"text/html","server":"Microsoft-IIS/10.0","date":"Mon, 03 Jun 2019 09:12:55 GMT","connection":"close","content-length":"2399"},"body":"<!DOCTYPE html>\r\n<html>\r\n<head>\r\n    <title>Web App - Unavailable</title>\r\n    <style type=\"text/css\">\r\n        html {\r\n            height: 100%;\r\n            width: 100%;\r\n        }\r\n\r\n        #feature {\r\n            width: 960px;\r\n            margin: 95px auto 0 auto;\r\n            overflow: auto;\r\n        }\r\n\r\n        #content {\r\n            font-family: \"Segoe UI\";\r\n            font-weight: normal;\r\n            font-size: 22px;\r\n            color: #ffffff;\r\n            float: left;\r\n            width: 460px;\r\n            margin-top: 68px;\r\n            margin-left: 0px;\r\n            vertical-align: middle;\r\n        }\r\n\r\n            #content h1 {\r\n                font-family: \"Segoe UI Light\";\r\n                color: #ffffff;\r\n                font-weight: normal;\r\n                font-size: 60px;\r\n                line-height: 48pt;\r\n                width: 800px;\r\n            }\r\n\r\n        p a, p a:visited, p a:active, p a:hover {\r\n            color: #ffffff;\r\n        }\r\n\r\n        #content a.button {\r\n            background: #0DBCF2;\r\n            border: 1px solid #FFFFFF;\r\n            color: #FFFFFF;\r\n            display: inline-block;\r\n            font-family: Segoe UI;\r\n            font-size: 24px;\r\n            line-height: 46px;\r\n            margin-top: 10px;\r\n            padding: 0 15px 3px;\r\n            text-decoration: none;\r\n        }\r\n\r\n            #content a.button img {\r\n                float: right;\r\n                padding: 10px 0 0 15px;\r\n            }\r\n\r\n            #content a.button:hover {\r\n                background: #1C75BC;\r\n            }\r\n    </style>\r\n</head>\r\n<body bgcolor=\"#00abec\">\r\n    <div id=\"feature\">\r\n            <div id=\"content\">\r\n                <h1 id=\"unavailable\">Error 403 - This web app is stopped.</h1>\r\n                <p id=\"tryAgain\">The web app you have attempted to reach is currently stopped and does not accept any requests. Please try to reload the page or visit it again soon.</p>\r\n                <p id=\"toAdmin\">If you are the web app administrator, please find the common 403 error scenarios and resolution <a href=\"http://blogs.msdn.com/b/waws/archive/2016/01/05/azure-web-apps-error-403-this-web-app-is-stopped.aspx\" target=\"_blank\">here</a>. For further troubleshooting tools and recommendations, please visit <a href=\"https://portal.azure.com/\">Azure Portal</a>.</p>\r\n        </div>\r\n    </div>\r\n</body>\r\n</html>\r\n"}
2019-06-03T09:12:56.2199524Z ##[error]Failed to deploy web package to App Service.
2019-06-03T09:12:56.2208644Z ##[debug]Processed: ##vso[task.issue type=error;]Failed to deploy web package to App Service.
2019-06-03T09:12:56.2208989Z ##[debug]Deployment Failed with Error: Error: Error: Failed to deploy web package to App Service. Ip Forbidden (CODE: 403)
2019-06-03T09:12:56.2209141Z ##[debug]task result: Failed
2019-06-03T09:12:56.2209425Z ##[error]Error: Error: Failed to deploy web package to App Service. Ip Forbidden (CODE: 403)
2019-06-03T09:12:56.2209663Z ##[debug]Processed: ##vso[task.issue type=error;]Error: Error: Failed to deploy web package to App Service. Ip Forbidden (CODE: 403)
2019-06-03T09:12:56.2210196Z ##[debug]Processed: ##vso[task.complete result=Failed;]Error: Error: Failed to deploy web package to App Service. Ip Forbidden (CODE: 403)
2019-06-03T09:12:56.2210358Z ##[debug]Application Insights is not configured for the App Service. Skipping adding release annotation.
2019-06-03T09:12:56.2210529Z ##[debug][POST]https://management.azure.com/subscriptions/7b86f649-7ce5-4da3-ac60-3ad477c0dd15/resourceGroups/RG_DUO_WEBAPP_PRE/providers/Microsoft.Web/sites/DuoCore/slots/Staging/publishxml?api-version=2016-08-01
2019-06-03T09:12:56.7236671Z ##[debug]Could not parse response: {}
2019-06-03T09:12:56.7237203Z ##[debug]Response: undefined
2019-06-03T09:12:56.7380358Z App Service Application URL: http://duocore-staging.azurewebsites.net
2019-06-03T09:12:56.7381542Z ##[debug]set AppServiceApplicationUrl=http://duocore-staging.azurewebsites.net
2019-06-03T09:12:56.7382651Z ##[debug]Processed: ##vso[task.setvariable variable=AppServiceApplicationUrl;issecret=false;]http://duocore-staging.azurewebsites.net
2019-06-03T09:12:56.7383220Z ##[debug]Deployment failed
2019-06-03T09:12:56.7608716Z ##[section]Finishing: Deploy Azure App Service to Slot

I had verified my connection from Devops, it's ok.

enter image description here

like image 825
Oscar Avatar asked Oct 27 '25 00:10

Oscar


1 Answers

Solution: make sure there's no IP restriction on .scm.azurewebsites.net

Had the same error, finally figured out why. I had configured the firewall on the function app to only allow a few IPs through, and mistakenly ticked the box to use the same settings for .SCM.azurewebsite.net too.

Azure function app access restrictions

like image 117
andyhammar Avatar answered Oct 29 '25 17:10

andyhammar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!