簡體   English   中英

從Visual Studio Team Services創建Azure DevTest Lab VM

[英]Create Azure DevTest Lab VM from Visual Studio Team Services

我想在Visual Studio Team Services中創建Azure DevTest Labs VM作為構建過程的一部分。 但是,當我運行構建時,出現以下錯誤:

******************************************************************************
Starting task: Create Azure DevTest Labs VM
******************************************************************************
Executing the powershell script: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\1.102.0\tasks\AzureDevTestLabsCreateVM\1.0.7\New-AzureDtlVM.ps1
Looking for Azure PowerShell module at 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 with the 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 : The request did not have a provided subscription. All requests must have an associated subscription Id.
at Microsoft.Azure.Commands.ResourceManager.Cmdlets.RestClients.ResourceManagerRestClientBase.<SendRequestAsync>d__24.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Commands.ResourceManager.Cmdlets.RestClients.ResourceManagerRestClientBase.<SendRequestAsync>d__20.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Commands.ResourceManager.Cmdlets.RestClients.ResourceManagerRestClientBase.<SendRequestAsync>d__1b`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.GetAzureResourceCmdlet.<GetResource>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.GetAzureResourceCmdlet.<GetResources>d__c.MoveNext()

我已使用服務主體將VSTS連接到Azure,並且正在使用Microsoft提供的DevTest Labs任務( https://marketplace.visualstudio.com/items?itemName=ms-azuredevtestlabs.tasks )。

這非常令人困惑,因為該錯誤聲明為“ MissingSubscription”,但該任務的日志包含我所有的訂閱信息?!?!

這可能是由於您在“ Azure DevTest Labs創建VM”任務中輸入的“實驗室名稱”不正確引起的。 確保已在Azure Portal中創建了DevTest Lab,然后在“ Azure DevTest Labs Create VM”任務中,應該從“ Lab Name”的下拉列表中看到它,然后從中選擇它。 在此處輸入圖片說明

如果實驗室名稱正確,則應該在日志中看到“ LabID”,格式如下:

LabId = /subscriptions/subscriptionID/resourceGroups/resourcegroupname/providers/Microsoft.DevTestLab/labs/LabName 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM