File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
src/ResourceManager/RecoveryServices.Backup/Commands.RecoveryServices.Backup.ServiceClientAdapter Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -24,17 +24,26 @@ namespace Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.ServiceClient
24
24
{
25
25
public partial class ServiceClientAdapter
26
26
{
27
+ const string AppSettingsSectionName = "appSettings" ;
27
28
const string RecoveryServicesResourceNamespace = "Microsoft.RecoveryServices" ;
29
+ const string ProviderNamespaceKey = "ProviderNamespace" ;
28
30
const string AzureFabricName = "Azure" ;
29
31
30
32
ClientProxy < RecoveryServicesNS . RecoveryServicesBackupManagementClient , RecoveryServicesModelsNS . CustomRequestHeaders > BmsAdapter ;
31
33
32
34
public ServiceClientAdapter ( SubscriptionCloudCredentials creds , Uri baseUri )
33
35
{
36
+ System . Configuration . Configuration exeConfiguration = System . Configuration . ConfigurationManager . OpenExeConfiguration ( System . Reflection . Assembly . GetExecutingAssembly ( ) . Location ) ;
37
+ System . Configuration . AppSettingsSection appSettings = ( System . Configuration . AppSettingsSection ) exeConfiguration . GetSection ( AppSettingsSectionName ) ;
38
+ string recoveryServicesResourceNamespace = RecoveryServicesResourceNamespace ;
39
+ if ( appSettings . Settings [ ProviderNamespaceKey ] != null )
40
+ {
41
+ recoveryServicesResourceNamespace = appSettings . Settings [ ProviderNamespaceKey ] . Value ;
42
+ }
34
43
BmsAdapter = new ClientProxy < RecoveryServicesNS . RecoveryServicesBackupManagementClient , RecoveryServicesModelsNS . CustomRequestHeaders > (
35
44
clientRequestId => new RecoveryServicesModelsNS . CustomRequestHeaders ( ) { ClientRequestId = clientRequestId } ,
36
45
creds , baseUri ) ;
37
- BmsAdapter . Client . ResourceNamespace = RecoveryServicesResourceNamespace ;
46
+ BmsAdapter . Client . ResourceNamespace = recoveryServicesResourceNamespace ;
38
47
}
39
48
}
40
49
}
You can’t perform that action at this time.
0 commit comments