@@ -463,7 +463,7 @@ def _verify_old(self, skip_storage_check, wait_time_in_minutes, aem_ext):
463463 else :
464464 logger .warning ("\t \t Storage Metrics configuration check for '%s'..." , storage_account_name )
465465 storage_client = self ._get_storage_client (storage_account_name , disk ['key' ])
466- service_properties = storage_client .get_blob_service_properties ()
466+ service_properties = storage_client .get_service_properties ()
467467 storage_cfg_ok = EnhancedMonitoring ._check_storage_analytics (service_properties )
468468 if storage_cfg_ok :
469469 logger .warning ('\t \t Storage Metrics configuration check: %s' , succ_word )
@@ -731,44 +731,47 @@ def _get_disk_info(self):
731731 return disks_info
732732
733733 def _get_blob_size (self , storage_account_name , container , blob , key ):
734- storage_client = self ._get_storage_client (storage_account_name , key )
734+ blob_service_client = self ._get_storage_client (storage_account_name , key )
735+ blob_client = blob_service_client .get_blob_client (container , blob )
735736 # convert to GB
736- return int (storage_client . get_blob_properties ( container , blob ). properties .content_length / (1 << 30 ))
737+ return int (blob_client . properties .size / (1 << 30 ))
737738
738739 def _get_storage_client (self , storage_account_name , key ):
739- BlockBlobService = get_sdk (self ._cmd .cli_ctx , ResourceType .DATA_STORAGE ,
740- 'blob.blockblobservice#BlockBlobService ' )
740+ BlobServiceClient = get_sdk (self ._cmd .cli_ctx , ResourceType .DATA_STORAGE_BLOB ,
741+ '_blob_service_client#BlobServiceClient ' )
741742 return get_data_service_client (
742743 self ._cmd .cli_ctx ,
743- BlockBlobService ,
744+ BlobServiceClient ,
744745 storage_account_name ,
745746 key ,
746747 endpoint_suffix = self ._cmd .cli_ctx .cloud .suffixes .storage_endpoint ) # pylint: disable=no-member
747748
748749 def _enable_storage_analytics (self , storage_account_name , key ):
749750 storage_client = self ._get_storage_client (storage_account_name , key )
750- service_properties = storage_client .get_blob_service_properties ()
751+ service_properties = storage_client .get_service_properties ()
751752 if not EnhancedMonitoring ._check_storage_analytics (service_properties ):
752- t_logging , t_retention_policy , t_metrics = get_sdk (self ._cmd .cli_ctx , ResourceType .DATA_STORAGE , 'Logging' ,
753- 'RetentionPolicy' , 'Metrics' , mod = 'common.models' )
753+ t_logging , t_retention_policy , t_metrics = get_sdk (self ._cmd .cli_ctx , ResourceType .DATA_STORAGE_BLOB ,
754+ 'BlobAnalyticsLogging' , 'RetentionPolicy' , 'Metrics' ,
755+ mod = '_models' )
754756 retention_policy = t_retention_policy (enabled = True , days = 13 )
755757 logging = t_logging (delete = True , read = True , write = True , retention_policy = retention_policy )
756758 minute_metrics = t_metrics (enabled = True , include_apis = True , retention_policy = retention_policy )
757759 if getattr (service_properties , 'hour_metrics' , None ):
758760 service_properties .hour_metrics .retention_policy .days = 13
759- storage_client .set_blob_service_properties ( logging , minute_metrics = minute_metrics ,
760- hour_metrics = service_properties .hour_metrics )
761+ storage_client .set_service_properties ( analytics_logging = logging , minute_metrics = minute_metrics ,
762+ hour_metrics = service_properties .hour_metrics )
761763
762764 @staticmethod
763765 def _check_storage_analytics (service_properties ):
764- return (service_properties and service_properties .logging and
766+ return (service_properties and service_properties .analytics_logging and
765767 service_properties .minute_metrics and service_properties .minute_metrics .include_apis and
766768 service_properties .minute_metrics .retention_policy .days )
767769
768770 def _check_table_and_content (self , storage_account_name , key , table_name ,
769771 filter_string , timeout_in_minutes ):
770772 sleep_period = 15
771- TableService = get_sdk (self ._cmd .cli_ctx , ResourceType .DATA_COSMOS_TABLE , 'table#TableService' )
773+ TableService = get_sdk (self ._cmd .cli_ctx , ResourceType .DATA_STORAGE_TABLE ,
774+ '_table_service_client#TableServiceClient' )
772775 table_client = get_data_service_client (
773776 self ._cmd .cli_ctx ,
774777 TableService ,
0 commit comments