File tree Expand file tree Collapse file tree 2 files changed +3
-9
lines changed
src/ResourceManager/Sql/Commands.Sql Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Original file line number Diff line number Diff line change 18
18
- Additional information about change #1
19
19
-->
20
20
## Current Release
21
+ * Fixed issue where some backup cmdlets would not recognize the current azure subscription
21
22
22
23
## Version 4.11.3
23
24
* Fixed issue with default resource groups not being set.
Original file line number Diff line number Diff line change @@ -33,10 +33,6 @@ public class AzureSqlDatabaseBackupCommunicator
33
33
/// The Sql client to be used by this end points communicator
34
34
/// </summary>
35
35
private static Management . Sql . LegacySdk . SqlManagementClient LegacyClient { get ; set ; }
36
- /// <summary>
37
- /// The Sql client to be used by this end points communicator
38
- /// </summary>
39
- private static Management . Sql . SqlManagementClient SqlClient { get ; set ; }
40
36
41
37
/// <summary>
42
38
/// The resources management client used by this communicator
@@ -400,11 +396,8 @@ private Management.Sql.LegacySdk.SqlManagementClient GetLegacySqlClient()
400
396
private Management . Sql . SqlManagementClient GetCurrentSqlClient ( )
401
397
{
402
398
// Get the SQL management client for the current subscription
403
- if ( SqlClient == null )
404
- {
405
- SqlClient = AzureSession . Instance . ClientFactory . CreateArmClient < Management . Sql . SqlManagementClient > ( Context , AzureEnvironment . Endpoint . ResourceManager ) ;
406
- }
407
- return SqlClient ;
399
+ // Note: client is not cached in static field because that causes ObjectDisposedException in functional tests.
400
+ return AzureSession . Instance . ClientFactory . CreateArmClient < Management . Sql . SqlManagementClient > ( Context , AzureEnvironment . Endpoint . ResourceManager ) ;
408
401
}
409
402
410
403
/// <summary>
You can’t perform that action at this time.
0 commit comments