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

DongLi-1330 11 Reputation points
2020-09-04T14:10:45.233+00:00

Hello,

While I am studying module "Migrate your relational data stored in SQL Server to Azure SQL Database" (https://learn.microsoft.com/en-us/learn/modules/migrate-sql-server-relational-data/), there is an exercise to deploy the template to create a new resource group "admsdemorg". (https://learn.microsoft.com/en-us/learn/modules/migrate-sql-server-relational-data/2-exercise-environment-setup).

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 https://aka.ms/DeployOperations 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 https://aka.ms/VMExtensionCSEWindowsTroubleshoot\\"\\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.

Regards,
Dong

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,874 questions
{count} vote

3 answers

Sort by: Most helpful
  1. Andrei Jabbarau 11 Reputation points
    2020-09-27T12:39:02.257+00:00

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

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

    $Script = Invoke-WebRequest 'https://raw.githubusercontent.com/MicrosoftDocs/mslearn-migrate-sql-server-relational-data/master/AddDatabaseToSqlServer.ps1'
    $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 20,037 Reputation points Microsoft Employee
    2020-09-09T23:38:29.98+00:00

    @DongLi-1330
    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.
      23631-image.png
    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.

    23602-image.png

    1 person found this answer helpful.

  3. Andrew Mosbauer 1 Reputation point
    2020-11-24T05:04:54.477+00:00

    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.

    However

    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.

    Regards,
    Andrew

    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.