Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The template parameters 'undefined' in the parameters file are not valid when using Create Azure DevTest Labs VM #773

Open
sbugalski opened this issue May 20, 2021 · 22 comments

Comments

@sbugalski
Copy link

sbugalski commented May 20, 2021

Hello,

I've just find out the ms-azuredevtestlabs.tasks.azure-dtl-task-createvm.AzureDevTestLabsCreateVM@3 stopped working, because of adding undefined parameter with same value.

steps:
- task: ms-azuredevtestlabs.tasks.azure-dtl-task-createvm.AzureDevTestLabsCreateVM@3
  displayName: 'Create Azure DevTest Labs VM'
  inputs:
    azureSubscription: '[REDACTED]'
    LabId: '[REDACTED]'
    VirtualMachineName: test
    TemplateFile: arm/vm.json
    ParametersFile: arm/vm.parameters.json
{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "newVMName": {
      "type": "string"
    },
    "labName": {
      "type": "string",
      "defaultValue": "devtest"
    },
    "size": {
      "type": "string",
      "defaultValue": "Standard_DS2_v2"
    },
    "userName": {
      "type": "string",
      "defaultValue": "[REDACTED]"
    },
    "password": {
      "type": "securestring",
      "defaultValue": "[[VmPassword]]"
     },
    "Azure_Pipelines_Deployment_Group_Agent_accountUrl": {
      "type": "string",
      "defaultValue": "[REDACTED]"
    },
    "Azure_Pipelines_Deployment_Group_Agent_projectName": {
      "type": "string",
      "defaultValue": "[REDACTED]"
    },
    "Azure_Pipelines_Deployment_Group_Agent_deploymentGroupName": {
      "type": "string",
      "defaultValue": "[REDACTED]"
    },
    "Azure_Pipelines_Deployment_Group_Agent_PersonalAccessToken": {
      "type": "securestring",
      "defaultValue": "[[PAT]]"
    },
    "Azure_Pipelines_Deployment_Group_Agent_deploymentAgentTags": {
      "type": "string",
      "defaultValue": "WEB, DB"
    },
    "Azure_Pipelines_Deployment_Group_Agent_agentInstallPath": {
      "type": "string",
      "defaultValue": ""
    },
    "Azure_Pipelines_Deployment_Group_Agent_agentName": {
      "type": "string",
      "defaultValue": ""
    },
    "Azure_Pipelines_Deployment_Group_Agent_RunAsAutoLogon": {
      "type": "bool",
      "defaultValue": false
    },
    "Azure_Pipelines_Deployment_Group_Agent_windowsLogonAccount": {
      "type": "string",
      "defaultValue": "NT AUTHORITY\\NetworkService"
    },
    "Azure_Pipelines_Deployment_Group_Agent_windowsLogonPassword": {
      "type": "securestring"
    }
  },
  "variables": {
    "labSubnetName": "[concat(variables('labVirtualNetworkName'), 'Subnet')]",
    "labVirtualNetworkId": "[resourceId('Microsoft.DevTestLab/labs/virtualnetworks', parameters('labName'), variables('labVirtualNetworkName'))]",
    "labVirtualNetworkName": "[concat('Dtl', parameters('labName'))]",
    "vmId": "[resourceId ('Microsoft.DevTestLab/labs/virtualmachines', parameters('labName'), parameters('newVMName'))]",
    "vmName": "[concat(parameters('labName'), '/', parameters('newVMName'))]"
  },
  "resources": [
    {
      "apiVersion": "2018-10-15-preview",
      "type": "Microsoft.DevTestLab/labs/virtualmachines",
      "name": "[variables('vmName')]",
      "location": "[resourceGroup().location]",
      "properties": {
        "labVirtualNetworkId": "[variables('labVirtualNetworkId')]",
        "notes": "s001ci",
        "customImageId": "[REDACTED]",
        "size": "[parameters('size')]",
        "userName": "[parameters('userName')]",
        "password": "[parameters('password')]",
        "isAuthenticationWithSshKey": false,
        "artifacts": [
          {
            "artifactId": "[resourceId('Microsoft.DevTestLab/labs/artifactSources/artifacts', parameters('labName'), 'public repo', 'windows-wsl')]"
          },
          {
            "artifactId": "[resourceId('Microsoft.DevTestLab/labs/artifactSources/artifacts', parameters('labName'), 'public repo', 'windows-deploymentgroup')]",
            "parameters": [
              {
                "name": "accountUrl",
                "value": "[parameters('Azure_Pipelines_Deployment_Group_Agent_accountUrl')]"
              },
              {
                "name": "projectName",
                "value": "[parameters('Azure_Pipelines_Deployment_Group_Agent_projectName')]"
              },
              {
                "name": "deploymentGroupName",
                "value": "[parameters('Azure_Pipelines_Deployment_Group_Agent_deploymentGroupName')]"
              },
              {
                "name": "PersonalAccessToken",
                "value": "[parameters('Azure_Pipelines_Deployment_Group_Agent_PersonalAccessToken')]"
              },
              {
                "name": "deploymentAgentTags",
                "value": "[parameters('Azure_Pipelines_Deployment_Group_Agent_deploymentAgentTags')]"
              },
              {
                "name": "agentInstallPath",
                "value": "[parameters('Azure_Pipelines_Deployment_Group_Agent_agentInstallPath')]"
              },
              {
                "name": "agentName",
                "value": "[parameters('Azure_Pipelines_Deployment_Group_Agent_agentName')]"
              },
              {
                "name": "RunAsAutoLogon",
                "value": "[parameters('Azure_Pipelines_Deployment_Group_Agent_RunAsAutoLogon')]"
              },
              {
                "name": "windowsLogonAccount",
                "value": "[parameters('Azure_Pipelines_Deployment_Group_Agent_windowsLogonAccount')]"
              },
              {
                "name": "windowsLogonPassword",
                "value": "[parameters('Azure_Pipelines_Deployment_Group_Agent_windowsLogonPassword')]"
              }
            ]
          }
        ],
        "labSubnetName": "[variables('labSubnetName')]",
        "disallowPublicIpAddress": false,
        "storageType": "Premium",
        "allowClaim": false
      }
    }
  ],
  "outputs": {
    "labVMId": {
      "type": "string",
      "value": "[variables('vmId')]"
    }
  }
}
2021-05-20T22:36:26.2295149Z ##[debug]Evaluating condition for step: 'Create Azure DevTest Labs VM'
2021-05-20T22:36:26.2297047Z ##[debug]Evaluating: succeeded()
2021-05-20T22:36:26.2297618Z ##[debug]Evaluating succeeded:
2021-05-20T22:36:26.2298689Z ##[debug]=> True
2021-05-20T22:36:26.2299309Z ##[debug]Result: True
2021-05-20T22:36:26.2299930Z ##[section]Starting: Create Azure DevTest Labs VM
2021-05-20T22:36:26.2412456Z ==============================================================================
2021-05-20T22:36:26.2412865Z Task         : Azure DevTest Labs Create VM
2021-05-20T22:36:26.2413169Z Description  : Create an Azure DevTest Labs VM
2021-05-20T22:36:26.2413444Z Version      : 3.0.16
2021-05-20T22:36:26.2413695Z Author       : Microsoft Corporation
2021-05-20T22:36:26.2414039Z Help         : Creates a virtual machine in the selected lab.
2021-05-20T22:36:26.2414397Z ==============================================================================
2021-05-20T22:36:26.2640380Z ##[debug]Using node path: C:\agents\2.186.1\externals\node10\bin\node.exe
2021-05-20T22:36:26.6623420Z ##[debug]agent.TempDirectory=D:\a\_temp
2021-05-20T22:36:26.6642539Z ##[debug]loading inputs and endpoints
2021-05-20T22:36:26.6660213Z ##[debug]loading ENDPOINT_AUTH_[REDACTED]
2021-05-20T22:36:26.6885860Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_[REDACTED]_AUTHENTICATIONTYPE
2021-05-20T22:36:26.6888045Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_[REDACTED]_SERVICEPRINCIPALID
2021-05-20T22:36:26.6889919Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_[REDACTED]_SERVICEPRINCIPALKEY
2021-05-20T22:36:26.6891691Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_[REDACTED]_TENANTID
2021-05-20T22:36:26.6893406Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2021-05-20T22:36:26.6895022Z ##[debug]loading ENDPOINT_AUTH_SCHEME_[REDACTED]
2021-05-20T22:36:26.6896583Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2021-05-20T22:36:26.6898097Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2021-05-20T22:36:26.6902543Z ##[debug]loading INPUT_APPENDRETRYNUMBERTOVMNAME
2021-05-20T22:36:26.6904124Z ##[debug]loading INPUT_CONNECTEDSERVICENAME
2021-05-20T22:36:26.6905883Z ##[debug]loading INPUT_DELETEFAILEDDEPLOYMENTBEFORERETRY
2021-05-20T22:36:26.6907517Z ##[debug]loading INPUT_DELETEFAILEDLABVMBEFORERETRY
2021-05-20T22:36:26.6909151Z ##[debug]loading INPUT_FAILONARTIFACTERROR
2021-05-20T22:36:26.6910712Z ##[debug]loading INPUT_LABID
2021-05-20T22:36:26.6913088Z ##[debug]loading INPUT_PARAMETERSFILE
2021-05-20T22:36:26.6914529Z ##[debug]loading INPUT_RETRYCOUNT
2021-05-20T22:36:26.6916090Z ##[debug]loading INPUT_RETRYONFAILURE
2021-05-20T22:36:26.6917678Z ##[debug]loading INPUT_TEMPLATEFILE
2021-05-20T22:36:26.6919260Z ##[debug]loading INPUT_VIRTUALMACHINENAME
2021-05-20T22:36:26.6920911Z ##[debug]loading INPUT_WAITMINUTESFORAPPLYARTIFACTS
2021-05-20T22:36:26.6931153Z ##[debug]loaded 21
2021-05-20T22:36:26.6936168Z ##[debug]Agent.ProxyUrl=undefined
2021-05-20T22:36:26.6937384Z ##[debug]Agent.CAInfo=undefined
2021-05-20T22:36:26.6938838Z ##[debug]Agent.ClientCert=undefined
2021-05-20T22:36:26.6940223Z ##[debug]Agent.SkipCertValidation=undefined
2021-05-20T22:36:26.9106044Z Starting Azure DevTest Labs Create VM Task
2021-05-20T22:36:26.9117037Z ##[debug]ConnectedServiceName=[REDACTED]
2021-05-20T22:36:26.9119258Z ##[debug]RetryOnFailure=false
2021-05-20T22:36:26.9120884Z ##[debug]AppendRetryNumberToVmName=false
2021-05-20T22:36:26.9122401Z ##[debug]DeleteFailedDeploymentBeforeRetry=false
2021-05-20T22:36:26.9123758Z ##[debug]DeleteFailedLabVMBeforeRetry=false
2021-05-20T22:36:26.9125111Z ##[debug]FailOnArtifactError=false
2021-05-20T22:36:26.9126694Z ##[debug]LabId=/subscriptions/[REDACTED]/resourceGroups/[REDACTED]/providers/Microsoft.DevTestLab/labs/devtest
2021-05-20T22:36:26.9127590Z ##[debug]ParameterOverrides=undefined
2021-05-20T22:36:26.9129570Z ##[debug]ParametersFile=D:\a\1\s\arm\vm.parameters.json
2021-05-20T22:36:26.9130643Z ##[debug][REDACTED] data SubscriptionId = [REDACTED]
2021-05-20T22:36:26.9131808Z ##[debug]TemplateFile=D:\a\1\s\arm\vm.json
2021-05-20T22:36:26.9132617Z ##[debug]VirtualMachineName=test
2021-05-20T22:36:26.9133371Z ##[debug]WaitMinutesForApplyArtifacts=0
2021-05-20T22:36:26.9134489Z ##[debug]ResourceUtil: Getting ARM client instance.
2021-05-20T22:36:26.9137828Z ##[debug]ConnectedServiceName=[REDACTED]
2021-05-20T22:36:26.9140696Z ##[debug][REDACTED] auth param ServicePrincipalId = ***
2021-05-20T22:36:26.9142148Z ##[debug][REDACTED] auth param ServicePrincipalKey = ***
2021-05-20T22:36:26.9143182Z ##[debug][REDACTED] auth param TenantId = ***
2021-05-20T22:36:26.9144156Z ##[debug]ResourceUtil: Login using ConnectedServiceName '[REDACTED]'.
2021-05-20T22:36:28.0097458Z ##[debug]ResourceUtil: Getting DTL client instance.
2021-05-20T22:36:28.0106855Z ##[debug]ConnectedServiceName=[REDACTED]
2021-05-20T22:36:28.0109143Z ##[debug][REDACTED] auth param ServicePrincipalId = ***
2021-05-20T22:36:28.0110855Z ##[debug][REDACTED] auth param ServicePrincipalKey = ***
2021-05-20T22:36:28.0112220Z ##[debug][REDACTED] auth param TenantId = ***
2021-05-20T22:36:28.0114027Z ##[debug]ResourceUtil: Login using ConnectedServiceName '[REDACTED]'.
2021-05-20T22:36:28.0115340Z Task called with the following parameters:
2021-05-20T22:36:28.0116078Z   ConnectedServiceName = [REDACTED]
2021-05-20T22:36:28.0117027Z   LabId = /subscriptions/[REDACTED]/resourceGroups/[REDACTED]/providers/Microsoft.DevTestLab/labs/devtest
2021-05-20T22:36:28.0117907Z   VirtualMachineName = test
2021-05-20T22:36:28.0118526Z   TemplateFile = D:\a\1\s\arm\vm.json
2021-05-20T22:36:28.0120264Z   ParametersFile = D:\a\1\s\arm\vm.parameters.json
2021-05-20T22:36:28.0120932Z   FailOnArtifactError = false
2021-05-20T22:36:28.0121504Z   RetryOnFailure = false
2021-05-20T22:36:28.0122035Z   RetryCount = 0
2021-05-20T22:36:28.0122593Z   DeleteFailedLabVMBeforeRetry = false
2021-05-20T22:36:28.0123234Z   DeleteFailedDeploymentBeforeRetry = false
2021-05-20T22:36:28.0123876Z   AppendRetryNumberToVMName = false
2021-05-20T22:36:28.0124533Z   WaitMinutesForApplyArtifacts = 0
2021-05-20T22:36:28.0125269Z Creating Virtual Machine in Lab '[REDACTED]' under Resource Group '[REDACTED]'.
2021-05-20T22:36:28.0126068Z Invoking deployment with the following parameters:
2021-05-20T22:36:28.0126754Z   DeploymentName = Dtlgr0yny9un
2021-05-20T22:36:28.0127325Z   ResourceGroupName = [REDACTED]
2021-05-20T22:36:28.0127879Z   LabName = [REDACTED]
2021-05-20T22:36:28.0128393Z   VmName = test
2021-05-20T22:36:28.0128971Z   TemplateFile = D:\a\1\s\arm\vm.json
2021-05-20T22:36:28.2507811Z { Error: Deployment template validation failed: 'The template parameters 'undefined' in the parameters file are not valid; they are not present in the original template and can therefore not be provided at deployment time. The only supported parameters for this template are 'newVMName, labName, size, userName, password, Azure_Pipelines_Deployment_Group_Agent_accountUrl, Azure_Pipelines_Deployment_Group_Agent_projectName, Azure_Pipelines_Deployment_Group_Agent_deploymentGroupName, Azure_Pipelines_Deployment_Group_Agent_PersonalAccessToken, Azure_Pipelines_Deployment_Group_Agent_deploymentAgentTags, Azure_Pipelines_Deployment_Group_Agent_agentInstallPath, Azure_Pipelines_Deployment_Group_Agent_agentName, Azure_Pipelines_Deployment_Group_Agent_RunAsAutoLogon, Azure_Pipelines_Deployment_Group_Agent_windowsLogonAccount, Azure_Pipelines_Deployment_Group_Agent_windowsLogonPassword'. Please see https://aka.ms/arm-deploy/#parameter-file for usage details.'.
2021-05-20T22:36:28.2513528Z     at new t (D:\a\_tasks\AzureDevTestLabsCreateVM_65b23b71-d518-4074-8370-cf84ebfc909b\3.0.16\task.js:2:369869)
2021-05-20T22:36:28.2516851Z     at D:\a\_tasks\AzureDevTestLabsCreateVM_65b23b71-d518-4074-8370-cf84ebfc909b\3.0.16\task.js:2:359495
2021-05-20T22:36:28.2518582Z     at process._tickCallback (internal/process/next_tick.js:68:7)
2021-05-20T22:36:28.2520924Z   code: 'InvalidTemplate',
2021-05-20T22:36:28.2522285Z   statusCode: 400,
2021-05-20T22:36:28.2524596Z   request:
2021-05-20T22:36:28.2525799Z    e {
2021-05-20T22:36:28.2527988Z      streamResponseBody: false,
2021-05-20T22:36:28.2529129Z      url:
2021-05-20T22:36:28.2531394Z       'https://management.azure.com/subscriptions/[REDACTED]/resourcegroups/[REDACTED]/providers/Microsoft.Resources/deployments/Dtlgr0yny9un?api-version=2020-06-01',
2021-05-20T22:36:28.2532827Z      method: 'PUT',
2021-05-20T22:36:28.2534703Z      headers: e { _headersMap: [Object] },
2021-05-20T22:36:28.2535725Z      body:
2021-05-20T22:36:28.2607056Z       '{"properties":{"template":{"$schema":"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json","contentVersion":"1.0.0.0","parameters":{"newVMName":{"type":"string","defaultValue":"formula1"},"labName":{"type":"string","defaultValue":"devtest"},"size":{"type":"string","defaultValue":"Standard_DS2_v2"},"userName":{"type":"string","defaultValue":"adm0n"},"password":{"type":"securestring","defaultValue":"[[[VmPassword]]"},"Azure_Pipelines_Deployment_Group_Agent_accountUrl":{"type":"string","defaultValue":"[REDACTED]"},"Azure_Pipelines_Deployment_Group_Agent_projectName":{"type":"string","defaultValue":"[REDACTED]"},"Azure_Pipelines_Deployment_Group_Agent_deploymentGroupName":{"type":"string","defaultValue":"dg"},"Azure_Pipelines_Deployment_Group_Agent_PersonalAccessToken":{"type":"securestring","defaultValue":"[[[PAT]]"},"Azure_Pipelines_Deployment_Group_Agent_deploymentAgentTags":{"type":"string","defaultValue":"WEB, DB"},"Azure_Pipelines_Deployment_Group_Agent_agentInstallPath":{"type":"string","defaultValue":""},"Azure_Pipelines_Deployment_Group_Agent_agentName":{"type":"string","defaultValue":""},"Azure_Pipelines_Deployment_Group_Agent_RunAsAutoLogon":{"type":"bool","defaultValue":false},"Azure_Pipelines_Deployment_Group_Agent_windowsLogonAccount":{"type":"string","defaultValue":"NT AUTHORITY\\\\NetworkService"},"Azure_Pipelines_Deployment_Group_Agent_windowsLogonPassword":{"type":"securestring"}},"variables":{"labSubnetName":"[concat(variables(\'labVirtualNetworkName\'), \'Subnet\')]","labVirtualNetworkId":"[resourceId(\'Microsoft.DevTestLab/labs/virtualnetworks\', parameters(\'labName\'), variables(\'labVirtualNetworkName\'))]","labVirtualNetworkName":"[concat(\'Dtl\', parameters(\'labName\'))]","vmId":"[resourceId (\'Microsoft.DevTestLab/labs/virtualmachines\', parameters(\'labName\'), parameters(\'newVMName\'))]","vmName":"[concat(parameters(\'labName\'), \'/\', parameters(\'newVMName\'))]"},"resources":[{"apiVersion":"2018-10-15-preview","type":"Microsoft.DevTestLab/labs/virtualmachines","name":"[variables(\'vmName\')]","location":"[resourceGroup().location]","properties":{"labVirtualNetworkId":"[variables(\'labVirtualNetworkId\')]","notes":"s001ci","customImageId":"/subscriptions/[REDACTED]/resourcegroups/[REDACTED]/providers/microsoft.devtestlab/labs/[REDACTED]/customimages/s001ci","size":"[parameters(\'size\')]","userName":"[parameters(\'userName\')]","password":"[parameters(\'password\')]","isAuthenticationWithSshKey":false,"artifacts":[{"artifactId":"[resourceId(\'Microsoft.DevTestLab/labs/artifactSources/artifacts\', parameters(\'labName\'), \'public repo\', \'windows-wsl\')]"},{"artifactId":"[resourceId(\'Microsoft.DevTestLab/labs/artifactSources/artifacts\', parameters(\'labName\'), \'public repo\', \'windows-deploymentgroup\')]","parameters":[{"name":"accountUrl","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_accountUrl\')]"},{"name":"projectName","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_projectName\')]"},{"name":"deploymentGroupName","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_deploymentGroupName\')]"},{"name":"PersonalAccessToken","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_PersonalAccessToken\')]"},{"name":"deploymentAgentTags","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_deploymentAgentTags\')]"},{"name":"agentInstallPath","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_agentInstallPath\')]"},{"name":"agentName","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_agentName\')]"},{"name":"RunAsAutoLogon","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_RunAsAutoLogon\')]"},{"name":"windowsLogonAccount","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_windowsLogonAccount\')]"},{"name":"windowsLogonPassword","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_windowsLogonPassword\')]"}]}],"labSubnetName":"[variables(\'labSubnetName\')]","disallowPublicIpAddress":false,"storageType":"Premium","allowClaim":false}}],"outputs":{"labVMId":{"type":"string","value":"[variables(\'vmId\')]"}}},"parameters":{"Azure_Pipelines_Deployment_Group_Agent_windowsLogonPassword":{"value":""},"Azure_Pipelines_Deployment_Group_Agent_windowsLogonAccount":{"value":"NT AUTHORITY\\\\NetworkService"},"Azure_Pipelines_Deployment_Group_Agent_RunAsAutoLogon":{"value":"false"},"Azure_Pipelines_Deployment_Group_Agent_agentName":{"value":""},"Azure_Pipelines_Deployment_Group_Agent_agentInstallPath":{"value":""},"Azure_Pipelines_Deployment_Group_Agent_deploymentAgentTags":{"value":"WEB, DB"},"Azure_Pipelines_Deployment_Group_Agent_PersonalAccessToken":{"value":"[[[PAT]]"},"Azure_Pipelines_Deployment_Group_Agent_deploymentGroupName":{"value":"dg"},"Azure_Pipelines_Deployment_Group_Agent_projectName":{"value":"[REDACTED]"},"Azure_Pipelines_Deployment_Group_Agent_accountUrl":{"value":"[REDACTED]"},"password":{"value":"[[[VmPassword]]"},"userName":{"value":"adm0n"},"size":{"value":"Standard_DS2_v2"},"labName":{"value":"[REDACTED]"},"newVMName":{"value":"test"},"undefined":{"value":"undefined"}},"mode":"Incremental"}}',
2021-05-20T22:36:28.2620142Z      query: undefined,
2021-05-20T22:36:28.2632268Z      formData: undefined,
2021-05-20T22:36:28.2633399Z      withCredentials: false,
2021-05-20T22:36:28.2770530Z      abortSignal: undefined,
2021-05-20T22:36:28.2771192Z      timeout: 0,
2021-05-20T22:36:28.2771812Z      onUploadProgress: undefined,
2021-05-20T22:36:28.2772489Z      onDownloadProgress: undefined,
2021-05-20T22:36:28.2773082Z      proxySettings: undefined,
2021-05-20T22:36:28.2773649Z      keepAlive: undefined,
2021-05-20T22:36:28.2774615Z      agentSettings: undefined,
2021-05-20T22:36:28.2775085Z      operationSpec:
2021-05-20T22:36:28.2775554Z       { httpMethod: 'PUT',
2021-05-20T22:36:28.2775911Z         path:
2021-05-20T22:36:28.2776405Z          'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}',
2021-05-20T22:36:28.2777061Z         urlParameters: [Array],
2021-05-20T22:36:28.2777417Z         queryParameters: [Array],
2021-05-20T22:36:28.2777764Z         headerParameters: [Array],
2021-05-20T22:36:28.2778118Z         requestBody: [Object],
2021-05-20T22:36:28.2778555Z         responses: [Object],
2021-05-20T22:36:28.2778883Z         serializer: [e] } },
2021-05-20T22:36:28.2779259Z   response:
2021-05-20T22:36:28.2779540Z    { body:
2021-05-20T22:36:28.2782117Z       '{"error":{"code":"InvalidTemplate","message":"Deployment template validation failed: \'The template parameters \'undefined\' in the parameters file are not valid; they are not present in the original template and can therefore not be provided at deployment time. The only supported parameters for this template are \'newVMName, labName, size, userName, password, Azure_Pipelines_Deployment_Group_Agent_accountUrl, Azure_Pipelines_Deployment_Group_Agent_projectName, Azure_Pipelines_Deployment_Group_Agent_deploymentGroupName, Azure_Pipelines_Deployment_Group_Agent_PersonalAccessToken, Azure_Pipelines_Deployment_Group_Agent_deploymentAgentTags, Azure_Pipelines_Deployment_Group_Agent_agentInstallPath, Azure_Pipelines_Deployment_Group_Agent_agentName, Azure_Pipelines_Deployment_Group_Agent_RunAsAutoLogon, Azure_Pipelines_Deployment_Group_Agent_windowsLogonAccount, Azure_Pipelines_Deployment_Group_Agent_windowsLogonPassword\'. Please see https://aka.ms/arm-deploy/#parameter-file for usage details.\'.","additionalInfo":[{"type":"TemplateViolation","info":{"lineNumber":0,"linePosition":0,"path":""}}]}}',
2021-05-20T22:36:28.2785005Z      headers: e { _headersMap: [Object] },
2021-05-20T22:36:28.2785368Z      status: 400 },
2021-05-20T22:36:28.2785656Z   body:
2021-05-20T22:36:28.2785938Z    { code: 'InvalidTemplate',
2021-05-20T22:36:28.2786247Z      message:
2021-05-20T22:36:28.2788320Z       'Deployment template validation failed: \'The template parameters \'undefined\' in the parameters file are not valid; they are not present in the original template and can therefore not be provided at deployment time. The only supported parameters for this template are \'newVMName, labName, size, userName, password, Azure_Pipelines_Deployment_Group_Agent_accountUrl, Azure_Pipelines_Deployment_Group_Agent_projectName, Azure_Pipelines_Deployment_Group_Agent_deploymentGroupName, Azure_Pipelines_Deployment_Group_Agent_PersonalAccessToken, Azure_Pipelines_Deployment_Group_Agent_deploymentAgentTags, Azure_Pipelines_Deployment_Group_Agent_agentInstallPath, Azure_Pipelines_Deployment_Group_Agent_agentName, Azure_Pipelines_Deployment_Group_Agent_RunAsAutoLogon, Azure_Pipelines_Deployment_Group_Agent_windowsLogonAccount, Azure_Pipelines_Deployment_Group_Agent_windowsLogonPassword\'. Please see https://aka.ms/arm-deploy/#parameter-file for usage details.\'.',
2021-05-20T22:36:28.2790528Z      additionalInfo: { '0': [Object] } } }
2021-05-20T22:36:28.2792240Z ##[debug]task result: Failed
2021-05-20T22:36:28.2825056Z ##[error]Error => code: 'InvalidTemplate'; message = 'Deployment template validation failed: 'The template parameters 'undefined' in the parameters file are not valid; they are not present in the original template and can therefore not be provided at deployment time. The only supported parameters for this template are 'newVMName, labName, size, userName, password, Azure_Pipelines_Deployment_Group_Agent_accountUrl, Azure_Pipelines_Deployment_Group_Agent_projectName, Azure_Pipelines_Deployment_Group_Agent_deploymentGroupName, Azure_Pipelines_Deployment_Group_Agent_PersonalAccessToken, Azure_Pipelines_Deployment_Group_Agent_deploymentAgentTags, Azure_Pipelines_Deployment_Group_Agent_agentInstallPath, Azure_Pipelines_Deployment_Group_Agent_agentName, Azure_Pipelines_Deployment_Group_Agent_RunAsAutoLogon, Azure_Pipelines_Deployment_Group_Agent_windowsLogonAccount, Azure_Pipelines_Deployment_Group_Agent_windowsLogonPassword'. Please see https://aka.ms/arm-deploy/#parameter-file for usage details.'.'
2021-05-20T22:36:28.2838760Z ##[debug]Processed: ##vso[task.issue type=error;]Error => code: 'InvalidTemplate'; message = 'Deployment template validation failed: 'The template parameters 'undefined' in the parameters file are not valid; they are not present in the original template and can therefore not be provided at deployment time. The only supported parameters for this template are 'newVMName, labName, size, userName, password, Azure_Pipelines_Deployment_Group_Agent_accountUrl, Azure_Pipelines_Deployment_Group_Agent_projectName, Azure_Pipelines_Deployment_Group_Agent_deploymentGroupName, Azure_Pipelines_Deployment_Group_Agent_PersonalAccessToken, Azure_Pipelines_Deployment_Group_Agent_deploymentAgentTags, Azure_Pipelines_Deployment_Group_Agent_agentInstallPath, Azure_Pipelines_Deployment_Group_Agent_agentName, Azure_Pipelines_Deployment_Group_Agent_RunAsAutoLogon, Azure_Pipelines_Deployment_Group_Agent_windowsLogonAccount, Azure_Pipelines_Deployment_Group_Agent_windowsLogonPassword'. Please see https://aka.ms/arm-deploy/#parameter-file for usage details.'.'
2021-05-20T22:36:28.2850830Z ##[debug]Processed: ##vso[task.complete result=Failed;]Error => code: 'InvalidTemplate'; message = 'Deployment template validation failed: 'The template parameters 'undefined' in the parameters file are not valid; they are not present in the original template and can therefore not be provided at deployment time. The only supported parameters for this template are 'newVMName, labName, size, userName, password, Azure_Pipelines_Deployment_Group_Agent_accountUrl, Azure_Pipelines_Deployment_Group_Agent_projectName, Azure_Pipelines_Deployment_Group_Agent_deploymentGroupName, Azure_Pipelines_Deployment_Group_Agent_PersonalAccessToken, Azure_Pipelines_Deployment_Group_Agent_deploymentAgentTags, Azure_Pipelines_Deployment_Group_Agent_agentInstallPath, Azure_Pipelines_Deployment_Group_Agent_agentName, Azure_Pipelines_Deployment_Group_Agent_RunAsAutoLogon, Azure_Pipelines_Deployment_Group_Agent_windowsLogonAccount, Azure_Pipelines_Deployment_Group_Agent_windowsLogonPassword'. Please see https://aka.ms/arm-deploy/#parameter-file for usage details.'.'
2021-05-20T22:36:28.2862394Z ##[section]Finishing: Create Azure DevTest Labs VM

The ARM Template from powershell works flawless

As you can see, the task adds undefined parameter.

,"labName":{"value":"[REDACTED]"},"newVMName":{"value":"test"},"undefined":{"value":"undefined"}},"mode":"Incremental"}}',
@sbugalski sbugalski changed the title The template parameters 'undefined' in the parameters file are not valid The template parameters 'undefined' in the parameters file are not valid when using Create Azure DevTest Labs VM May 20, 2021
@leovms
Copy link
Contributor

leovms commented May 25, 2021

@sbugalski, thank you for the details. Let me take a look and try to repro. It would help if you can also share the parameters file you used.

@leovms
Copy link
Contributor

leovms commented May 25, 2021

@sbugalski, I have tried to repro your case, but I cannot get it to fail. When you get a chance, please provide the parameters file so I can see if I can repro the case with it. Thanks.

@sbugalski
Copy link
Author

sbugalski commented May 26, 2021

@leovms - it fails for me even after modifying template. Please see attached ARM templates and parameters (had to save as .txt)

vm.txt
vm.parameters.txt

@leovms
Copy link
Contributor

leovms commented May 26, 2021

@sbugalski, can you try changing the type for the respective parameters from bool to string, but still pass the boolean value as you have it? Let me know what you get from that. It seems that there's an issue if you pass bool parameters, even if I try to force them to boolean using the bool() function.

"disallowPublicIpAddress": {
  "type": "string",
  "defaultValue": false
},
"allowClaim": {
  "type": "string",
  "defaultValue": true
}

@leovms
Copy link
Contributor

leovms commented May 26, 2021

@sbugalski, I'm going to try a different approach to try to repro your scenario. Do let me know if the above helps in any way.

@leovms
Copy link
Contributor

leovms commented May 26, 2021

@sbugalski, I tried another approach to repro the undefined scenario. I am not able to do it. However, the error I did get when I used your template was the issue with bool vs string. So, changing the type from bool to string and leaving everything else as is, worked for me.

One other thing you can try is to add a new instance of the task. Can you do that or just let me know if you did that already?

@sbugalski
Copy link
Author

@leovms - my template works with well known ARM Deployment scripts or tasks.

I had exported an ARM template, so it's clean export, without any changes and still fails with undefined parameter issue.
generated.txt

2021-05-27T01:25:24.8367597Z ##[section]Starting: Create Azure DevTest Labs VM
2021-05-27T01:25:24.8486342Z ==============================================================================
2021-05-27T01:25:24.8486750Z Task         : Azure DevTest Labs Create VM
2021-05-27T01:25:24.8487076Z Description  : Create an Azure DevTest Labs VM
2021-05-27T01:25:24.8487336Z Version      : 3.0.16
2021-05-27T01:25:24.8487601Z Author       : Microsoft Corporation
2021-05-27T01:25:24.8487935Z Help         : Creates a virtual machine in the selected lab.
2021-05-27T01:25:24.8488319Z ==============================================================================
2021-05-27T01:25:25.4968252Z Starting Azure DevTest Labs Create VM Task
2021-05-27T01:25:26.3774897Z Task called with the following parameters:
2021-05-27T01:25:26.3776589Z   ConnectedServiceName = df1478a2-d193-4a7b-925a-3b5c16993ed0
2021-05-27T01:25:26.3778038Z   LabId = /subscriptions/7666950f-9253-4781-be27-89727c793e23/resourceGroups/devtestlabs/providers/Microsoft.DevTestLab/labs/devtestlabs
2021-05-27T01:25:26.3779398Z   VirtualMachineName = test9
2021-05-27T01:25:26.3780301Z   TemplateFile = D:\a\1\s\arm\generated.json
2021-05-27T01:25:26.3781188Z   ParametersFile = D:\a\1\s
2021-05-27T01:25:26.3781980Z   FailOnArtifactError = true
2021-05-27T01:25:26.3782753Z   RetryOnFailure = false
2021-05-27T01:25:26.3783486Z   RetryCount = 0
2021-05-27T01:25:26.3784259Z   DeleteFailedLabVMBeforeRetry = false
2021-05-27T01:25:26.3785158Z   DeleteFailedDeploymentBeforeRetry = false
2021-05-27T01:25:26.3786021Z   AppendRetryNumberToVMName = false
2021-05-27T01:25:26.3786851Z   WaitMinutesForApplyArtifacts = 0
2021-05-27T01:25:26.3788374Z Creating Virtual Machine in Lab 'devtestlabs' under Resource Group 'devtestlabs'.
2021-05-27T01:25:26.3814167Z Invoking deployment with the following parameters:
2021-05-27T01:25:26.3815000Z   DeploymentName = Dtltfk2p1ds8
2021-05-27T01:25:26.3815698Z   ResourceGroupName = devtestlabs
2021-05-27T01:25:26.3816371Z   LabName = devtestlabs
2021-05-27T01:25:26.3817023Z   VmName = test9
2021-05-27T01:25:26.3817712Z   TemplateFile = D:\a\1\s\arm\generated.json
2021-05-27T01:25:26.7527610Z { Error: Deployment template validation failed: 'The template parameters 'undefined' in the parameters file are not valid; they are not present in the original template and can therefore not be provided at deployment time. The only supported parameters for this template are 'newVMName, labName, size, userName, password, Azure_Pipelines_Deployment_Group_Agent_accountUrl, Azure_Pipelines_Deployment_Group_Agent_projectName, Azure_Pipelines_Deployment_Group_Agent_deploymentGroupName, Azure_Pipelines_Deployment_Group_Agent_PersonalAccessToken, Azure_Pipelines_Deployment_Group_Agent_deploymentAgentTags, Azure_Pipelines_Deployment_Group_Agent_agentInstallPath, Azure_Pipelines_Deployment_Group_Agent_agentName, Azure_Pipelines_Deployment_Group_Agent_RunAsAutoLogon, Azure_Pipelines_Deployment_Group_Agent_windowsLogonAccount, Azure_Pipelines_Deployment_Group_Agent_windowsLogonPassword'. Please see https://aka.ms/arm-deploy/#parameter-file for usage details.'.
2021-05-27T01:25:26.7530651Z     at new t (D:\a\_tasks\AzureDevTestLabsCreateVM_65b23b71-d518-4074-8370-cf84ebfc909b\3.0.16\task.js:2:369869)
2021-05-27T01:25:26.7531472Z     at D:\a\_tasks\AzureDevTestLabsCreateVM_65b23b71-d518-4074-8370-cf84ebfc909b\3.0.16\task.js:2:359495
2021-05-27T01:25:26.7532455Z     at process._tickCallback (internal/process/next_tick.js:68:7)
2021-05-27T01:25:26.7532945Z   code: 'InvalidTemplate',
2021-05-27T01:25:26.7533310Z   statusCode: 400,
2021-05-27T01:25:26.7533638Z   request:
2021-05-27T01:25:26.7533924Z    e {
2021-05-27T01:25:26.7534388Z      streamResponseBody: false,
2021-05-27T01:25:26.7534761Z      url:
2021-05-27T01:25:26.7535439Z       'https://management.azure.com/subscriptions/7666950f-9253-4781-be27-89727c793e23/resourcegroups/devtestlabs/providers/Microsoft.Resources/deployments/Dtltfk2p1ds8?api-version=2020-06-01',
2021-05-27T01:25:26.7536119Z      method: 'PUT',
2021-05-27T01:25:26.7538136Z      headers: e { _headersMap: [Object] },
2021-05-27T01:25:26.7538572Z      body:
2021-05-27T01:25:26.7548448Z       '{"properties":{"template":{"$schema":"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json","contentVersion":"1.0.0.0","parameters":{"newVMName":{"type":"string","defaultValue":"s001"},"labName":{"type":"string","defaultValue":"devtestlabs"},"size":{"type":"string","defaultValue":"Standard_B2ms"},"userName":{"type":"string","defaultValue":"s"},"password":{"type":"string","defaultValue":"[[[vmPassword]]"},"Azure_Pipelines_Deployment_Group_Agent_accountUrl":{"type":"string","defaultValue":"https://dev.azure.com/testowamigracja"},"Azure_Pipelines_Deployment_Group_Agent_projectName":{"type":"string","defaultValue":"devtest"},"Azure_Pipelines_Deployment_Group_Agent_deploymentGroupName":{"type":"string","defaultValue":"dg"},"Azure_Pipelines_Deployment_Group_Agent_PersonalAccessToken":{"type":"string","defaultValue":"[[[PAT]]"},"Azure_Pipelines_Deployment_Group_Agent_deploymentAgentTags":{"type":"string","defaultValue":""},"Azure_Pipelines_Deployment_Group_Agent_agentInstallPath":{"type":"string","defaultValue":""},"Azure_Pipelines_Deployment_Group_Agent_agentName":{"type":"string","defaultValue":""},"Azure_Pipelines_Deployment_Group_Agent_RunAsAutoLogon":{"type":"bool","defaultValue":false},"Azure_Pipelines_Deployment_Group_Agent_windowsLogonAccount":{"type":"string","defaultValue":"NT AUTHORITY\\\\NetworkService"},"Azure_Pipelines_Deployment_Group_Agent_windowsLogonPassword":{"type":"securestring","defaultValue":""}},"variables":{"labSubnetName":"subnet-devtestlabs","labVirtualNetworkId":"[resourceId(\'Microsoft.DevTestLab/labs/virtualnetworks\', parameters(\'labName\'), variables(\'labVirtualNetworkName\'))]","labVirtualNetworkName":"vnet-devtestlabs","vmId":"[resourceId (\'Microsoft.DevTestLab/labs/virtualmachines\', parameters(\'labName\'), parameters(\'newVMName\'))]","vmName":"[concat(parameters(\'labName\'), \'/\', parameters(\'newVMName\'))]"},"resources":[{"apiVersion":"2018-10-15-preview","type":"Microsoft.DevTestLab/labs/virtualmachines","name":"[variables(\'vmName\')]","location":"[resourceGroup().location]","properties":{"labVirtualNetworkId":"[variables(\'labVirtualNetworkId\')]","notes":"image-v2ci","customImageId":"/subscriptions/7666950f-9253-4781-be27-89727c793e23/resourcegroups/devtestlabs/providers/microsoft.devtestlab/labs/devtestlabs/customimages/image-v2ci","size":"[parameters(\'size\')]","userName":"[parameters(\'userName\')]","password":"[parameters(\'password\')]","isAuthenticationWithSshKey":false,"artifacts":[{"artifactId":"[resourceId(\'Microsoft.DevTestLab/labs/artifactSources/artifacts\', parameters(\'labName\'), \'public repo\', \'windows-deploymentgroup\')]","parameters":[{"name":"accountUrl","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_accountUrl\')]"},{"name":"projectName","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_projectName\')]"},{"name":"deploymentGroupName","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_deploymentGroupName\')]"},{"name":"PersonalAccessToken","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_PersonalAccessToken\')]"},{"name":"deploymentAgentTags","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_deploymentAgentTags\')]"},{"name":"agentInstallPath","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_agentInstallPath\')]"},{"name":"agentName","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_agentName\')]"},{"name":"RunAsAutoLogon","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_RunAsAutoLogon\')]"},{"name":"windowsLogonAccount","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_windowsLogonAccount\')]"},{"name":"windowsLogonPassword","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_windowsLogonPassword\')]"}]}],"labSubnetName":"[variables(\'labSubnetName\')]","disallowPublicIpAddress":false,"storageType":"Premium","allowClaim":false}}],"outputs":{"labVMId":{"type":"string","value":"[variables(\'vmId\')]"}}},"parameters":{"newVMName":{"value":"test9"},"labName":{"value":"devtestlabs"},"undefined":{"value":"undefined"}},"mode":"Incremental"}}',
2021-05-27T01:25:26.7559274Z      query: undefined,
2021-05-27T01:25:26.7559706Z      formData: undefined,
2021-05-27T01:25:26.7560110Z      withCredentials: false,
2021-05-27T01:25:26.7560514Z      abortSignal: undefined,
2021-05-27T01:25:26.7560904Z      timeout: 0,
2021-05-27T01:25:26.7561349Z      onUploadProgress: undefined,
2021-05-27T01:25:26.7561778Z      onDownloadProgress: undefined,
2021-05-27T01:25:26.7562200Z      proxySettings: undefined,
2021-05-27T01:25:26.7562593Z      keepAlive: undefined,
2021-05-27T01:25:26.7562956Z      agentSettings: undefined,
2021-05-27T01:25:26.7563343Z      operationSpec:
2021-05-27T01:25:26.7563689Z       { httpMethod: 'PUT',
2021-05-27T01:25:26.7564071Z         path:
2021-05-27T01:25:26.7564582Z          'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}',
2021-05-27T01:25:26.7565190Z         urlParameters: [Array],
2021-05-27T01:25:26.7565618Z         queryParameters: [Array],
2021-05-27T01:25:26.7566015Z         headerParameters: [Array],
2021-05-27T01:25:26.7566427Z         requestBody: [Object],
2021-05-27T01:25:26.7566804Z         responses: [Object],
2021-05-27T01:25:26.7567208Z         serializer: [e] } },
2021-05-27T01:25:26.7567596Z   response:
2021-05-27T01:25:26.7567899Z    { body:
2021-05-27T01:25:26.7570656Z       '{"error":{"code":"InvalidTemplate","message":"Deployment template validation failed: \'The template parameters \'undefined\' in the parameters file are not valid; they are not present in the original template and can therefore not be provided at deployment time. The only supported parameters for this template are \'newVMName, labName, size, userName, password, Azure_Pipelines_Deployment_Group_Agent_accountUrl, Azure_Pipelines_Deployment_Group_Agent_projectName, Azure_Pipelines_Deployment_Group_Agent_deploymentGroupName, Azure_Pipelines_Deployment_Group_Agent_PersonalAccessToken, Azure_Pipelines_Deployment_Group_Agent_deploymentAgentTags, Azure_Pipelines_Deployment_Group_Agent_agentInstallPath, Azure_Pipelines_Deployment_Group_Agent_agentName, Azure_Pipelines_Deployment_Group_Agent_RunAsAutoLogon, Azure_Pipelines_Deployment_Group_Agent_windowsLogonAccount, Azure_Pipelines_Deployment_Group_Agent_windowsLogonPassword\'. Please see https://aka.ms/arm-deploy/#parameter-file for usage details.\'.","additionalInfo":[{"type":"TemplateViolation","info":{"lineNumber":0,"linePosition":0,"path":""}}]}}',
2021-05-27T01:25:26.7573607Z      headers: e { _headersMap: [Object] },
2021-05-27T01:25:26.7573995Z      status: 400 },
2021-05-27T01:25:26.7574300Z   body:
2021-05-27T01:25:26.7574666Z    { code: 'InvalidTemplate',
2021-05-27T01:25:26.7574996Z      message:
2021-05-27T01:25:26.7577412Z       'Deployment template validation failed: \'The template parameters \'undefined\' in the parameters file are not valid; they are not present in the original template and can therefore not be provided at deployment time. The only supported parameters for this template are \'newVMName, labName, size, userName, password, Azure_Pipelines_Deployment_Group_Agent_accountUrl, Azure_Pipelines_Deployment_Group_Agent_projectName, Azure_Pipelines_Deployment_Group_Agent_deploymentGroupName, Azure_Pipelines_Deployment_Group_Agent_PersonalAccessToken, Azure_Pipelines_Deployment_Group_Agent_deploymentAgentTags, Azure_Pipelines_Deployment_Group_Agent_agentInstallPath, Azure_Pipelines_Deployment_Group_Agent_agentName, Azure_Pipelines_Deployment_Group_Agent_RunAsAutoLogon, Azure_Pipelines_Deployment_Group_Agent_windowsLogonAccount, Azure_Pipelines_Deployment_Group_Agent_windowsLogonPassword\'. Please see https://aka.ms/arm-deploy/#parameter-file for usage details.\'.',
2021-05-27T01:25:26.7579748Z      additionalInfo: { '0': [Object] } } }
2021-05-27T01:25:26.7617027Z ##[error]Error => code: 'InvalidTemplate'; message = 'Deployment template validation failed: 'The template parameters 'undefined' in the parameters file are not valid; they are not present in the original template and can therefore not be provided at deployment time. The only supported parameters for this template are 'newVMName, labName, size, userName, password, Azure_Pipelines_Deployment_Group_Agent_accountUrl, Azure_Pipelines_Deployment_Group_Agent_projectName, Azure_Pipelines_Deployment_Group_Agent_deploymentGroupName, Azure_Pipelines_Deployment_Group_Agent_PersonalAccessToken, Azure_Pipelines_Deployment_Group_Agent_deploymentAgentTags, Azure_Pipelines_Deployment_Group_Agent_agentInstallPath, Azure_Pipelines_Deployment_Group_Agent_agentName, Azure_Pipelines_Deployment_Group_Agent_RunAsAutoLogon, Azure_Pipelines_Deployment_Group_Agent_windowsLogonAccount, Azure_Pipelines_Deployment_Group_Agent_windowsLogonPassword'. Please see https://aka.ms/arm-deploy/#parameter-file for usage details.'.'
2021-05-27T01:25:26.8079729Z ##[section]Finishing: Create Azure DevTest Labs VM

also it woks with ARM whatif.


❯ New-AzResourceGroupDeployment -Name "noparams1" -ResourceGroupName "devtestlabs" -TemplateFile .\generated.txt -whatif

Note: The result may contain false positive predictions (noise).
You can help us improve the accuracy of the result by opening an issue here: https://aka.ms/WhatIfIssues.

Resource and property changes are indicated with these symbols:
  + Create
  * Ignore

The deployment will update the following scope:

Scope: /subscriptions/7666950f-9253-4781-be27-89727c793e23/resourceGroups/devtestlabs

  + Microsoft.DevTestLab/labs/devtestlabs/virtualmachines/s001 [2018-10-15-preview]

      apiVersion:                            "2018-10-15-preview"
      id:                                    "/subscriptions/7666950f-9253-4781-be27-89727c793e23/resourceGroups/devtestlabs/providers/Microsoft.DevTestLab/labs/devtestlabs/virtualmachines/s001"
      location:                              "westeurope"
      name:                                  "s001"
      properties.allowClaim:                 false
      properties.artifacts: [
        0:

          artifactId: "/subscriptions/7666950f-9253-4781-be27-89727c793e23/resourceGroups/devtestlabs/providers/Microsoft.DevTestLab/labs/devtestlabs/artifactSources/public repo/artifacts/windows-deploymentgroup"
          parameters: [
            0:

              name:  "accountUrl"
              value: "https://dev.azure.com/testowamigracja"

            1:

              name:  "projectName"
              value: "devtest"

            2:

              name:  "deploymentGroupName"
              value: "dg"

            3:

              name:  "PersonalAccessToken"
              value: "[[PAT]]"

            4:

              name: "deploymentAgentTags"

            5:

              name: "agentInstallPath"

            6:

              name: "agentName"

            7:

              name:  "RunAsAutoLogon"
              value: false

            8:

              name:  "windowsLogonAccount"
              value: "NT AUTHORITY\NetworkService"

            9:

              name:  "windowsLogonPassword"
              value: "*******"

          ]

      ]
      properties.customImageId:              "/subscriptions/7666950f-9253-4781-be27-89727c793e23/resourcegroups/devtestlabs/providers/microsoft.devtestlab/labs/devtestlabs/customimages/image-v2ci"
      properties.disallowPublicIpAddress:    false
      properties.isAuthenticationWithSshKey: false
      properties.labSubnetName:              "subnet-devtestlabs"
      properties.labVirtualNetworkId:        "/subscriptions/7666950f-9253-4781-be27-89727c793e23/resourceGroups/devtestlabs/providers/Microsoft.DevTestLab/labs/devtestlabs/virtualnetworks/vnet-devtestlabs"
      properties.notes:                      "image-v2ci"
      properties.password:                   "*******"
      properties.size:                       "Standard_B2ms"
      properties.storageType:                "Premium"
      properties.userName:                   "s"
      type:                                  "Microsoft.DevTestLab/labs/virtualmachines"

  * Microsoft.Compute/images/image-v2ci
  * Microsoft.DevTestLab/labs/devtestlabs
  * Microsoft.DevTestLab/labs/devtestlabs/virtualMachines/image-v2
  * Microsoft.DevTestLab/labs/devtestlabs/virtualMachines/Release-29
  * Microsoft.KeyVault/vaults/devtestlabs7264
  * Microsoft.KeyVault/vaults/devtestlabs73364913
  * Microsoft.Network/virtualNetworks/vnet-devtestlabs
  * Microsoft.Storage/storageAccounts/adevtestlabs2026

Resource changes: 1 to create, 8 to ignore.

@sbugalski
Copy link
Author

@leovms - my template works with well known ARM Deployment scripts or tasks.

I had exported an ARM template, so it's clean export, without any changes and still fails with undefined parameter issue. ARM template attached.
generated.txt

2021-05-27T01:25:24.8367597Z ##[section]Starting: Create Azure DevTest Labs VM
2021-05-27T01:25:24.8486342Z ==============================================================================
2021-05-27T01:25:24.8486750Z Task         : Azure DevTest Labs Create VM
2021-05-27T01:25:24.8487076Z Description  : Create an Azure DevTest Labs VM
2021-05-27T01:25:24.8487336Z Version      : 3.0.16
2021-05-27T01:25:24.8487601Z Author       : Microsoft Corporation
2021-05-27T01:25:24.8487935Z Help         : Creates a virtual machine in the selected lab.
2021-05-27T01:25:24.8488319Z ==============================================================================
2021-05-27T01:25:25.4968252Z Starting Azure DevTest Labs Create VM Task
2021-05-27T01:25:26.3774897Z Task called with the following parameters:
2021-05-27T01:25:26.3776589Z   ConnectedServiceName = df1478a2-d193-4a7b-925a-3b5c16993ed0
2021-05-27T01:25:26.3778038Z   LabId = /subscriptions/7666950f-9253-4781-be27-89727c793e23/resourceGroups/devtestlabs/providers/Microsoft.DevTestLab/labs/devtestlabs
2021-05-27T01:25:26.3779398Z   VirtualMachineName = test9
2021-05-27T01:25:26.3780301Z   TemplateFile = D:\a\1\s\arm\generated.json
2021-05-27T01:25:26.3781188Z   ParametersFile = D:\a\1\s
2021-05-27T01:25:26.3781980Z   FailOnArtifactError = true
2021-05-27T01:25:26.3782753Z   RetryOnFailure = false
2021-05-27T01:25:26.3783486Z   RetryCount = 0
2021-05-27T01:25:26.3784259Z   DeleteFailedLabVMBeforeRetry = false
2021-05-27T01:25:26.3785158Z   DeleteFailedDeploymentBeforeRetry = false
2021-05-27T01:25:26.3786021Z   AppendRetryNumberToVMName = false
2021-05-27T01:25:26.3786851Z   WaitMinutesForApplyArtifacts = 0
2021-05-27T01:25:26.3788374Z Creating Virtual Machine in Lab 'devtestlabs' under Resource Group 'devtestlabs'.
2021-05-27T01:25:26.3814167Z Invoking deployment with the following parameters:
2021-05-27T01:25:26.3815000Z   DeploymentName = Dtltfk2p1ds8
2021-05-27T01:25:26.3815698Z   ResourceGroupName = devtestlabs
2021-05-27T01:25:26.3816371Z   LabName = devtestlabs
2021-05-27T01:25:26.3817023Z   VmName = test9
2021-05-27T01:25:26.3817712Z   TemplateFile = D:\a\1\s\arm\generated.json
2021-05-27T01:25:26.7527610Z { Error: Deployment template validation failed: 'The template parameters 'undefined' in the parameters file are not valid; they are not present in the original template and can therefore not be provided at deployment time. The only supported parameters for this template are 'newVMName, labName, size, userName, password, Azure_Pipelines_Deployment_Group_Agent_accountUrl, Azure_Pipelines_Deployment_Group_Agent_projectName, Azure_Pipelines_Deployment_Group_Agent_deploymentGroupName, Azure_Pipelines_Deployment_Group_Agent_PersonalAccessToken, Azure_Pipelines_Deployment_Group_Agent_deploymentAgentTags, Azure_Pipelines_Deployment_Group_Agent_agentInstallPath, Azure_Pipelines_Deployment_Group_Agent_agentName, Azure_Pipelines_Deployment_Group_Agent_RunAsAutoLogon, Azure_Pipelines_Deployment_Group_Agent_windowsLogonAccount, Azure_Pipelines_Deployment_Group_Agent_windowsLogonPassword'. Please see https://aka.ms/arm-deploy/#parameter-file for usage details.'.
2021-05-27T01:25:26.7530651Z     at new t (D:\a\_tasks\AzureDevTestLabsCreateVM_65b23b71-d518-4074-8370-cf84ebfc909b\3.0.16\task.js:2:369869)
2021-05-27T01:25:26.7531472Z     at D:\a\_tasks\AzureDevTestLabsCreateVM_65b23b71-d518-4074-8370-cf84ebfc909b\3.0.16\task.js:2:359495
2021-05-27T01:25:26.7532455Z     at process._tickCallback (internal/process/next_tick.js:68:7)
2021-05-27T01:25:26.7532945Z   code: 'InvalidTemplate',
2021-05-27T01:25:26.7533310Z   statusCode: 400,
2021-05-27T01:25:26.7533638Z   request:
2021-05-27T01:25:26.7533924Z    e {
2021-05-27T01:25:26.7534388Z      streamResponseBody: false,
2021-05-27T01:25:26.7534761Z      url:
2021-05-27T01:25:26.7535439Z       'https://management.azure.com/subscriptions/7666950f-9253-4781-be27-89727c793e23/resourcegroups/devtestlabs/providers/Microsoft.Resources/deployments/Dtltfk2p1ds8?api-version=2020-06-01',
2021-05-27T01:25:26.7536119Z      method: 'PUT',
2021-05-27T01:25:26.7538136Z      headers: e { _headersMap: [Object] },
2021-05-27T01:25:26.7538572Z      body:
2021-05-27T01:25:26.7548448Z       '{"properties":{"template":{"$schema":"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json","contentVersion":"1.0.0.0","parameters":{"newVMName":{"type":"string","defaultValue":"s001"},"labName":{"type":"string","defaultValue":"devtestlabs"},"size":{"type":"string","defaultValue":"Standard_B2ms"},"userName":{"type":"string","defaultValue":"s"},"password":{"type":"string","defaultValue":"[[[vmPassword]]"},"Azure_Pipelines_Deployment_Group_Agent_accountUrl":{"type":"string","defaultValue":"https://dev.azure.com/testowamigracja"},"Azure_Pipelines_Deployment_Group_Agent_projectName":{"type":"string","defaultValue":"devtest"},"Azure_Pipelines_Deployment_Group_Agent_deploymentGroupName":{"type":"string","defaultValue":"dg"},"Azure_Pipelines_Deployment_Group_Agent_PersonalAccessToken":{"type":"string","defaultValue":"[[[PAT]]"},"Azure_Pipelines_Deployment_Group_Agent_deploymentAgentTags":{"type":"string","defaultValue":""},"Azure_Pipelines_Deployment_Group_Agent_agentInstallPath":{"type":"string","defaultValue":""},"Azure_Pipelines_Deployment_Group_Agent_agentName":{"type":"string","defaultValue":""},"Azure_Pipelines_Deployment_Group_Agent_RunAsAutoLogon":{"type":"bool","defaultValue":false},"Azure_Pipelines_Deployment_Group_Agent_windowsLogonAccount":{"type":"string","defaultValue":"NT AUTHORITY\\\\NetworkService"},"Azure_Pipelines_Deployment_Group_Agent_windowsLogonPassword":{"type":"securestring","defaultValue":""}},"variables":{"labSubnetName":"subnet-devtestlabs","labVirtualNetworkId":"[resourceId(\'Microsoft.DevTestLab/labs/virtualnetworks\', parameters(\'labName\'), variables(\'labVirtualNetworkName\'))]","labVirtualNetworkName":"vnet-devtestlabs","vmId":"[resourceId (\'Microsoft.DevTestLab/labs/virtualmachines\', parameters(\'labName\'), parameters(\'newVMName\'))]","vmName":"[concat(parameters(\'labName\'), \'/\', parameters(\'newVMName\'))]"},"resources":[{"apiVersion":"2018-10-15-preview","type":"Microsoft.DevTestLab/labs/virtualmachines","name":"[variables(\'vmName\')]","location":"[resourceGroup().location]","properties":{"labVirtualNetworkId":"[variables(\'labVirtualNetworkId\')]","notes":"image-v2ci","customImageId":"/subscriptions/7666950f-9253-4781-be27-89727c793e23/resourcegroups/devtestlabs/providers/microsoft.devtestlab/labs/devtestlabs/customimages/image-v2ci","size":"[parameters(\'size\')]","userName":"[parameters(\'userName\')]","password":"[parameters(\'password\')]","isAuthenticationWithSshKey":false,"artifacts":[{"artifactId":"[resourceId(\'Microsoft.DevTestLab/labs/artifactSources/artifacts\', parameters(\'labName\'), \'public repo\', \'windows-deploymentgroup\')]","parameters":[{"name":"accountUrl","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_accountUrl\')]"},{"name":"projectName","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_projectName\')]"},{"name":"deploymentGroupName","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_deploymentGroupName\')]"},{"name":"PersonalAccessToken","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_PersonalAccessToken\')]"},{"name":"deploymentAgentTags","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_deploymentAgentTags\')]"},{"name":"agentInstallPath","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_agentInstallPath\')]"},{"name":"agentName","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_agentName\')]"},{"name":"RunAsAutoLogon","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_RunAsAutoLogon\')]"},{"name":"windowsLogonAccount","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_windowsLogonAccount\')]"},{"name":"windowsLogonPassword","value":"[parameters(\'Azure_Pipelines_Deployment_Group_Agent_windowsLogonPassword\')]"}]}],"labSubnetName":"[variables(\'labSubnetName\')]","disallowPublicIpAddress":false,"storageType":"Premium","allowClaim":false}}],"outputs":{"labVMId":{"type":"string","value":"[variables(\'vmId\')]"}}},"parameters":{"newVMName":{"value":"test9"},"labName":{"value":"devtestlabs"},"undefined":{"value":"undefined"}},"mode":"Incremental"}}',
2021-05-27T01:25:26.7559274Z      query: undefined,
2021-05-27T01:25:26.7559706Z      formData: undefined,
2021-05-27T01:25:26.7560110Z      withCredentials: false,
2021-05-27T01:25:26.7560514Z      abortSignal: undefined,
2021-05-27T01:25:26.7560904Z      timeout: 0,
2021-05-27T01:25:26.7561349Z      onUploadProgress: undefined,
2021-05-27T01:25:26.7561778Z      onDownloadProgress: undefined,
2021-05-27T01:25:26.7562200Z      proxySettings: undefined,
2021-05-27T01:25:26.7562593Z      keepAlive: undefined,
2021-05-27T01:25:26.7562956Z      agentSettings: undefined,
2021-05-27T01:25:26.7563343Z      operationSpec:
2021-05-27T01:25:26.7563689Z       { httpMethod: 'PUT',
2021-05-27T01:25:26.7564071Z         path:
2021-05-27T01:25:26.7564582Z          'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}',
2021-05-27T01:25:26.7565190Z         urlParameters: [Array],
2021-05-27T01:25:26.7565618Z         queryParameters: [Array],
2021-05-27T01:25:26.7566015Z         headerParameters: [Array],
2021-05-27T01:25:26.7566427Z         requestBody: [Object],
2021-05-27T01:25:26.7566804Z         responses: [Object],
2021-05-27T01:25:26.7567208Z         serializer: [e] } },
2021-05-27T01:25:26.7567596Z   response:
2021-05-27T01:25:26.7567899Z    { body:
2021-05-27T01:25:26.7570656Z       '{"error":{"code":"InvalidTemplate","message":"Deployment template validation failed: \'The template parameters \'undefined\' in the parameters file are not valid; they are not present in the original template and can therefore not be provided at deployment time. The only supported parameters for this template are \'newVMName, labName, size, userName, password, Azure_Pipelines_Deployment_Group_Agent_accountUrl, Azure_Pipelines_Deployment_Group_Agent_projectName, Azure_Pipelines_Deployment_Group_Agent_deploymentGroupName, Azure_Pipelines_Deployment_Group_Agent_PersonalAccessToken, Azure_Pipelines_Deployment_Group_Agent_deploymentAgentTags, Azure_Pipelines_Deployment_Group_Agent_agentInstallPath, Azure_Pipelines_Deployment_Group_Agent_agentName, Azure_Pipelines_Deployment_Group_Agent_RunAsAutoLogon, Azure_Pipelines_Deployment_Group_Agent_windowsLogonAccount, Azure_Pipelines_Deployment_Group_Agent_windowsLogonPassword\'. Please see https://aka.ms/arm-deploy/#parameter-file for usage details.\'.","additionalInfo":[{"type":"TemplateViolation","info":{"lineNumber":0,"linePosition":0,"path":""}}]}}',
2021-05-27T01:25:26.7573607Z      headers: e { _headersMap: [Object] },
2021-05-27T01:25:26.7573995Z      status: 400 },
2021-05-27T01:25:26.7574300Z   body:
2021-05-27T01:25:26.7574666Z    { code: 'InvalidTemplate',
2021-05-27T01:25:26.7574996Z      message:
2021-05-27T01:25:26.7577412Z       'Deployment template validation failed: \'The template parameters \'undefined\' in the parameters file are not valid; they are not present in the original template and can therefore not be provided at deployment time. The only supported parameters for this template are \'newVMName, labName, size, userName, password, Azure_Pipelines_Deployment_Group_Agent_accountUrl, Azure_Pipelines_Deployment_Group_Agent_projectName, Azure_Pipelines_Deployment_Group_Agent_deploymentGroupName, Azure_Pipelines_Deployment_Group_Agent_PersonalAccessToken, Azure_Pipelines_Deployment_Group_Agent_deploymentAgentTags, Azure_Pipelines_Deployment_Group_Agent_agentInstallPath, Azure_Pipelines_Deployment_Group_Agent_agentName, Azure_Pipelines_Deployment_Group_Agent_RunAsAutoLogon, Azure_Pipelines_Deployment_Group_Agent_windowsLogonAccount, Azure_Pipelines_Deployment_Group_Agent_windowsLogonPassword\'. Please see https://aka.ms/arm-deploy/#parameter-file for usage details.\'.',
2021-05-27T01:25:26.7579748Z      additionalInfo: { '0': [Object] } } }
2021-05-27T01:25:26.7617027Z ##[error]Error => code: 'InvalidTemplate'; message = 'Deployment template validation failed: 'The template parameters 'undefined' in the parameters file are not valid; they are not present in the original template and can therefore not be provided at deployment time. The only supported parameters for this template are 'newVMName, labName, size, userName, password, Azure_Pipelines_Deployment_Group_Agent_accountUrl, Azure_Pipelines_Deployment_Group_Agent_projectName, Azure_Pipelines_Deployment_Group_Agent_deploymentGroupName, Azure_Pipelines_Deployment_Group_Agent_PersonalAccessToken, Azure_Pipelines_Deployment_Group_Agent_deploymentAgentTags, Azure_Pipelines_Deployment_Group_Agent_agentInstallPath, Azure_Pipelines_Deployment_Group_Agent_agentName, Azure_Pipelines_Deployment_Group_Agent_RunAsAutoLogon, Azure_Pipelines_Deployment_Group_Agent_windowsLogonAccount, Azure_Pipelines_Deployment_Group_Agent_windowsLogonPassword'. Please see https://aka.ms/arm-deploy/#parameter-file for usage details.'.'
2021-05-27T01:25:26.8079729Z ##[section]Finishing: Create Azure DevTest Labs VM

also it woks with


❯ New-AzResourceGroupDeployment -Name "noparams1" -ResourceGroupName "devtestlabs" -TemplateFile .\generated.txt -whatif

Note: The result may contain false positive predictions (noise).
You can help us improve the accuracy of the result by opening an issue here: https://aka.ms/WhatIfIssues.

Resource and property changes are indicated with these symbols:
  + Create
  * Ignore

The deployment will update the following scope:

Scope: /subscriptions/7666950f-9253-4781-be27-89727c793e23/resourceGroups/devtestlabs

  + Microsoft.DevTestLab/labs/devtestlabs/virtualmachines/s001 [2018-10-15-preview]

      apiVersion:                            "2018-10-15-preview"
      id:                                    "/subscriptions/7666950f-9253-4781-be27-89727c793e23/resourceGroups/devtestlabs/providers/Microsoft.DevTestLab/labs/devtestlabs/virtualmachines/s001"
      location:                              "westeurope"
      name:                                  "s001"
      properties.allowClaim:                 false
      properties.artifacts: [
        0:

          artifactId: "/subscriptions/7666950f-9253-4781-be27-89727c793e23/resourceGroups/devtestlabs/providers/Microsoft.DevTestLab/labs/devtestlabs/artifactSources/public repo/artifacts/windows-deploymentgroup"
          parameters: [
            0:

              name:  "accountUrl"
              value: "https://dev.azure.com/testowamigracja"

            1:

              name:  "projectName"
              value: "devtest"

            2:

              name:  "deploymentGroupName"
              value: "dg"

            3:

              name:  "PersonalAccessToken"
              value: "[[PAT]]"

            4:

              name: "deploymentAgentTags"

            5:

              name: "agentInstallPath"

            6:

              name: "agentName"

            7:

              name:  "RunAsAutoLogon"
              value: false

            8:

              name:  "windowsLogonAccount"
              value: "NT AUTHORITY\NetworkService"

            9:

              name:  "windowsLogonPassword"
              value: "*******"

          ]

      ]
      properties.customImageId:              "/subscriptions/7666950f-9253-4781-be27-89727c793e23/resourcegroups/devtestlabs/providers/microsoft.devtestlab/labs/devtestlabs/customimages/image-v2ci"
      properties.disallowPublicIpAddress:    false
      properties.isAuthenticationWithSshKey: false
      properties.labSubnetName:              "subnet-devtestlabs"
      properties.labVirtualNetworkId:        "/subscriptions/7666950f-9253-4781-be27-89727c793e23/resourceGroups/devtestlabs/providers/Microsoft.DevTestLab/labs/devtestlabs/virtualnetworks/vnet-devtestlabs"
      properties.notes:                      "image-v2ci"
      properties.password:                   "*******"
      properties.size:                       "Standard_B2ms"
      properties.storageType:                "Premium"
      properties.userName:                   "s"
      type:                                  "Microsoft.DevTestLab/labs/virtualmachines"

  * Microsoft.Compute/images/image-v2ci
  * Microsoft.DevTestLab/labs/devtestlabs
  * Microsoft.DevTestLab/labs/devtestlabs/virtualMachines/image-v2
  * Microsoft.DevTestLab/labs/devtestlabs/virtualMachines/Release-29
  * Microsoft.KeyVault/vaults/devtestlabs7264
  * Microsoft.KeyVault/vaults/devtestlabs73364913
  * Microsoft.Network/virtualNetworks/vnet-devtestlabs
  * Microsoft.Storage/storageAccounts/adevtestlabs2026

Resource changes: 1 to create, 8 to ignore.

@royal-gala
Copy link

Having the same issue, when using the Azure DevOps task, I cannot create a DevTest Lab VM as the task injects an undefined value:

"parameters": { "newVMName": { "value": "DVIMGVM001" }, "labName": { "value": "z-tst-dtl-poc-sba-ew1-dtl01" }, "undefined": { "value": "undefined" } },

@leovms
Copy link
Contributor

leovms commented May 27, 2021

Thank you for the reports. I'm actively looking at this. Can you tell me which agent you are using? Is it hosted, custom? If hosted, which one? I'm using a custom agent host with the latest agent version.

@royal-gala
Copy link

I am using a hosted agent.

Agent specifications : windows 2019

@leovms
Copy link
Contributor

leovms commented May 27, 2021

@YassinElf, thank you. I just ran a build that has a template and template parameter files against a hosted Windows 2019 agent and it worked for me. I can't repro it. Is it perhaps related to the encoding of the file? We assume UTF8.

@royal-gala
Copy link

Can you please share me, if possible, your template and template parameters files so we can test it on our pipeline ?

All we do is replace tokens on our template parameters files to get the release variables, then set some more env variable with a powershell task, then we are running the Create Azure DevTest Lab VM.

Here is the yaml template for the task :

variables:
  LAB_ID: '/subscriptions/XXXXXXX-XXXXX-XXXX-XXXX-XXXXXXXXX/resourceGroups/XXXXXXXXXXXXXX/providers/Microsoft.DevTestLab/labs/XXXXXXXX'
  NEW_VM_NAME: 'XXXXXXXXXX'

steps:
- task: ms-azuredevtestlabs.tasks.azure-dtl-task-createvm.AzureDevTestLabsCreateVM@3
  displayName: 'Create Azure DevTest Labs VM'
  inputs:
    azureSubscription: 'XXXXXXXX'
    LabId: '$(LAB_ID)'
    VirtualMachineName: '$(NEW_VM_NAME)'
    TemplateFile: '$(System.DefaultWorkingDirectory)/_[BUILD] - [GO] - ARM Golden Image file GIE/gie-image-artefact/go-vm-win10.template.json'
    ParametersFile: '$(System.DefaultWorkingDirectory)/_[BUILD] - [GO] - ARM Golden Image file GIE/gie-image-artefact/go-vm-win10.parameters.json'
    FailOnArtifactError: true

Thank you

@royal-gala
Copy link

When running our templates locally with a New-AzResourceGroupDeployment, it creates the DevTest Lab VM in the specified lab.

@leovms
Copy link
Contributor

leovms commented May 27, 2021

@YassinElf, it is the same one provided in this thread. I just changed values to match my config. I think the missing link here is YAML. Let me try creating a YAML pipeline. I am not using YAML in my setup. Can you do the opposite and try creating a regular pipeline with the task?

@leovms
Copy link
Contributor

leovms commented May 27, 2021

@YassinElf, I just validated with YAML pipeline and that also worked for me. Are we able to maybe connect offline? It may help identify what's different.

@sbugalski
Copy link
Author

@leovms - do you have any ideas why both me and @YassinElf have the issue, whereas you don't?

@leovms
Copy link
Contributor

leovms commented May 31, 2021

@sbugalski, unfortunately, I do not. Someone else internally tried it as well and same result. I'm trying to understand the commonality to see if I can repro it. So far, I have tried the following:

  • Classic, YAML, existing vs new pipelines, with and without parameters file
  • Different agents (self-hosted vs online hosted)

Can you think of anything else that may be different?

@AI-TTomasz
Copy link

@sbugalski @YassinElf We had the same problem. The Azure DevTest Labs Create VM task worked well until April/May 2021, and then for the same files as before, we started receiving the errors:

'Deployment template validation failed: 'The template parameters 'undefined' in the parameters file are not valid;

That's a hint for you @leovms. One of the commits between the 9th of April and the 21st of May destroyed pipelines in all our projects.

We've found a workaround.
The task is working if you add this parameter in the ARM template:

    "undefined":{
      "type" : "string",
      "defaultvalue" : "MicrosoftPleaseFixThis"
    }

@sbugalski
Copy link
Author

We've found a workaround.
The task is working if you add this parameter in the ARM template:

    "undefined":{
      "type" : "string",
      "defaultvalue" : "MicrosoftPleaseFixThis"
    }

@DXC-TTomasz appriciate that workaround :D

@leovms
Copy link
Contributor

leovms commented Sep 21, 2021

This has been around for some time. I am not able to repro it, but what I did instead is added a guard to ensure that such parameter is not allowed. It will be ignored and it will not be added to the list. When version 3.0.17 is available, you will be able to validate it. See #803 for details of the code I added.

@tgillitzer
Copy link

@leovms I'm getting the same issue on version 3.0.17.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants