2016-11-30 52 views
0

當我嘗試創建Visual Studio中一放,我碰到這個錯誤Visual Studio團隊服務的釋放問題

enter image description here

蔚藍部署

考慮到我有我的Azure的帳戶完全權限我沒有問題登錄到我的天藍色會話

我認爲這是一個VSTS內的錯誤,問題是,如何調整這種情況?我可以使用發佈管理工具的Visual Studio 2013臨時直到我找到如何做一個版本

Rem:我試過舊的方法,它使用PowerShell來獲取有關委託人id,租戶ID等信息,但此方法需要我的應用程序必須由AAD支持這是不是我們的情況的情況和第二這種方法被認爲過時了,現在

任何幫助將高度讚賞

謝謝

+0

什麼是通過PowerShell腳本獲得主ID,租戶ID的結果,然後添加Azure資源管理器服務端點? –

+0

主體ID爲空 – user2050269

+0

手動輸入「Azure RM訂閱」字段中的訂閱ID字段嗎? –

回答

1

據工作對於我來說足夠了。 (通過單擊「授權」按鈕成功配置Azure服務連接)。

您可以清除Internet瀏覽器緩存,然後啓動InPrivate瀏覽,您可以在其他機器上嘗試。

「我想它使用PowerShell來獲取有關主ID,租戶ID等信息的老方法,但這種方法需要我的應用程序已經被AAD備份這是不是我們的情況的情況下

你並不需要配置,通過手動添加支持的應用程序,只需要直接運行這個PowerShell腳本(參見this文章)

param 
(
    [Parameter(Mandatory=$true, HelpMessage="Enter Azure Subscription name. You need to be Subscription Admin to execute the script")] 
    [string] $subscriptionName, 

    [Parameter(Mandatory=$true, HelpMessage="Provide a password for SPN application that you would create")] 
    [string] $password, 

    [Parameter(Mandatory=$false, HelpMessage="Provide a SPN role assignment")] 
    [string] $spnRole = "owner" 
) 

#Initialize 
$ErrorActionPreference = "Stop" 
$VerbosePreference = "SilentlyContinue" 
$userName = $env:USERNAME 
$newguid = [guid]::NewGuid() 
$displayName = [String]::Format("VSO.{0}.{1}", $userName, $newguid) 
$homePage = "http://" + $displayName 
$identifierUri = $homePage 


#Initialize subscription 
$isAzureModulePresent = Get-Module -Name AzureRM* -ListAvailable 
if ([String]::IsNullOrEmpty($isAzureModulePresent) -eq $true) 
{ 
    Write-Output "Script requires AzureRM modules to be present. Obtain AzureRM from https://github.com/Azure/azure-powershell/releases. Please refer https://github.com/Microsoft/vsts-tasks/blob/master/Tasks/DeployAzureResourceGroup/README.md for recommended AzureRM versions." -Verbose 
    return 
} 

Import-Module -Name AzureRM.Profile 
Write-Output "Provide your credentials to access Azure subscription $subscriptionName" -Verbose 
Login-AzureRmAccount -SubscriptionName $subscriptionName 
$azureSubscription = Get-AzureRmSubscription -SubscriptionName $subscriptionName 
$connectionName = $azureSubscription.SubscriptionName 
$tenantId = $azureSubscription.TenantId 
$id = $azureSubscription.SubscriptionId 


#Create a new AD Application 
Write-Output "Creating a new Application in AAD (App URI - $identifierUri)" -Verbose 
$azureAdApplication = New-AzureRmADApplication -DisplayName $displayName -HomePage $homePage -IdentifierUris $identifierUri -Password $password -Verbose 
$appId = $azureAdApplication.ApplicationId 
Write-Output "Azure AAD Application creation completed successfully (Application Id: $appId)" -Verbose 


#Create new SPN 
Write-Output "Creating a new SPN" -Verbose 
$spn = New-AzureRmADServicePrincipal -ApplicationId $appId 
$spnName = $spn.ServicePrincipalName 
Write-Output "SPN creation completed successfully (SPN Name: $spnName)" -Verbose 


#Assign role to SPN 
Write-Output "Waiting for SPN creation to reflect in Directory before Role assignment" 
Start-Sleep 20 
Write-Output "Assigning role ($spnRole) to SPN App ($appId)" -Verbose 
New-AzureRmRoleAssignment -RoleDefinitionName $spnRole -ServicePrincipalName $appId 
Write-Output "SPN role assignment completed successfully" -Verbose 


#Print the values 
Write-Output "`nCopy and Paste below values for Service Connection" -Verbose 
Write-Output "***************************************************************************" 
Write-Output "Connection Name: $connectionName(SPN)" 
Write-Output "Subscription Id: $id" 
Write-Output "Subscription Name: $connectionName" 
Write-Output "Service Principal Id: $appId" 
Write-Output "Service Principal key: <Password that you typed in>" 
Write-Output "Tenant Id: $tenantId" 
Write-Output "***************************************************************************" 
+0

當我得到這樣的TenantId時,輸出是*******,它是如何顯示在日誌中的,還是它實際上存儲在我的var中? – m1nkeh

+0

@ m1nkeh不,它應該是實際值。你在Windows PowerShell中運行它嗎? –

+0

做了$ var.length,並且它返回爲32,所以我認爲它只是VSTS隱藏日誌中的值,我會將它傳遞給我的ARM模板,看它是否有效! :d – m1nkeh

相關問題