Skip to content

Commit d93305b

Browse files
committed
Fixing a bug
1 parent d25fec5 commit d93305b

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

articles/storage/common/storage-analytics-metrics.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,27 @@ The cmdlets that control Storage Metrics use the following parameters:
8585
* **Service**: Collects metrics such as ingress/egress, availability, latency, and success percentages, which are aggregated for the blob, queue, table, and file services.
8686
* **ServiceAndApi**: In addition to the Service metrics, collects the same set of metrics for each storage operation in the Azure Storage service API.
8787

88-
For example, the following command switches on minute metrics for the blob service in your default storage account with the retention period set to five days:
88+
For example, the following command switches on minute metrics for the blob service in your storage account with the retention period set to five days:
89+
90+
[!NOTE]
91+
> This command assumes that you've signed into your Azure subscription by using the `Connect-AzAccount` command.
8992
9093
```
91-
Set-AzureStorageServiceMetricsProperty -MetricsType Minute
92-
-ServiceType Blob -MetricsLevel ServiceAndApi -RetentionDays 5
94+
$storageAccount = Get-AzStorageAccount -ResourceGroupName "<resource-group-name>" -AccountName "<storage-account-name>"
95+
96+
Set-AzureStorageServiceMetricsProperty -MetricsType Minute -ServiceType Blob -MetricsLevel ServiceAndApi -RetentionDays 5 -Context $storageAccount.Context
9397
```
9498

99+
* Replace the `<resource-group-name>` placeholder value with the name of your resource group.
100+
101+
* Replace the `<storage-account-name>` placeholder value with the name of your storage account.
102+
103+
104+
95105
The following command retrieves the current hourly metrics level and retention days for the blob service in your default storage account:
96106

97107
```
98-
Get-AzureStorageServiceMetricsProperty -MetricsType Hour
99-
-ServiceType Blob
108+
Get-AzureStorageServiceMetricsProperty -MetricsType Hour -ServiceType Blob -Context $storagecontext.Context
100109
```
101110

102111
For information about how to configure the Azure PowerShell cmdlets to work with your Azure subscription and how to select the default storage account to use, see: [How to install and configure Azure PowerShell](https://azure.microsoft.com/documentation/articles/install-configure-powershell/).

0 commit comments

Comments
 (0)