2016-07-25 19 views
0

我想創建一個Azure DevTest實驗室虛擬機作爲Visual Studio團隊服務中構建過程的一部分。然而,當我運行構建我得到以下錯誤:從Visual Studio團隊服務創建Azure DevTest實驗室虛擬機

****************************************************************************** 
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和我使用由微軟(https://marketplace.visualstudio.com/items?itemName=ms-azuredevtestlabs.tasks)提供的DevTest中實驗室任務。

這是非常令人困惑,因爲錯誤聲稱「MissingSubscription」,但該任務的日誌包含我的所有訂閱信息?!?!

回答

1

這可能是由您在「Azure DevTest Labs創建虛擬機」任務中輸入的「實驗室名稱」不正確引起的。確保您已經在Azure Portal中創建了DevTest實驗室,然後在「Azure DevTest Labs創建虛擬機」任務中,您應該從「實驗室名稱」下拉列表中看到它,然後從中選擇。 enter image description here

如果實驗室名稱正確,則應在日誌中看到與以下格式相同的「LabID」:

LabId = /subscriptions/subscriptionID/resourceGroups/resourcegroupname/providers/Microsoft.DevTestLab/labs/LabName 
相關問題