2016-10-25 16 views
0

私はManagementClient.Subscriptions.Get()を呼び出すたびに永遠にハングします。 これをManagementClient.Subscriptions.GetAsync()に変更し、独自のスレッドで実行すると、タスクはWaitingForActivation状態にとどまります。Azure ManagementClient.Subscriptions.Get()は永遠にハングします。回避策が必要です

提案がありますか?

サンプルコード:(それがハングアップし、最後の行です。)事前に

using System; 
using Microsoft.Azure; 
using Microsoft.WindowsAzure.Management; 
using Microsoft.WindowsAzure.Management.Models; 
using Microsoft.IdentityModel.Clients.ActiveDirectory; 

class Program1 
{ 
    static void Main1(string[] args) 
    { 
     AuthenticationContext context = new AuthenticationContext(...); 
     AuthenticationResult authResult = context.AcquireToken(...); 
     TokenCloudCredentials token = new TokenCloudCredentials(authResult.AccessToken); 
     ManagementClient client = new ManagementClient(token); 
     SubscriptionGetResponse subresp = client.Subscriptions.Get(); 
    } 
} 

感謝。

答えて

0

明らかに、エラー回復はSubscriptions.Getと友人に欠けています。私の問題は、context.AcquireTokenのURLが間違っていたことでした。私は "https://management.core.windows.net"を持っていましたが、 "https://management.core.windows.net/"が必要です(末尾のスラッシュはすべての違いがありました)。

関連する問題