@@ -301,6 +301,10 @@ def create_connectedk8s(
301301 ):
302302 lowbandwidth = True
303303
304+ azure_local_disconnected = False
305+ if os .getenv ("AZURE_LOCAL_DISCONNECTED" ) == "true" :
306+ azure_local_disconnected = True
307+
304308 # Install kubectl and helm
305309 try :
306310 kubectl_client_location = install_kubectl_client ()
@@ -316,8 +320,8 @@ def create_connectedk8s(
316320 # Pre onboarding checks
317321 diagnostic_checks = "Failed"
318322 try :
319- # if aks_hci lowbandwidth scenario skip, otherwise continue to perform pre-onboarding check
320- if not lowbandwidth :
323+ # if aks_hci lowbandwidth scenario or Azure local disconnected, skip, otherwise continue pre-onboarding check.
324+ if not azure_local_disconnected and not lowbandwidth :
321325 print (
322326 "Step: {}: Starting Pre-onboarding-check" .format (
323327 utils .get_utctimestring ()
@@ -406,7 +410,7 @@ def create_connectedk8s(
406410 raise ManualInterrupt ("Process terminated externally." )
407411
408412 # If the checks didnt pass then stop the onboarding
409- if diagnostic_checks != consts .Diagnostic_Check_Passed and lowbandwidth is False :
413+ if diagnostic_checks != consts .Diagnostic_Check_Passed and not azure_local_disconnected and not lowbandwidth :
410414 if storage_space_available :
411415 logger .warning (
412416 "The pre-check result logs logs have been saved at this path: "
@@ -439,7 +443,7 @@ def create_connectedk8s(
439443 )
440444 raise ValidationError (err_msg )
441445
442- if lowbandwidth is False :
446+ if not azure_local_disconnected and not lowbandwidth :
443447 print (
444448 "Step: {}: The required pre-checks for onboarding have succeeded." .format (
445449 utils .get_utctimestring ()
@@ -985,6 +989,8 @@ def create_connectedk8s(
985989 helm_client_location ,
986990 enable_private_link ,
987991 arm_metadata ,
992+ registry_path ,
993+ put_cc_response .identity .principal_id ,
988994 onboarding_timeout ,
989995 helm_content_values ,
990996 )
@@ -3203,7 +3209,7 @@ def disable_features(
32033209 )
32043210 if not disable_cl and cl_enabled is True and cl_oid != "" :
32053211 raise Exception (
3206- "Disabling 'cluster-connect' feature is not allowed when 'custom-locations' feature is enabled"
3212+ "Disabling 'cluster-connect' feature is not allowed when 'custom-locations' feature is enabled. "
32073213 )
32083214 except AttributeError :
32093215 pass
@@ -3723,6 +3729,13 @@ def client_side_proxy_wrapper(
37233729 # initializations
37243730 user_type = "sat"
37253731 creds = ""
3732+ dict_file = {
3733+ "server" : {
3734+ "httpPort" : int (client_proxy_port ),
3735+ "httpsPort" : int (api_server_port )
3736+ },
3737+ "identity" : {"tenantID" : tenant_id }
3738+ }
37263739
37273740 # if service account token is not passed
37283741 if token is None :
@@ -3732,35 +3745,9 @@ def client_side_proxy_wrapper(
37323745 user_type = account ["user" ]["type" ]
37333746
37343747 if user_type == "user" :
3735- dict_file = {
3736- "server" : {
3737- "httpPort" : int (client_proxy_port ),
3738- "httpsPort" : int (api_server_port ),
3739- },
3740- "identity" : {
3741- "tenantID" : tenant_id ,
3742- "clientID" : consts .CLIENTPROXY_CLIENT_ID ,
3743- },
3744- }
3748+ dict_file ["identity" ]["clientID" ] = consts .CLIENTPROXY_CLIENT_ID
37453749 else :
3746- dict_file = {
3747- "server" : {
3748- "httpPort" : int (client_proxy_port ),
3749- "httpsPort" : int (api_server_port ),
3750- },
3751- "identity" : {
3752- "tenantID" : tenant_id ,
3753- "clientID" : account ["user" ]["name" ],
3754- },
3755- }
3756-
3757- if cloud == "DOGFOOD" :
3758- dict_file ["cloud" ] = "AzureDogFood"
3759-
3760- if cloud == consts .Azure_ChinaCloudName :
3761- dict_file ["cloud" ] = "AzureChinaCloud"
3762- elif cloud == consts .Azure_USGovCloudName :
3763- dict_file ["cloud" ] = "AzureUSGovernmentCloud"
3750+ dict_file ["identity" ]["clientID" ] = account ["user" ]["name" ]
37643751
37653752 if not utils .is_cli_using_msal_auth ():
37663753 # Fetching creds
@@ -3802,17 +3789,27 @@ def client_side_proxy_wrapper(
38023789
38033790 if user_type != "user" :
38043791 dict_file ["identity" ]["clientSecret" ] = creds
3792+
3793+ if cloud == "DOGFOOD" :
3794+ dict_file ["cloud" ] = "AzureDogFood"
3795+ elif cloud == consts .Azure_ChinaCloudName :
3796+ dict_file ["cloud" ] = "AzureChinaCloud"
3797+ elif cloud == consts .Azure_USGovCloudName :
3798+ dict_file ["cloud" ] = "AzureUSGovernmentCloud"
38053799 else :
3806- dict_file = {
3807- "server" : {
3808- "httpPort" : int (client_proxy_port ),
3809- "httpsPort" : int (api_server_port ),
3810- }
3811- }
3812- if cloud == consts .Azure_ChinaCloudName :
3813- dict_file ["cloud" ] = "AzureChinaCloud"
3814- elif cloud == consts .Azure_USGovCloudName :
3815- dict_file ["cloud" ] = "AzureUSGovernmentCloud"
3800+ dict_file ["cloud" ] = cloud
3801+
3802+ # Azure local configurations.
3803+ arm_metadata = utils .get_metadata (cmd .cli_ctx .cloud .endpoints .resource_manager )
3804+ if "dataplaneEndpoints" in arm_metadata :
3805+ dict_file ["cloudConfig" ] = {}
3806+ dict_file ["cloudConfig" ]["resourceManagerEndpoint" ] = arm_metadata ["resourceManager" ]
3807+ relay_endpoint_suffix = arm_metadata ["suffixes" ]["relayEndpointSuffix" ]
3808+ if relay_endpoint_suffix [0 ] == "." :
3809+ dict_file ["cloudConfig" ]["serviceBusEndpointSuffix" ] = (relay_endpoint_suffix )[1 :]
3810+ else :
3811+ dict_file ["cloudConfig" ]["serviceBusEndpointSuffix" ] = relay_endpoint_suffix
3812+ dict_file ["cloudConfig" ]["activeDirectoryEndpoint" ] = arm_metadata ["authentication" ]["loginEndpoint" ]
38163813
38173814 telemetry .set_debug_info ("User type is " , user_type )
38183815
@@ -4658,6 +4655,9 @@ def install_kubectl_client():
46584655 )
46594656 )
46604657 # Return kubectl client path set by user
4658+ if os .getenv ("KUBECTL_CLIENT_PATH" ):
4659+ return os .getenv ("KUBECTL_CLIENT_PATH" )
4660+
46614661 try :
46624662 # Fetching the current directory where the cli installs the kubectl executable
46634663 home_dir = os .path .expanduser ("~" )
0 commit comments