DSC, Custom script, Run Command windows time limit

Rachita Sharma 0 Reputation points
2025-06-17T14:27:48.92+00:00

Hi

I’m currently facing an issue while using Desired State Configuration (DSC), Custom Script Extension or Run Command windows in Azure through Terraform.

I’m installing several prerequisites on a Windows server using a PowerShell script. These prerequisites are deployed via DSC and Custom Script extensions or run command(tried and tested all the mentioned)  as part of a CI/CD pipeline. However, the deployment consistently fails due to the 90-minute timeout limit on the extension, which the infrastructure build exceeds. Is there a workaround or method to extend the timeout duration for these extensions?

I have also tested the setup with an 8 vCPU core VM, but the issue persists.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,013 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Rachita Sharma 0 Reputation points
    2025-06-18T05:05:49.37+00:00

    User's image

    Hi
    I cannot follow the steps mentioned as the Add, compose links have been removed, and the cli command line is still in preview.

    Thanks for the in-detail preview but is there any other solution.


  2. Siva Pavuluri 490 Reputation points Microsoft External Staff Moderator
    2025-06-18T06:26:40.7466667+00:00

    Hi Rachita Sharma,

    I understand your concern. The deployment consistently fails due to the 90-minute timeout limit imposed on the Custom Script Extension. This extension allows scripts to run for up to 90 minutes; any execution that exceeds this limit will cause the extension to fail during provisioning.

    User's image

    check this document you can get reduce timecustom-script-linux#tips.

    workaround:

    1. Split the Script into Smaller Chunks: Break your long-running script into smaller, modular components that can each complete within the 90-minute timeout window. You can sequence them using tags or metadata to track progress and ensure proper execution order.

    2. Use a Custom VM Image: If the prerequisites are static, consider creating a custom virtual machine image with all necessary components pre-installed. This approach significantly reduces provisioning time and can eliminate the timeout issue altogether.

    If the answer is helpful, please click "Accept Answer" and "Upvote it" as it can be helpful to others in the community.

    Thank You.

    0 comments No comments

Your answer

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