.NET: Increase credential timeout for Integration Tests (#4472)

* Increase credential timeout for Integration Tests

* Fix format error.

* Update further tests

* Fix comment

* Rename credentials file and class.

* Fix broken reference.
This commit is contained in:
westey
2026-03-05 10:32:45 +00:00
committed by GitHub
Unverified
parent d02051dbb6
commit 6dc65dbaa1
24 changed files with 68 additions and 31 deletions
@@ -0,0 +1,9 @@
# Integration Tests Azure Credentials
Adds a helper for loading Azure credentials in integration tests.
```xml
<PropertyGroup>
<InjectSharedIntegrationTestAzureCredentialsCode>true</InjectSharedIntegrationTestAzureCredentialsCode>
</PropertyGroup>
```
@@ -0,0 +1,28 @@
// Copyright (c) Microsoft. All rights reserved.
#pragma warning disable IDE0005 // This is required in some projects and not in others.
using System;
#pragma warning restore IDE0005
using Azure.Identity;
namespace Shared.IntegrationTests;
/// <summary>
/// Provides credential instances for integration tests with
/// increased timeouts to avoid CI pipeline authentication failures.
/// </summary>
internal static class TestAzureCliCredentials
{
/// <summary>
/// The default timeout for Azure CLI credential operations.
/// Increased from the default (~13s) to accommodate CI pipeline latency.
/// </summary>
private static readonly TimeSpan s_processTimeout = TimeSpan.FromSeconds(60);
/// <summary>
/// Creates a new <see cref="AzureCliCredential"/> with an increased process timeout
/// suitable for CI environments.
/// </summary>
public static AzureCliCredential CreateAzureCliCredential() =>
new(new AzureCliCredentialOptions { ProcessTimeout = s_processTimeout });
}