My Server Side Blazor app's Counter isn't incrementing when deployed to Azure - azure

I newed up a server side Blazor project (formerly Razor Components) via dotnet new razorcomponents -o MySampleApp. It works as expected on my machine, when when I right click and attempt to publish to Azure, it fails with a
HTTP Error 503. The service is unavailable.
I solved this by using the "Self-Contained" Deployment Mode, which gets me to the expected Blazor example home page. The weather forecast page works, but the counter page fails to increment. How can I fix this?

I needed to turn on websockets. Duh.
I found it under portal.azure.com > MySampleApp app service > Configuration > General Settings > Web sockets.
Also, apparently I can install the ASP.NET Core 3.0 Runtime in Extensions, which means I can go back to "Framework-Dependent" as a Deployment Mode. This video was a great help: https://www.youtube.com/watch?v=GfazTDXH6JA

Related

Waiting for bot to be ready after deployment

Situation 1
I wrote my own bot framework and deploy to Azure,
the Test in Web Chat shown me "Waiting for bot to be ready after deployment".
Situation 2
I downloaded the source code from Azure bot Services,after that I deploy back to Azure, the Web Chat shown me "Waiting for bot to be ready after deployment".
I also faced this issue and this is how I solved it.
Changed my publish settings to have Remove additional files at destination checked. This is an important step because when you provisioned a new web app bot, it will already have some files in the location. So when you publish your code, it will be placed along with the code files which already exists. You can also test it by navigating to the /api/messages url. If this gives you error, then this is most likely the case.
I also updated all the NuGet dependencies.
The other thing that caused me a bit of issue was the App Password. The app password in your web.config should match the one which is already generated for your BOT. Do not create a new password from the bot management page. If you did that then make sure that you change/update the password in web app bot application settings and also in the web.config file. When you host the bot, by default it will use the Application Id and Application Password which were generated automatically. You can see these values in the Web App Bot service type which is under the section App Service Settings>Application Settings. Scroll down to the bottom and you will see these two settings. Copy the values of Application Id and Application Password and update them in the Web.config file.
Hope this help!
What fixed it for me was changing Destination URL in Publish Settings to https. For some reason default is http.
I had missing node packages that I wasn't aware of. I found the errors in the output logs at https://[bot-name-here].scm.azurewebsites.net/dev/wwwroot/:vs.output
Or you can Navigate to this by going to Build -> Click 'Show output' (or Shift+Command+U) (its the 5th icon in the left hand side menu on the Build window)
Hope that helps!
Some ideas to troubleshoot for people having the same error:
Check that the server hosting your bot is actually running. If https://YOUR_BOT.azurewebsites.net is timing out, then your server is not running, check your config
Check if you have logs in the App Service: Enable everything under App Service > Diagnostic logs, then go to App Service > Log Stream.
Check potential errors under Web App Bot > Channels > Web Chat > Issues
Check that the files on the server look ok by going to App Service > App Service Editor (Preview)
Close all your browsers, especially if they have been running for a long time and/or you have been changing a lot of config/files recently
I fixed the issue by using a combination of those points
I had the window open for a few days, and "Test in Web Chat" would just show "Waiting for bot to be ready" and the juggling progress indicator, forever. I duplicated the tab and it came right up. I think my session may have expired or something, because any new, duplicated tab, I could bring the bot up in just fine.
I solved the problem by, in Visual Studio's Solution Explorer, setting the .bot file's property "Copy to Output Directory" to "Copy always"."
The details: The bot worked fine locally in the emulator. After deploying to Azure (continuous deployment), "Test in Web Chat" hung with "Waiting for bot to be ready". (Would be nice if it detected and reported errors.)
After setting up Azure storage, turning on Azure logging, discovering the FileNotFoundException, inspecting with Resource Explorer, and deploying multiple bot versions, I isolated the cause. This document really helped me troubleshoot:
https://learn.microsoft.com/en-us/azure/app-service/troubleshoot-dotnet-visual-studio#a-nameapptracelogsacreate-and-view-application-trace-logs
I also experienced this problem but the solution I have is totally different from the suggestions above.
I created my Knowledge Base and Web App Bot purely using the portal. The problem lies with the configuration. As of writing, the Bot Template: Node.js > Question and Answer does not work. I needed to create a new Web App Bot and I selected instead C# > Question and Answer.
That fixed my problem and allowed me to use the Test in Web Chat feature.

Running Signalr in IIS on .Net Core - hub being hit but client sees 500 error

I have a .net core application deployed to IIS. There is a signalr hub in the application.
My problem is that when my client hits the hub it receives a 500 error back.
I have put logging in the hub and can see that it is being hit correctly and no exceptions are being thrown.
The setup works perfectly when run from Visual Studio.
I am thinking something might not be set up in IIS correctly.
Does anyone have any ideas that this might be?
I enabled the generic error page in the api and looking at the network tab in the browser I was able to see the call that signalr was making.
I looked at the content of this request and found that an error with the following message was being returned by the server...
The data protection operation was unsuccessful
After some searching I found that this was being caused due to a setting on the IIS application pool.
The steps to change the setting were...
Open IIS Manager
Select Applications Pools, and go ahead and select the App Pool used by your app
Right-click on it, and select Advanced Settings, Go to the Process Model Section and Find the “Load User Profile” Option and set it to True
These steps were taken from http://puresourcecode.com/dotnet/post/ASPNET-The-data-protection-operation-was-unsuccessful

msdeploy.axd returns 404

I'm trying to setup webdeploy on IIS8, but why am I getting 404 when accessing both https://[servername]:8172/msdeploy.axd and https://localhost:8172/msdeploy.axd locally.
I've installed management service.
I've installed webdeploy 3.5 using web platform installer. In Program and Features a changed the instalation of webdeploy to include all features including the handler.
In IIS Manager I've chosen Configure Web Deploy Publishing for default website's context menu.
I've restarted management service.
when i tried https://[servername]:8172/msdeploy.axd I was asked to enter credentials and accept the certificate. after that I got 404.
I've uninstalled webdeploy and installed using MSI manually including all features.
restarted entire server.
getting 404.
I don't believe you can open the service from a browser. I attempted that against a dev server that we deploy to many times a day and also received a 404. I would try deploying from VS instead as a test.
Also if anyone comes here and is using Visual Studio Publish dialog and the "Validate Connection" button fails: do NOT use the button when creating. Just click Ok, then Edit (in More actions menu).
In the Connection tab, click Validate Connection. This time it will asks you to accept an invalid certificate (since you likely self-signed it on your server). Accept it and the connection should go through.

Error and problems after publishing ASP.NET 5 vNext RC2 to Azure

When I publish to Azure my tiny, tiny test project, configured in the latest vNext RC2, I get the following error upon first load after an extremely long wait:
The specified CGI application encountered an error and the server terminated the process.
Subsequently if the app is anything more than the very simple "Hello World" project below, i.e. it uses some MVC etc. then the app is extremely unresponsive, failing to load some images, taking minutes to load each page. Although sometimes it's suddenly fast for a little while, then slow again.
In RC2 there were some changes to the hosting setup, but all these have been implemented in my tiny test project.
I have also seen this question and ensured I am publishing the exact correct version of the CLR, in fact for information the same result happens if I use full or core CLR.
Here is the example project (publishing profiles removed):
https://www.dropbox.com/s/hpkrj6c74eaytjz/TinyProject.zip?dl=1
If I create a new RC1 project, the problem doesn't surface, but as soon as I update it to RC2 the problem persists.
In the end I solved this by creating an App Service Plan that was anything other than the free or shared option, in my case B1 (screenshot from Visual Studio Azure SDK):
Has your Azure Web app instance had a RC1 instance uploaded to it prior to your RC2? Your project looks ok to me, I can't see anything wrong at first glimpse with your project.json, Startup.cs or hosting.json files. I had an instance of RC1 on a Web App, and when trying to upload RC2, nothing would work, just a long long wait until eventually it would time out with a 503 error. I deleted the Web App, and just published the RC2 (using same DNX build as yourself) and everything works fine (so far!).
Also, if you turn on Diagnostic logging in your Web App, does that provide any more info?

Deploying lightswitch desktop application error

I am having difficulty in deploying my forst lightswitch desktop application.
when i try to publish, in the summary window it says
Database: Donot Publish
and the install.htm file is cofusing to me.
Can someone help me with a step by step tutorial.
I will be grateful.
I have installed Microsoft SQL server 2008.
The process of deploying a LightSwitch-based application differs depending on the application type and deployment scenario that you select. You have said that your lightswitch application is a desktop application. So, the possible deployment scenarios are:
Desktop client 2-tier
Desktop client, 3-tier
These links will help you :
Deploying LightSwitch Applications
How to: Deploy a 2-tier Application
How to: Deploy a 3-tier Application
You should try to get the exception info/stack trace from the server process (vslshost.exe) to get more information about the error when retrieving or saving data. If your app tries to load data when opening, change it so that there is no default screen. This will prevent the app from opening a screen when loading the app and trying to load data, allowing you enough time after opening the app to attach a debugger. You can follow my blog post at http://blogs.msdn.com/b/mthalman/archive/2013/08/16/how-to-get-a-stack-trace-in-lightswitch.aspx for info on how to get the exception info.

Resources