question

MSTechie-7364 avatar image
0 Votes"
MSTechie-7364 asked MSTechie-7364 answered

Migrate .net console app to Azure

What options do we have in azure to migrate .net 4.5 console app. ?

I am looking for PaaS or Serverless options.

Can we run .net framework 4.5 console app EXEs , via Azure Function which is based on PowerShell Core ?

Please help

azure-webappsazure-functions
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@MSTechie-7364, Apologies for the delay!

Here is a good sample for your use case - Run Console Apps on Azure Functions.

It's a generic function that can run any console application. You can specify which console app to run in a file called FunctionConfig.json.

It shows an example, you just specify the input parameters to your exe in a configuration file. You can use binary files as inputs to the exe by specifying a URL to download it from.

Azure Functions Core Tools -with this, you can test your functions on your local computer from the command prompt or terminal or also deploy to Azure.

See this doc for available PowerShell Core version and configuration details.
Azure Functions PowerShell developer guide

0 Votes 0 ·

Kindly let us know if the above sample and configuration helps.
I'll follow-up with you and also leave this open for azure-functions community to share additional insights.

0 Votes 0 ·

Hi @ajkuma-MSFT

I had already the code in the link - Run Console Apps on Azure Functions.

My Console app is built in .Net 4.5 .
The Azure Function runtime is 3.1 for .Net. It gave below errors

Microsoft.Azure.WebJobs.Script: One or more errors occurred. Anonymously Hosted DynamicMethods Assembly: Index was outside the bounds of the array.
2021-06-07T18:04:39.443 [Error] Function completed (Failure, Id=19151399-f9cc-4118-8137-85fd9b4f15c9, Duration=2835ms)
*

Please help.

0 Votes 0 ·

@MSTechie-7364, Thanks for sharing more details. I'm discussing on this internally with Azure Functions SMEs and we will post back soon.
I'm also adding additional tags for other community SMEs to share insights/inputs on this.

0 Votes 0 ·
MSTechie-7364 avatar image
0 Votes"
MSTechie-7364 answered

Hi,
Actually the above never worked for me.
I wrote my own code to just invoke the exe using the Process.Start method

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JayaC-MSFT avatar image
0 Votes"
JayaC-MSFT answered MSTechie-7364 converted comment to answer

Hello @MSTechie-7364, We did not receive any further details. Looks like a code issue. I found something similar: https://github.com/Azure/azure-functions-host/issues/1202#issuecomment-280369781
Please confirm if you are still encountering the issue.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.