@@ -168,7 +168,15 @@ func (p *Provider) InfraReady(ctx context.Context, in clusterapi.InfraReadyInput
168168
169169 // Create user assigned identity
170170 userAssignedIdentityName := fmt .Sprintf ("%s-identity" , in .InfraID )
171- armmsiClientFactory , err := armmsi .NewClientFactory (subscriptionID , tokenCredential , nil )
171+ armmsiClientFactory , err := armmsi .NewClientFactory (
172+ subscriptionID ,
173+ tokenCredential ,
174+ & arm.ClientOptions {
175+ ClientOptions : policy.ClientOptions {
176+ Cloud : cloudConfiguration ,
177+ },
178+ },
179+ )
172180 if err != nil {
173181 return fmt .Errorf ("failed to create armmsi client: %w" , err )
174182 }
@@ -328,7 +336,13 @@ func (p *Provider) InfraReady(ctx context.Context, in clusterapi.InfraReadyInput
328336 return err
329337 }
330338
331- networkClientFactory , err := armnetwork .NewClientFactory (subscriptionID , session .TokenCreds , nil )
339+ networkClientFactory , err := armnetwork .NewClientFactory (subscriptionID , session .TokenCreds ,
340+ & arm.ClientOptions {
341+ ClientOptions : policy.ClientOptions {
342+ Cloud : cloudConfiguration ,
343+ },
344+ },
345+ )
332346 if err != nil {
333347 return fmt .Errorf ("error creating network client factory: %w" , err )
334348 }
@@ -393,13 +407,26 @@ func (p *Provider) PostProvision(ctx context.Context, in clusterapi.PostProvisio
393407 return fmt .Errorf ("error retrieving Azure session: %w" , err )
394408 }
395409 subscriptionID := ssn .Credentials .SubscriptionID
410+ cloudConfiguration := ssn .CloudConfig
396411
397412 if in .InstallConfig .Config .Publish == types .ExternalPublishingStrategy {
398- vmClient , err := armcompute .NewVirtualMachinesClient (subscriptionID , ssn .TokenCreds , nil )
413+ vmClient , err := armcompute .NewVirtualMachinesClient (subscriptionID , ssn .TokenCreds ,
414+ & arm.ClientOptions {
415+ ClientOptions : policy.ClientOptions {
416+ Cloud : cloudConfiguration ,
417+ },
418+ },
419+ )
399420 if err != nil {
400421 return fmt .Errorf ("error creating vm client: %w" , err )
401422 }
402- nicClient , err := armnetwork .NewInterfacesClient (ssn .Credentials .SubscriptionID , ssn .TokenCreds , nil )
423+ nicClient , err := armnetwork .NewInterfacesClient (ssn .Credentials .SubscriptionID , ssn .TokenCreds ,
424+ & arm.ClientOptions {
425+ ClientOptions : policy.ClientOptions {
426+ Cloud : cloudConfiguration ,
427+ },
428+ },
429+ )
403430 if err != nil {
404431 return fmt .Errorf ("error creating nic client: %w" , err )
405432 }
0 commit comments