build - Create Azure DevTest Lab VM from Visual Studio Team Services -
i want create azure devtest labs vm part of build process in visual studio team services. when run build following error:
****************************************************************************** starting task: create azure devtest labs vm ****************************************************************************** executing powershell script: c:\lr\mms\services\mms\taskagentprovisioner\tools\agents\1.102.0\tasks\azuredevtestlabscreatevm\1.0.7\new-azuredtlvm.ps1 looking azure powershell module @ c:\program files (x86)\microsoft sdks\azure\powershell\servicemanagement\azure\azure.psd1 azurepscmdletsversion= 1.3.2 get-serviceendpoint -name ***** -context microsoft.teamfoundation.distributedtask.agent.worker.common.taskcontext tenantid= ******** azuresubscriptionid= ***** azuresubscriptionname= ***** add-azurermaccount -serviceprincipal -tenant ******** -credential system.management.automation.pscredential select-azurermsubscription -subscriptionid ***** -tenantid ******** starting azure devtest labs create vm task task called following parameters: connectedservicename = ***** labid = ***** templatename = c:\a\1\s\mvc app\azure-rm-template templateparameters = -newvmname 'builder' -username 'admin' -password (convertto-securestring -string ***** -asplaintext -force) outputresourceid = labvmid validating input parameters fetching lab ***** microsoft.azure.commands.resourcemanager.cmdlets.entities.errorresponses.errorresponsemessageexception: missingsubscription : request did not have provided subscription. requests must have associated subscription id. @ microsoft.azure.commands.resourcemanager.cmdlets.restclients.resourcemanagerrestclientbase.<sendrequestasync>d__24.movenext() --- end of stack trace previous location exception thrown --- @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ microsoft.azure.commands.resourcemanager.cmdlets.restclients.resourcemanagerrestclientbase.<sendrequestasync>d__20.movenext() --- end of stack trace previous location exception thrown --- @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ microsoft.azure.commands.resourcemanager.cmdlets.restclients.resourcemanagerrestclientbase.<sendrequestasync>d__1b`1.movenext() --- end of stack trace previous location exception thrown --- @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ microsoft.azure.commands.resourcemanager.cmdlets.implementation.getazureresourcecmdlet.<getresource>d__12.movenext() --- end of stack trace previous location exception thrown --- @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ microsoft.azure.commands.resourcemanager.cmdlets.implementation.getazureresourcecmdlet.<getresources>d__c.movenext()
i have connected vsts azure using service principal , using devtest labs tasks provided microsoft (https://marketplace.visualstudio.com/items?itemname=ms-azuredevtestlabs.tasks).
it's confusing because error claims "missingsubscription" logs task contain of subscription information?!?!
this caused "lab name" entered in "azure devtest labs create vm" task incorrect. make sure have created devtest lab in azure portal, , in "azure devtest labs create vm" task, should see drop-down list of "lab name', choose there.
if lab name correct, should see "labid" in log same following format:
labid = /subscriptions/subscriptionid/resourcegroups/resourcegroupname/providers/microsoft.devtestlab/labs/labname
Comments
Post a Comment