In Learning Azure document, the Exercise Deploy resource group admsdemorg failed

Dong Li 11 Reputation points


While I am studying module "Migrate your relational data stored in SQL Server to Azure SQL Database" (, there is an exercise to deploy the template to create a new resource group "admsdemorg". (

I followed the exercise and tried to deploy the template but failed. I tried several locations which support Azure Database Migration Service, but none of them success. The error message looks like 'Provisioning of VM extension CustomScriptExtension has timed out. Extension provisioning has taken too long to complete. ". The whole error message is below:

{"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see for usage details.","details":[{"code":"Conflict","message":"{\r\n \"status\": \"Failed\",\r\n \"error\": {\r\n \"code\": \"ResourceDeploymentFailure\",\r\n \"message\": \"The resource operation completed with terminal provisioning state 'Failed'.\",\r\n \"details\": [\r\n {\r\n \"code\": \"VMExtensionProvisioningTimeout\",\r\n \"message\": \"Provisioning of VM extension CustomScriptExtension has timed out. Extension provisioning has taken too long to complete. The extension did not report a message. More information on troubleshooting is available at\\"\\r\\n }\r\n ]\r\n }\r\n}"}]}

I am following the learning document exercise and didn't modify any thing of the template while deploying the template. I am using a free trail subscription.

Can someone please help? Thanks.


Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
4,898 questions
1 vote

3 answers

Sort by: Most helpful
  1. Andrei Jabbarau 11 Reputation points

    Open PowerShell on your VM and try to run this commands:

    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

    $Script = Invoke-WebRequest ''
    $ScriptBlock = [Scriptblock]::Create($Script.Content)
    Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList sqladmin, <YourPassword>

    NOTE: change <YourPassword> value

    Seems, that step with CustomScriptExtension is not working properly, but we still can run it manually :)

    2 people found this answer helpful.

  2. KarishmaTiwari-MSFT 11,881 Reputation points Microsoft Employee

    @Dong Li
    If you are running scripts on the VM using Custom Script Extension, you could sometimes run into an error where VM was created successfully but the script has failed. Under these conditions, the recommended way to recover from this error is to remove the extension and rerun the template again. Note: In future, this functionality would be enhanced to remove the need for uninstalling the extension.

    1. Please click on deploy to Azure in the exercise here and click on Edit template.
    2. Remove the custom script extension code in the template and deploy again. This should result in successful deployment. Please try and let me know if you have any questions.


    1 person found this answer helpful.

  3. Andrew Mosbauer 1 Reputation point

    Hi , I encountered the same problem.

    the module [Exercise - Environment setup] claims that the deployment will create the following resources:

    A resource group.
    A SQL Server instance.
    An empty Azure SQL database.
    A virtual machine running SQL Server.
    Network and storage resources to support the previous items.


    No SQL Server Instance is created
    hence also no empty SQL Server is created

    The following units assume that the SQL resources have been created.