How to host a console application on Azure by uploading .exe file? - asp.net

I have an web application (ASP.NET MVC) host on Azure web app service and an console application (C#) as http trigger locally. This Azure web app service will call the .exe once when it's running. They run well this way.
Now I'd like to move the .exe file to Azure and call it from Azure app service. But I only find Azure function app to execute a piece of code written using Azure portal. Is there a possible solution for me to simply upload this exe file to Azure and can be called by Azure app service ?
Thanks in advance.

It seems that you would call your console application as http trigger when web app run. If so, you may need to upload your console application as a Azure webjob.
You could right click your console app and choose "Publish as Azure Webjobs" to publish your console app to the Web app on Azure.
WebJobs is a feature of Azure App Service that enables you to run a program or script in the same context as a web app.
For more details about deploy webjobs you could refer to this article.
Also, if you are using console core application, you could refer to this blog to deploy it.

Related

Blazor Webassembly asp.net hosted with Microsoft Azure AD authentication

I found a lot number of examples how o do this.
https://learn.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/hosted-with-azure-active-directory?view=aspnetcore-6.0
And it works fine when I run it locally in debug.
Everything is fine, until I want to publish the application up to an Azure APP Service.
I create an App Service and connect the server registration to it
I add on the client registration the URL of the APP Service https://xxxxx.azurewebsites.net/authentication/login-callback
In Visual Studio 2022 I publish the server application up to the App Service
To my surprise, the application does not work from the published site...
I get the response:
Sign in
Sorry, but we’re having trouble signing you in.
AADSTS700054: response_type 'id_token' is not enabled for the application.
I can not find an example that go all the way to a published APP service...
So what is wrong in my thinking here?
You need to register the app in Azure AD.
Your error message is: "'id_token' is not enabled for the application"
To fix this under Advanced Settings, Implicit grant check the box "ID tokens".

Start azure project from command line

We have an ASP .Net (not CORE) project. There is a different Azure project as startup that starts the Azure emulator and then the website via IISExpress. I want to write some UI tests against the website. How do I start the Azure project from the command line?
Also, I've tried launching the website directly with IISExpress in the command line and getting an error; so I'm trying to take the approach of launching the Azure project from the command line instead.
To invoke the ASP.NET Application using command line via IISExpress, you can use the below command and start IISExpress and then invoke the web request with specific URL and port. And if you are trying to publish the web app to azure , then try to invoke the web request with the Azure Web App URL.
Hope above information helps.

Manage Custom App Offline via VSTS publish in Azure

I want to manage a custom App offline file whilst doing a publish to azure via the Deploy Azure App Service task.
I realise that this task has a property of:take app offline
however this property will use the basic app offline file which is what I would like to avoid.
I figure I need to do something like this.
Option 1
rename file on azure service _App_Offline.htm to App_offline.htm
publish app.
rename file on azure service App_Offline.htm to _App_Offline.htm
however I can't figure out how to do steps 1 or 3.
Option 2
publish file on azure service App_Offline.htm
publish app.
delete file on azure service App_Offline.htm
I can manage steps 1 and 2 of these but how would i do step 3?
any other options i could try?
You can Create/Delete/Rename file on azure app service through kudu REST API, refer to this thread below to get more information about how to use kudu REST API during the build/release.
Remove files and foldes on Azure before a new deploy from VSTS

Publish web application into azure web app using visual studio online

I have created following Virtual Applications and Directories in the azure portal Click here to view the image
And using visual studio online I can build and deploy the site into root folder but I couldn't figure it out how to deploy into a virtual directory I have created earlier.
Click here to view the image
Any one have experience on this ? Appreciate your thoughts.
The Azure Web App Deployment task can't deploy a virtual application as it uses Publish-AzureWebSiteProject which can't handle virtual applications.
You can check the poweshell script which uses WebDeploy to deploy a virtual application at website:https://github.com/Microsoft/vso-agent-tasks/issues/624

How to only deploy changed project files in Windows Azure?

I am working on a web project in ASP.NET which is integrated with Salesforce. I have published my web project in Windows Azure. Now I have some changes in particular files and I want to deploy these changes only rather than complete project.
If you are using Web Deploy from within Visual studio, it will automatically only deploy the changed files in a differential manner. Alternatively, if you are using Azure VM's or a Cloud Service (which is actually VM's), you can connect to the machine(s) using RDP and update select files manually. You can get the RDP information to the machine from the Azure Portal.
http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-log-on-windows-server/

Resources