@@ -364,7 +364,6 @@ def add_core_root_arguments(parser, build_type_default, build_type_help):
364
364
upload_parser = subparsers .add_parser ("upload" , description = upload_description , parents = [core_root_parser , target_parser ])
365
365
366
366
upload_parser .add_argument ("-mch_files" , metavar = "MCH_FILE" , required = True , nargs = '+' , help = upload_mch_files_help )
367
- upload_parser .add_argument ("-az_storage_key" , help = "Key for the clrjit Azure Storage location. Default: use the value of the CLRJIT_AZ_KEY environment variable." )
368
367
upload_parser .add_argument ("-jit_ee_version" , help = jit_ee_version_help )
369
368
upload_parser .add_argument ("--skip_cleanup" , action = "store_true" , help = skip_cleanup_help )
370
369
@@ -3563,14 +3562,14 @@ def list_superpmi_collections_container_via_azure_api(path_filter=lambda unused:
3563
3562
"""
3564
3563
3565
3564
require_azure_storage_libraries ()
3566
- from jitutil import ContainerClient , AzureCliCredential
3565
+ from jitutil import ContainerClient , DefaultAzureCredential
3567
3566
3568
3567
superpmi_container_url = az_blob_storage_superpmi_container_uri
3569
3568
3570
3569
paths = []
3571
3570
ok = True
3572
3571
try :
3573
- az_credential = AzureCliCredential ()
3572
+ az_credential = DefaultAzureCredential ()
3574
3573
container = ContainerClient .from_container_url (superpmi_container_url , credential = az_credential )
3575
3574
blob_name_prefix = az_collections_root_folder + "/"
3576
3575
blob_list = container .list_blobs (name_starts_with = blob_name_prefix , retry_total = 0 )
@@ -3789,8 +3788,8 @@ def upload_mch(coreclr_args):
3789
3788
coreclr_args (CoreclrArguments): parsed args
3790
3789
"""
3791
3790
3792
- require_azure_storage_libraries (need_azure_identity = False )
3793
- from jitutil import BlobServiceClient
3791
+ require_azure_storage_libraries (need_azure_identity = True )
3792
+ from jitutil import BlobServiceClient , DefaultAzureCredential
3794
3793
3795
3794
def upload_blob (file , blob_name ):
3796
3795
blob_client = blob_service_client .get_blob_client (container = az_superpmi_container_name , blob = blob_name )
@@ -3826,7 +3825,9 @@ def upload_blob(file, blob_name):
3826
3825
for item in files_to_upload :
3827
3826
logging .info (" %s" , item )
3828
3827
3829
- blob_service_client = BlobServiceClient (account_url = az_blob_storage_account_uri , credential = coreclr_args .az_storage_key )
3828
+ default_credential = DefaultAzureCredential ()
3829
+
3830
+ blob_service_client = BlobServiceClient (account_url = az_blob_storage_account_uri , credential = default_credential )
3830
3831
blob_folder_name = "{}/{}/{}/{}" .format (az_collections_root_folder , coreclr_args .jit_ee_version , coreclr_args .target_os , coreclr_args .mch_arch )
3831
3832
3832
3833
total_bytes_uploaded = 0
@@ -5005,12 +5006,6 @@ def verify_base_diff_args():
5005
5006
verify_target_args ()
5006
5007
verify_jit_ee_version_arg ()
5007
5008
5008
- coreclr_args .verify (args ,
5009
- "az_storage_key" ,
5010
- lambda item : item is not None ,
5011
- "Specify az_storage_key or set environment variable CLRJIT_AZ_KEY to the key to use." ,
5012
- modify_arg = lambda arg : os .environ ["CLRJIT_AZ_KEY" ] if arg is None and "CLRJIT_AZ_KEY" in os .environ else arg )
5013
-
5014
5009
coreclr_args .verify (args ,
5015
5010
"mch_files" ,
5016
5011
lambda unused : True ,
@@ -5035,12 +5030,6 @@ def verify_base_diff_args():
5035
5030
print ("Error: private store directory '" + coreclr_args .private_store + "' not found." )
5036
5031
sys .exit (1 )
5037
5032
5038
- # Safety measure: don't allow CLRJIT_AZ_KEY to be set if we are uploading to a private store.
5039
- # Note that this should be safe anyway, since we're publishing something private, not public.
5040
- if "CLRJIT_AZ_KEY" in os .environ :
5041
- print ("Error: environment variable CLRJIT_AZ_KEY is set, but command is `upload-private`, not `upload`. That is not allowed." )
5042
- sys .exit (1 )
5043
-
5044
5033
elif coreclr_args .mode == "download" :
5045
5034
5046
5035
verify_target_args ()
0 commit comments