Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Hang on Configure and Authenticate #7474

Closed
3 tasks done
dmarlow opened this issue Sep 4, 2019 · 1 comment
Closed
3 tasks done

[BUG] Hang on Configure and Authenticate #7474

dmarlow opened this issue Sep 4, 2019 · 1 comment
Labels
needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team.

Comments

@dmarlow
Copy link

dmarlow commented Sep 4, 2019

Describe the bug
Thread hangs when calling this:

Azure.Configure()
  .Authenticate(credentials)
  .WithDefaultSubscription();

Exception or Stack Trace
Here's what I see when I hit pause in VS:

Microsoft.Rest.ClientRuntime.dll!Microsoft.Rest.ServiceClient<Microsoft.Azure.Management.Graph.RBAC.Fluent.GraphRbacManagementClient>.InitializeHttpClient(System.Net.Http.HttpClient httpClient, System.Net.Http.HttpClientHandler httpClientHandler, System.Net.Http.DelegatingHandler[] handlers)	Unknown
Microsoft.Rest.ClientRuntime.dll!Microsoft.Rest.ServiceClient<System.__Canon>.ServiceClient(System.Net.Http.HttpClientHandler rootHandler, System.Net.Http.DelegatingHandler[] handlers)	Unknown
Microsoft.Azure.Management.ResourceManager.Fluent.dll!Microsoft.Azure.Management.ResourceManager.Fluent.Core.FluentServiceClientBase<Microsoft.Azure.Management.Graph.RBAC.Fluent.GraphRbacManagementClient>.FluentServiceClientBase(string baseUri, Microsoft.Azure.Management.ResourceManager.Fluent.Core.RestClient restClient)	Unknown
Microsoft.Azure.Management.Graph.RBAC.Fluent.dll!Microsoft.Azure.Management.Graph.RBAC.Fluent.GraphRbacManagementClient.GraphRbacManagementClient(string baseUri, Microsoft.Azure.Management.ResourceManager.Fluent.Core.RestClient restClient)	Unknown
Microsoft.Azure.Management.Graph.RBAC.Fluent.dll!Microsoft.Azure.Management.Graph.RBAC.Fluent.GraphRbacManager.GraphRbacManager(Microsoft.Azure.Management.ResourceManager.Fluent.Core.RestClient restClient, string tenantId)	Unknown
Microsoft.Azure.Management.Graph.RBAC.Fluent.dll!Microsoft.Azure.Management.Graph.RBAC.Fluent.GraphRbacManager.Authenticate(Microsoft.Azure.Management.ResourceManager.Fluent.Core.RestClient restClient, string tenantId)	Unknown
Microsoft.Azure.Management.Fluent.dll!Microsoft.Azure.Management.Fluent.Azure.Authenticated.Authenticated(Microsoft.Azure.Management.ResourceManager.Fluent.Core.RestClient restClient, string tenantId)	Unknown
Microsoft.Azure.Management.Fluent.dll!Microsoft.Azure.Management.Fluent.Azure.Configurable.Microsoft.Azure.Management.Fluent.Azure.IConfigurable.Authenticate(Microsoft.Azure.Management.ResourceManager.Fluent.Authentication.AzureCredentials credentials)	Unknown

To Reproduce
I'm not sure this is something that happens to everyone. This surely must be isolated to me, but I can't figure out how to diagnose it further. I was taking the code from here: https://github.com/Azure-Samples/network-dotnet-manage-network-security-group/blob/master/Program.cs

and trying it from a console app in the same way.

Code Snippet

var credentials = SdkContext.AzureCredentialsFactory.FromServicePrincipal(
                clientId,
                clientSecret,
                tenantId,
                AzureEnvironment.AzureGlobalCloud);
var azure = Azure.Configure()
    .Authenticate(credentials)
    .WithDefaultSubscription();

Expected behavior
To not hang indefinitely when trying to configure and authenticate my Azure instance.

Setup (please complete the following information):

  • OS: Win 10
  • IDE : VS 2017
  • .NET 4.7.1
  • Version: Microsoft.Azure.Management.Fluent v1.25.0

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added
@triage-new-issues triage-new-issues bot added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Sep 4, 2019
@dmarlow
Copy link
Author

dmarlow commented Sep 4, 2019

I think I found the cause. For anyone that runs into this, the solution is to upgrade some PackageReferences. I had this in my csproj:

<PackageReference Include="Microsoft.Rest.ClientRuntime">
  <Version>2.3.11</Version>
</PackageReference>
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure">
  <Version>3.3.12</Version>
</PackageReference>

Once I upgraded these to the following, things worked as expected:

<PackageReference Include="Microsoft.Rest.ClientRuntime">
  <Version>2.3.20</Version>
</PackageReference>
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure">
  <Version>3.3.19</Version>
</PackageReference>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team.
Projects
None yet
Development

No branches or pull requests

1 participant