コード例 #1
0
        public virtual PSStorageInsight UpdatePSStorageInsight(UpdatePSStorageInsightParameters parameters)
        {
            // Get the existing storage insight
            StorageInsight storageInsight = OperationalInsightsManagementClient.StorageInsights.Get(parameters.ResourceGroupName, parameters.WorkspaceName, parameters.Name);

            // Execute the update
            StorageInsight updatedStorageInsight = CreateOrUpdateStorageInsight(
                parameters.ResourceGroupName,
                parameters.WorkspaceName,
                storageInsight.Name,
                storageInsight.StorageAccount.Id,
                string.IsNullOrWhiteSpace(parameters.StorageAccountKey) ? storageInsight.StorageAccount.Key : parameters.StorageAccountKey,
                parameters.Tables ?? storageInsight.Tables.ToList(),
                parameters.Containers ?? storageInsight.Containers.ToList());

            return(new PSStorageInsight(updatedStorageInsight, parameters.ResourceGroupName, parameters.WorkspaceName));
        }
        public virtual PSStorageInsight UpdatePSStorageInsight(UpdatePSStorageInsightParameters parameters)
        {
            // Get the existing storage insight
            StorageInsightGetResponse response = OperationalInsightsManagementClient.StorageInsights.Get(parameters.ResourceGroupName, parameters.WorkspaceName, parameters.Name);
            StorageInsight storageInsight = response.StorageInsight;

            // Execute the update
            StorageInsight updatedStorageInsight = CreateOrUpdateStorageInsight(
                parameters.ResourceGroupName, 
                parameters.WorkspaceName,
                storageInsight.Name, 
                storageInsight.Properties.StorageAccount.Id, 
                string.IsNullOrWhiteSpace(parameters.StorageAccountKey) ? storageInsight.Properties.StorageAccount.Key : parameters.StorageAccountKey, 
                parameters.Tables ?? storageInsight.Properties.Tables.ToList(), 
                parameters.Containers ?? storageInsight.Properties.Containers.ToList());

            return new PSStorageInsight(updatedStorageInsight, parameters.ResourceGroupName, parameters.WorkspaceName);
        }