The Publish URL https://waws-prod-am2-xxx.publish.azurewebsites.windows.net/ is unreachable - azure

I created a function app on Azure Portal with below configuration.
And I created a simple HTTP trigger Function App on VS 2019 version of 16.7.6. The function is working successfuly on local machine. When I want to publish it to Azure, it returns below error;
Publish has encountered an error. The Publish URL
https://waws-prod-am2-xxx.publish.azurewebsites.windows.net/ is
unreachable. The application may be stopped, restarting or
unavailable. Try again once the publish target is available.
The publishing summary is;
When I check the publish profile on VS (.pubxml file), I see the line
<PublishUrl>https://waws-prod-am2-311.publish.azurewebsites.windows.net/</PublishUrl>
But it should be
<PublishUrl>http://myfuncappdss.scm.azurewebsites.net</PublishUrl>
I change it manually and there is any other error that is not detected
Publish has encountered an error. Publish has encountered an error. We
were unable to determine the cause of the error.
It hasn't published for 2 days. Before, I published successfully. I search it on google but I couldn't find any clue.
Btw, I can reach the FTP file of the function successfully. And the function running successfully on https://myfuncappdss.azurewebsites.net/ site.
I tried it with az command also but it wasn't work, too. All my teammates can't publish also. So, the problem is not just about my computer.
Why is the PublishUrl set with wrong URL?

When I check the publish profile in Visual Studio (.pubxml file), I see the line:
<PublishUrl>https://waws-prod-am2-311.publish.azurewebsites.windows.net/</PublishUrl>
But it should be
<PublishUrl>https://myfuncappdss.scm.azurewebsites.net</PublishUrl>
I changed it manually and then it started working fine.
Step 1: Do the above URL changes and save the .pubxml file
Step 2: Close Visual Studio.
Step 3: Open your project in Visual Studio.
Step 4: Now publish, it should work as expected…
Here we have successfully deployed the Function App.

Update:
Thanks for Aybuke's aharing, this is the reason of the problem:
The problem base is about function publish profile. When I follow the steps, (Go to Azure Portal-->Go to function app-->Overview menu-->Get Publish Profile) I can download the publish profile of function. So, I can see the publish settings of function. "publishUrl="https://waws-prod-am2-xxx.publish.azurewebsites.windows.net:443"" This line is in the publish profile file that I downloaded. But it should be "publishUrl="https://myfuncappdss.scm.azurewebsites.net"". That is why the published zip file is sent to wrong url. So, there are some problems while creating function on Azure Portal.
Original Answer:
Did you encounter this error?
I notice you change publish url to http://myfuncappdss.scm.azurewebsites.net, please change it to https://myfuncappdss.scm.azurewebsites.net and try again.
If I use http, I also can not publish my function app. I don't know why the publish url is not what you want, but the az command should work. Any details when you use az command?
Change http to https, it should work.

I had this issue and the problem was on the App Function Settings.
In Networking, Inbound Traffic had Access Restrictions ON.
I had to add my public IP Address and then I was able to publish.

Related

Web deployment task failed (Could not complete the request to remote agent URL https://xx.publish.azurewebsites.windows.net/msdeploy.axd?site=XXXXXXX)

I am trying to publish blazor server web application to azure linux app service via visual studio community version 16.9.5
But it is failing with error information below:
Severity Code Description Project File Line Suppression State
Error Web deployment task failed. (Could not complete the request to
remote agent URL
'https://XXXXXXX.publish.azurewebsites.windows.net/msdeploy.axd?site=XXXXXXX-dev__staging'.)
Could not complete the request to remote agent URL
'https://XXXXXX.publish.azurewebsites.windows.net/msdeploy.axd?site=XXXXXX-dev__staging'.
The operation has timed out xxxxxx.web 0
I faced this issue earlier also but after one or two retry it was getting solved automatically. but this time I am unable to publish it after more than 20 tries. there is no exact information on exact problem anywhere.
Please suggest me if any exact cause of the error or solution.
Thanks,
Ashish
Troubleshooting:
Maybe you can try to set WEBSITE_WEBDEPLOY_USE_SCM=false on portal.
For more details, you can refer this post.
Why is application deployment failing on waws-prod-blu-167.publish.azurewebsites.windows.net?
In contrast, when using vs2019 was previously released, whether Service Dependencies were added.
Check whether the configuration of Service Dependencies is correct.
If all the above methods fail, please download publish profile and import to vs2019, then retry to publish your app.

Azure App Service not reflecting file changes from ftp

I am new to Azure and I have created a very simple App Service in Azure with everything default. Changed the App Service Plan to B1. I can browse the app service home page and see the default page. I then connect using FTP and try to change the default page, but it did not reflect changes.
I even downloaded publish profile and published a .net core 3.1 web api with defaults, I can see the files are deployed using FTP but the api is not present. I even deleted the default page but the home page still appears. It seems the ftp is not pointing to default location where files are being picked up by asp.net core.
You can refer my answer in this post. Then use kudu to check whether the time of the last update file via FTP is consistent with the release time. If the file is not updated, of course this update has no effect. Then we can check the FTP connection str.
But first, I suggest you to modify index.html or default interface function and update by kudu. Then check if the update file is effective. If success, I can sure you code is ok.
Second, check your FTP Connection str.
Step 1. Find Deployment Center->FTP, click FTP then you can see Dashboard, into Dashboard find FTPS Endpoint,Username and Password.
Step 2. Use FileZilla, connect it. You can see files in it.
Then you can try again. Under normal circumstances, there is no problem to update via FTP.If the problem is still not resolved, I suggest that you can deploy to local IIS for debugging.
I was facing same problem like, publish contain not displaying when visit website. then i change following settings and it worked.
I had the same issue updating files in FTP and the dlls weren't being updated as they were being used by the site. I had to stop the App Service first and then update the files. The changes then reflected when restarting it.

What is the best way to move an online Azure Function to a local git repository?

I have written an Azure Function App by using the User Interface of Azure Portal. The code is written in C#.
Now, I want to:
download all of the relevant code and configuration files of this
function app
Create an IDE project (e.g. IntelliJ, Visual Studio Code, ...)
store it in a git repository
Deploy the code from IDE or command line to Azure and thereby replacing the previously written Azure function.
So far, I have found only documentation on how to initiate Azure function projects with no previous code. Does somebody know how to do above?
Yes, you could go to your function Overview page, click on Download app content as shown below.
And in your situation, you want configuration files, so select the Content and Visual Studio Project and Include app settings in the download. What is app settings? This will include a local.settings.json file which contains your application settings.
Also the third party .dlls are included.
In the VS, select the folder and it will be working.
Update:
Open the function with vs, then just right click the function and choose Publish, it will show you the publish page. Click start, then you will be able to publish it to a existing Function.
Follow this Setting up a CI/CD pipeline for Azure Functions doc which explain each step in detail.

How to further debug a 500 Internal Server Error after upgrade to ASP.NET 5 beta5

I had a site running asp.net 5 beta4, and decided to upgrade to beta5. The site runs locally fine. I pushed the changes to master and it was picked up from bitbucket and deployed successfully.
When I try to hit the site in azure, I get a 500 Internal Server Error. I've tried a number of things, but can't seem to track down the root cause of the failure. I'm looking for suggestions as I'm hitting a wall. From what I've tried below it seems like some fundamental initialization is failing.
Here's what I've tried:
Enabling customerrors="off". I added a web.config to the wwwroot folder with system.web/customErrors mode="Off". I've verified that the web.config is populated correctly in the deployed wwwroot and had the appsettings containing the dnxversion etc merged correctly.
Customizing the custom error page, adding runtimeinfo. I have the following set in my Startup.cs:
app.UseErrorHandler("/Home/Error");. I also have set the error page to display the exception. This doesn't seem to be hit.
Attached to the remote process to debug. Visual studio eventually freezes, so haven't gotten anywhere with this.
Enabled application insights. This registers events when I debug locally, but doesn't capture anything from the azure instance.
Enabled application logs and request failure tracing. The detailed errors show a 500.0, without much detailed information.
Imgur
Imgur
I've also verified through the console that the runtime is set correctly to beta5.
Update:
I set the ASPNET_ENV to Development and it loaded with appsettings loaded via the azure portal. Setting ASPNET_ENV to something else isn't working. I also removed any custom code from startup.cs pertaining to the non-development environments, with no help. I'm still looking for a means of capturing the original error.
Assuming you are targeting DNX451 and not dnxcore50, there is a good chance Azure it still trying to run it against the beta4 runtime instead of beta5. If that's the case, you won't get a decent error message.
Try adding an environment variable in Azure "SCM_DNX_VERSION" and set it to 1.0.0-beta5. It looks like kudu was recently upgraded to support beta5 https://github.com/projectkudu/kudu/commit/55175a017779bf493ff8e6ce87b96dd1451f7d7b, so you might want to try to redeploy from bitbucket in the case that the Kudu team has already deployed this change.
For a little more detail, you can check out my previous answer (although it is very dated and references the old "K" names) here:
Deploying ASP.NET vNext beta 2 on Azure with Kudu
Every time you update to a new beta, you will have to update your SCM_DNX_VERSION environment variable.

Error Deploying New Relic Instrumented Site to Azure from Github & VS.NET

I am getting the following error:
Error: The process cannot access the file 'C:\DWASFiles\Sites\mywebsitename\VirtualDirectory0\site\wwwroot\newrelic\NewRelic.Agent.Core.dll' because it is being used by another process.
In the Running deployment command... log file when attempting to deploy an Azure website from Github.
Would appreciate any pointers as to what could be causing this.
UPDATE: Turns out this is also failing when publishing directly from VS.NET with the following:
1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets(4196,5): Warning : An error was encountered when processing operation 'Create File' on 'NewRelic.Agent.Core.dll'.
1>Retrying operation 'Update' on object filePath (mywebsitename\newrelic\NewRelic.Agent.Core.dll). Attempt 1 of 2.
1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets(4196,5): Error : Web deployment task failed. ((06/07/2013 23:54:58) An error occurred when the request was processed on the remote computer.)
This was working before and I am not sure why it would have stopped.
NewRelic recommend stopping the website to unload the file and allow the deployment to go through.
As an alternative, you can set COR_ENABLE_PROFILING to 0 in your app settings on the configure tab to temporarily disable the profiling, which should then allow you to continue with the deployment while leaving the website operational throughout.
Instead of stopping the website you can temporarily turn off New Relic monitoring via the Configure tab on manage.windowsazure.com:
Configure > developer analytics > select "OFF" > Save
Deploy
Configure > developer analytics > select "ADD-ON" > Choose Add-on from dropdown > Save
Worked for me, both with a regular deployment from VS and an automatic build from VSO.
This is a known issue with the New Relic .NET agent for Azure Websites when performing an upgrade of the agent. The workaround is to stop the website to release the dll, finish the deployment and then restart the instance.
https://newrelic.com/docs/dotnet/azure-web-sites#h2-1
Not really a solution but more of a work-around, in the publish dialog view a preview of the changes and uncheck the NewRelic.Agent.Core.dll file so that it doesn't get published.
None of these answers work for me anymore. I have an Azure Basic tier website plan, which hosts multiple actual websites.
If I don't stop the website, I get the error mentioned above (newrelic.agent.core.dll is in use)...
If I do stop the website (or all of them), I get an error saying that the publishing endpoint isn't available.
If I go to the configure tab and disable the AddOn, we still get the error mentioned above (newrelic.agent.core.dll is in use)...
Pretty much we just republish over and over again with different permutations of the above until if works. It took me hours the other day, took me 10 minutes today.
If you are using webdeploy, then you can configure your webdeploy settings so that it ignores the file. However, if you do that, you will manually have to deploy any updates to the new relic agent.
I had a similar issue with the new relic log file being locked, and solved it by:
Moving the new relic log file to a subdirectory of the web root (e.g. \newreliclogs)
Adding 2 lines to my powershell script that configured the skip directive to ignore that whole directory. e.g. (where destBaseOptions is of type Microsoft.Web.Deployment.DeploymentBaseOptions
$skipDirective = new-object Microsoft.Web.Deployment.DeploymentSkipDirective("NewRelicLog","objectName=dirPath,absolutePath=.*\newreliclogs$")
$destBaseOptions.SkipDirectives.Add($skipDirective)
Depending on how you are using webdeploy, the configuration is achieved slightly differently, I used the following links to help me piece it together:
https://technet.microsoft.com/en-us/library/dd569089(WS.10).aspx
https://msdn.microsoft.com/en-us/library/microsoft.web.deployment.deploymentskipdirective(v=vs.90).aspx
https://msdn.microsoft.com/en-us/library/dd543313(v=vs.90).aspx
http://blogs.iis.net/jamescoo/archive/2009/11/03/msdeploy-api-scenarios.aspx
http://forums.iis.net/p/1192163/2031814.aspx#2031813
And I used the powershell script from the Octopus Deploy Library at https://library.octopusdeploy.com/#!/step-template/actiontemplate-web-deploy-publish-website-(msdeploy).

Resources