Issue- Install framework .NET core 8.0 while running Console Batch job in azure portal

Rajagopal Jayachandran 20 Reputation points
2025-08-21T16:20:34.05+00:00

Facing issue while running batch job in azure portal,

  1. Uploaded application package zip file.
  2. Job and Task created.
  3. Command line provided and run it job application,
  4. issue came for install framework 8.0 core.
  5. Create task start in pool for install package,
  6. reboot completed- compute nodes.
  7. still facing same issue. Note- pool created OS- windows server 2022 datacenter core please the solution to resolve this issue, and also required, i need dynamic command for to run all console app via command line while create task in azure.
Azure Batch
Azure Batch
An Azure service that provides cloud-scale job scheduling and compute management.
{count} votes

1 answer

Sort by: Most helpful
  1. Himanshu Shekhar 1,170 Reputation points Microsoft External Staff Moderator
    2025-08-26T20:46:07.18+00:00

    Hello Rajagopal Jayachandran,

    Thank you for sharing the command you are using for the startup task on your Azure Batch pool. Here’s a detailed explanation and some suggestions to help fix the problem in easy-to-understand terms.

    A startup task is a script or command that runs automatically on each compute node when it joins the pool or restarts.

    This task prepares the node for running your actual batch tasks for example, by installing software like .NET Framework or the .NET runtime, so your applications can run properly.

    Your current command is trying to do two things in one go:

    1. Check and install the .NET Framework 4.8 if it’s missing.
    2. Check and install the .NET 8.0 runtime if it’s not installed yet.

    This approach is correct in principle, but sometimes combining multiple commands this way can cause errors or race conditions during installation.

    Instead of one long command, it’s better to have clear, step-by-step instructions that the pool nodes can follow reliably every time they start. This also makes it easier to see what’s going wrong.

    I recommend to:

    Split the installation into clear steps using PowerShell can handle checking and installing software robustly. For example:

    • First, check if .NET Framework 4.8 is installed; if not, install it quietly.
    • Then, check if .NET 8.0 runtime is installed; if not, install that too. Finally, update the system’s PATH environment variable so the .NET runtime is recognized everywhere.
    1. Log everything to a file This helps in diagnosing problems by keeping a record of what happened during startup.
    2. Make sure the task runs with admin privileges Installing software requires elevated rights, so the startup task should run as an administrator.

    You can create a PowerShell script (install-dotnet.ps1) with the above logic and configure your Batch pool’s startup task to run that script. The script:

    1. Installs .NET Framework 4.8 only if needed.
    2. Installs .NET 8.0 runtime only if it’s missing.
    3. Updates environment variables.
    4. Writes a log to C:\batch-startup.log so you can review what happened.

    This approach is more reliable than chaining commands in one line.

    • Upload the .NET installer files (dotNetFx48_Full_x86_x64.exe and dotnet-runtime-8.0.0-win-x64.exe) to Azure Storage or as Batch application packages.
    • Reference these files in your startup task through resource files or application packages.
    • Update your startup task to run either the improved PowerShell script or a well-structured command similar to the example.
    • Make sure the startup task is configured to run with admin rights and to wait for success before nodes start running your jobs.
    • After provisioning the pool, check the startup task logs from the Azure Portal to ensure everything installed without errors.
    • Split the installation into clear steps using PowerShell.
    • PowerShell can handle checking and installing software robustly. For example:
      • First, check if .NET Framework 4.8 is installed; if not, install it quietly.
      • Then, check if .NET 8.0 runtime is installed; if not, install that too.
      • Finally, update the system’s PATH environment variable so the .NET runtime is recognized everywhere.
    • Log everything to a file - This helps in diagnosing problems by keeping a record of what happened during startup.
    • Make sure the task runs with admin privileges - Installing software requires elevated rights, so the startup task should run as an administrator.
    • You can create a PowerShell script (install-dotnet.ps1) with the above logic and configure your Batch pool’s startup task to run that script. The script:
      • Installs .NET Framework 4.8 only if needed.
      • Installs .NET 8.0 runtime only if it’s missing.
      • Updates environment variables.
      • Writes a log to C:\batch-startup.log so you can review what happened.
      This approach is more reliable than chaining commands in one line.
      • Upload the .NET installer files (dotNetFx48_Full_x86_x64.exe and dotnet-runtime-8.0.0-win-x64.exe) to Azure Storage or as Batch application packages.
      • Reference these files in your startup task through resource files or application packages.
      • Update your startup task to run either the improved PowerShell script or a well-structured command similar to the example.
      • Make sure the startup task is configured to run with admin rights and to wait for success before nodes start running your jobs.
      • After provisioning the pool, check the startup task logs from the Azure Portal to ensure everything installed without errors.

    Running Your Console Apps - Once the runtime is installed correctly, you can run your .NET 8 console apps by specifying a simple command line like:

    textcmd /c "C:\Program Files\dotnet\dotnet.exe YourApp.dll %*"

    This tells the system to use the installed .NET runtime to launch your app, passing any arguments dynamically.

    The Azure Batch Service sets the following environment variables on compute nodes. You can reference these environment variables in task command lines, and in the programs and scripts run by the command lines - https://free.blessedness.top/en-us/azure/batch/batch-compute-node-environment-variables

    Jobs and tasks in Azure Batch - https://free.blessedness.top/en-us/azure/batch/jobs-and-tasks

    Azure Batch best practices - https://free.blessedness.top/en-us/azure/batch/best-practices

    Kindly let us know if the steps helps or you need further assistance on this issue.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.