Forum Discussion
Problem with custom domain of my azure app service
I have an app service with default domain "mywebservice.azurewebsites.net". It works very well. I can visit mywebservice.azurewebsites.net and run all the functions without any issue.
I created a custom domain "mywebservice.mycompany.com" for the same app service successfully from Azure Portal. I can also visit mywebservice.mycompany.com and run most of the functions. However, several functions which requires file upload from local computer to azure server always failed.
I enabled the App Service Logs, below are the messages I got when trying to run functions which requires file upload from custom domain: mywebservice.mycompany.com.
I did some research but was not able to find a solution. Any helps are appreciated. Thanks.
------------------------------------------------------------------------------------------------
2023-09-12T12:57:07 Welcome, you are now connected to log-streaming service. The default timeout is 2 hours. Change the timeout with the App Setting SCM_LOGSTREAM_TIMEOUT (in seconds).
2023-09-12T12:58:07 No new trace in the past 1 min(s).
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>IIS Detailed Error - 401.0 - Unauthorized</title><style type="text/css"><!--body{margin:0;font-size:.7em;font-family:Verdana,Arial,Helvetica,sans-serif;}code{margin:0;color:#006600;font-size:1.1em;font-weight:bold;}.config_source code{font-size:.8em;color:#000000;}pre{margin:0;font-size:1.4em;word-wrap:break-word;}ul,ol{margin:10px 0 10px 5px;}ul.first,ol.first{margin-top:5px;}fieldset{padding:0 15px 10px 15px;word-break:break-all;}.summary-container fieldset{padding-bottom:5px;margin-top:4px;}legend.no-expand-all{padding:2px 15px 4px 10px;margin:0 0 0 -12px;}legend{color:#333333;;margin:4px 0 8px -12px;_margin-top:0px;font-weight:bold;font-size:1em;}a:link,a:visited{color:#007EFF;font-weight:bold;}a:hover{text-decoration:none;}h1{font-size:2.4em;margin:0;color:#FFF;}h2{font-size:1.7em;margin:0;color:#CC0000;}h3{font-size:1.4em;margin:10px 0 0 0;color:#CC0000;}h4{font-size:1.2em;margin:10px 0 5px 0;}#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS",Verdana,sans-serif;color:#FFF;background-color:#5C87B2;}#content{margin:0 0 0 2%;position:relative;}.summary-container,.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}.content-container p{margin:0 0 10px 0;}#details-left{width:35%;float:left;margin-right:2%;}#details-right{width:63%;float:left;overflow:hidden;}#server_version{width:96%;_height:1px;min-height:1px;margin:0 0 5px 0;padding:11px 2% 8px 2%;color:#FFFFFF;background-color:#5A7FA5;border-bottom:1px solid #C1CFDD;border-top:1px solid #4A6C8E;font-weight:normal;font-size:1em;color:#FFF;text-align:right;}#server_version p{margin:5px 0;}table{margin:4px 0 4px 0;width:100%;border:none;}td,th{vertical-align:top;padding:3px 0;text-align:left;font-weight:normal;border:none;}th{width:30%;text-align:right;padding-right:2%;font-weight:bold;}thead th{background-color:#ebebeb;width:25%;}#details-right th{width:20%;}table tr.alt td,table tr.alt th{}.highlight-code{color:#CC0000;font-weight:bold;font-style:italic;}.clear{clear:both;}.preferred{padding:0 5px 2px 5px;font-weight:normal;background:#006633;color:#FFF;font-size:.8em;}--></style>
</head><body><div id="content"><div class="content-container"><h3>HTTP Error 401.0 - Unauthorized</h3><h4>You do not have permission to view this directory or page.</h4></div><div class="content-container"><fieldset><h4>Most likely causes:</h4><ul> <li>The authenticated user does not have access to a resource needed to process the request.</li> </ul></fieldset></div><div class="content-container"><fieldset><h4>Things you can try:</h4><ul> <li>Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click <a href="http://go.microsoft.com/fwlink/?LinkID=66439">here</a>. </li> </ul></fieldset></div>
<div class="content-container"><fieldset><h4>Detailed Error Information:</h4><div id="details-left"><table border="0" cellpadding="0" cellspacing="0"><tr class="alt"><th>Module</th><td> ManagedPipelineHandler</td></tr><tr><th>Notification</th><td> ExecuteRequestHandler</td></tr><tr class="alt"><th>Handler</th><td> System.Web.Mvc.MvcHandler</td></tr><tr><th>Error Code</th><td> 0x00000000</td></tr>
</table></div><div id="details-right"><table border="0" cellpadding="0" cellspacing="0"><tr class="alt"><th>Requested URL</th><td> https://mywebservice:80/File/SaveScheduleFile</td></tr><tr><th>Physical Path</th><td> C:\home\site\wwwroot\File\SaveScheduleFile</td></tr><tr class="alt"><th>Logon Method</th><td> Anonymous</td></tr><tr><th>Logon User</th><td> Anonymous</td></tr>
</table><div class="clear"></div></div></fieldset></div>
<div class="content-container"><fieldset><h4>More Information:</h4>This is the generic Access Denied error returned by IIS. Typically, there is a substatus code associated with this error that describes why the server denied the request. Check the IIS Log file to determine whether a substatus code is associated with this failure.<p><a href="http://go.microsoft.com/fwlink/?LinkID=62293&IIS70Error=401,0,0x00000000,14393">View more information »</a></p><p>Microsoft Knowledge Base Articles:</p>
</fieldset></div></div></body></html><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>IIS Detailed Error - 401.0 - Unauthorized</title><style type="text/css"><!--body{margin:0;font-size:.7em;font-family:Verdana,Arial,Helvetica,sans-serif;}code{margin:0;color:#006600;font-size:1.1em;font-weight:bold;}.config_source code{font-size:.8em;color:#000000;}pre{margin:0;font-size:1.4em;word-wrap:break-word;}ul,ol{margin:10px 0 10px 5px;}ul.first,ol.first{margin-top:5px;}fieldset{padding:0 15px 10px 15px;word-break:break-all;}.summary-container fieldset{padding-bottom:5px;margin-top:4px;}legend.no-expand-all{padding:2px 15px 4px 10px;margin:0 0 0 -12px;}legend{color:#333333;;margin:4px 0 8px -12px;_margin-top:0px;font-weight:bold;font-size:1em;}a:link,a:visited{color:#007EFF;font-weight:bold;}a:hover{text-decoration:none;}h1{font-size:2.4em;margin:0;color:#FFF;}h2{font-size:1.7em;margin:0;color:#CC0000;}h3{font-size:1.4em;margin:10px 0 0 0;color:#CC0000;}h4{font-size:1.2em;margin:10px 0 5px 0;}#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS",Verdana,sans-serif;color:#FFF;background-color:#5C87B2;}#content{margin:0 0 0 2%;position:relative;}.summary-container,.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}.content-container p{margin:0 0 10px 0;}#details-left{width:35%;float:left;margin-right:2%;}#details-right{width:63%;float:left;overflow:hidden;}#server_version{width:96%;_height:1px;min-height:1px;margin:0 0 5px 0;padding:11px 2% 8px 2%;color:#FFFFFF;background-color:#5A7FA5;border-bottom:1px solid #C1CFDD;border-top:1px solid #4A6C8E;font-weight:normal;font-size:1em;color:#FFF;text-align:right;}#server_version p{margin:5px 0;}table{margin:4px 0 4px 0;width:100%;border:none;}td,th{vertical-align:top;padding:3px 0;text-align:left;font-weight:normal;border:none;}th{width:30%;text-align:right;padding-right:2%;font-weight:bold;}thead th{background-color:#ebebeb;width:25%;}#details-right th{width:20%;}table tr.alt td,table tr.alt th{}.highlight-code{color:#CC0000;font-weight:bold;font-style:italic;}.clear{clear:both;}.preferred{padding:0 5px 2px 5px;font-weight:normal;background:#006633;color:#FFF;font-size:.8em;}--></style>
</head><body><div id="content"><div class="content-container"><h3>HTTP Error 401.0 - Unauthorized</h3><h4>You do not have permission to view this directory or page.</h4></div><div class="content-container"><fieldset><h4>Most likely causes:</h4><ul> <li>The authenticated user does not have access to a resource needed to process the request.</li> </ul></fieldset></div><div class="content-container"><fieldset><h4>Things you can try:</h4><ul> <li>Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click <a href="http://go.microsoft.com/fwlink/?LinkID=66439">here</a>. </li> </ul></fieldset></div>
<div class="content-container"><fieldset><h4>Detailed Error Information:</h4><div id="details-left"><table border="0" cellpadding="0" cellspacing="0"><tr class="alt"><th>Module</th><td> ManagedPipelineHandler</td></tr><tr><th>Notification</th><td> ExecuteRequestHandler</td></tr><tr class="alt"><th>Handler</th><td> System.Web.Mvc.MvcHandler</td></tr><tr><th>Error Code</th><td> 0x00000000</td></tr>
</table></div><div id="details-right"><table border="0" cellpadding="0" cellspacing="0"><tr class="alt"><th>Requested URL</th><td> https://mywebservice:80/File/SaveScheduleFile</td></tr><tr><th>Physical Path</th><td> C:\home\site\wwwroot\File\SaveScheduleFile</td></tr><tr class="alt"><th>Logon Method</th><td> Anonymous</td></tr><tr><th>Logon User</th><td> Anonymous</td></tr>
</table><div class="clear"></div></div></fieldset></div>
<div class="content-container"><fieldset><h4>More Information:</h4>This is the generic Access Denied error returned by IIS. Typically, there is a substatus code associated with this error that describes why the server denied the request. Check the IIS Log file to determine whether a substatus code is associated with this failure.<p><a href="http://go.microsoft.com/fwlink/?LinkID=62293&IIS70Error=401,0,0x00000000,14393">View more information »</a></p><p>Microsoft Knowledge Base Articles:</p>
</fieldset></div></div></body></html>
2023-09-12 12:56:05 ~1mywebservice GET /api/logstream/http X-ARR-LOG-ID=c48ba346-c410-41fa-b492-f2d8b4d0ebc9 443 - 99.231.209.214 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/109.0.0.0+Safari/537.36 - - mywebservice.scm.azurewebsites.net 200 0 64 671 1478 60012
2023-09-12 12:56:07 ~1mywebservice GET /api/logstream/ X-ARR-LOG-ID=89483af7-16d4-4fdb-92e8-adbb2a78bedc 443 - 99.231.209.214 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/109.0.0.0+Safari/537.36 - - mywebservice.scm.azurewebsites.net 200 0 64 671 1466 60020
2023-09-12 12:56:25 ~1mywebservice GET /api/logstream/http X-ARR-LOG-ID=62d3cfd5-021a-4524-9d87-685b9a55809e 443 - 99.231.209.214 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/109.0.0.0+Safari/537.36 - - mywebservice.scm.azurewebsites.net 200 0 64 671 1478 60002
2023-09-12 12:56:25 ~1mywebservice GET /api/logstream/ X-ARR-LOG-ID=936bd37c-6e24-4ed8-8e14-124ceda77164 443 - 99.231.209.214 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/109.0.0.0+Safari/537.36 - - mywebservice.scm.azurewebsites.net 200 0 64 671 1466 60034
2023-09-12 12:56:52 mywebservice OPTIONS /File/SaveScheduleFile X-ARR-LOG-ID=a8d838a7-5609-4fcb-b7cf-d9c74d03139f 443 - 99.231.209.214 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/109.0.0.0+Safari/537.36 - https://mywebservice.mycompany.com/ mywebservice.azurewebsites.net 200 0 0 411 1292 15
2023-09-12 12:56:52 mywebservice POST /File/SaveScheduleFile X-ARR-LOG-ID=ae1e5bcf-3fec-4f0a-b39a-cfc4cefa8ed6 443 - 99.231.209.214 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/109.0.0.0+Safari/537.36 - https://mywebservice.mycompany.com/ mywebservice.azurewebsites.net 401 0 0 692 1993 31
2023-09-12 12:56:57 mywebservice POST /File/SaveScheduleFile X-ARR-LOG-ID=a75e35b2-14da-454d-b216-eb0052372440 443 - 99.231.209.214 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/109.0.0.0+Safari/537.36 - https://mywebservice.mycompany.com/ mywebservice.azurewebsites.net 401 0 0 692 1996 15
2023-09-12 12:57:05 ~1mywebservice GET /api/logstream/http X-ARR-LOG-ID=442ec093-9874-4542-a44a-01fe87179106 443 - 99.231.209.214 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/109.0.0.0+Safari/537.36 - - mywebservice.scm.azurewebsites.net 200 0 64 671 1478 60004
2023-09-12 12:57:29 ~1mywebservice GET /api/logstream/ X-ARR-LOG-ID=b76d7b33-0e3d-4532-ba11-d0942542d312 443 - 99.231.209.214 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/109.0.0.0+Safari/537.36 - - mywebservice.scm.azurewebsites.net 200 0 64 12536 1466 81152
2023-09-12 12:57:39 ~1mywebservice GET /api/logstream/http X-ARR-LOG-ID=e03d4a5d-8624-4abb-b8e9-3a2796e626c5 443 - 99.231.209.214 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/109.0.0.0+Safari/537.36 - - mywebservice.scm.azurewebsites.net 200 0 64 671 1478 60028
2023-09-12 12:57:40 ~1mywebservice GET /api/logstream/ X-ARR-LOG-ID=25d8e568-baac-403a-97ac-5e0ecce1a8af 443 - 99.231.209.214 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/109.0.0.0+Safari/537.36 - - mywebservice.scm.azurewebsites.net 200 0 64 671 1466 60041
2023-09-12 12:57:42 ~1mywebservice GET /api/logstream/http X-ARR-LOG-ID=dce113b6-ca0a-433f-a42e-5ab15127d442 443 - 99.231.209.214 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/109.0.0.0+Safari/537.36 - - mywebservice.scm.azurewebsites.net 200 0 64 671 1478 60015
2023-09-12 12:57:42 ~1mywebservice GET /api/logstream/ X-ARR-LOG-ID=f05bbcef-1644-4ed7-b2b0-0bfd4882140d 443 - 99.231.209.214 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/109.0.0.0+Safari/537.36 - - mywebservice.scm.azurewebsites.net 200 0 64 671 1466 60036
2023-09-12 12:57:47 ~1mywebservice GET /api/logstream/http X-ARR-LOG-ID=18e9d7fa-8dd8-4cce-9d68-81e22b63fbd7 443 - 99.231.209.214 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/109.0.0.0+Safari/537.36 - - mywebservice.scm.azurewebsites.net 200 0 64 671 1478 60013
2023-09-12 12:57:48 ~1mywebservice GET /api/logstream/ X-ARR-LOG-ID=744d7406-7dcd-4003-8b74-3cf66b1bd6bd 443 - 99.231.209.214 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/109.0.0.0+Safari/537.36 - - mywebservice.scm.azurewebsites.net 200 0 64 671 1466 60042
2023-09-12 12:58:05 ~1mywebservice GET /api/logstream/http X-ARR-LOG-ID=8f088e01-a047-4b79-b93c-ad0516bfbd98 443 - 99.231.209.214 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/109.0.0.0+Safari/537.36 - - mywebservice.scm.azurewebsites.net 200 0 64 671 1478 60005
2 Replies
- KonstantinosPassadisLearn Expert
Hello @Rice Rao !
In case you want to upload files directly ( outside the Application)
The Azure Web App Service has a specific FTP Configuration :
https://learn.microsoft.com/en-us/azure/app-service/deploy-ftp?tabs=portal
If you want to upload within your APP be aware :
Azure Web Apps are more suitable for quick running APIs / responses. When trying to do file transfers that run more than ~30 seconds, the risk of failure is significantly high.
In order to minimize risk of disconnect errors, a better way to upload large files would be using a SAS Key. An Azure Web App generates a storage blob's SAS Key with write access. This SAS Key can then be sent by the Web App to a browser and the browser will be used to upload the file directly into Azure Storage without involving the Web App in the upload path.
There was a sample blog post for this published on Microsoft's techcommunity site, which I am linking here for reference: https://techcommunity.microsoft.com/t5/apps-on-azure/azure-storage-blob-upload-from-browser/ba-p/392687
Reference : https://learn.microsoft.com/en-us/answers/questions/204060/how-to-upload-large-files-to-azure-web-apps-withou
I hope this helps !
Kindly mark the Answer as Accepted and Upvote , or post your feedback to provide additional help !
Regards!