Skip to content

AddAzureRMLogProfile - Angshuman patch 2 #4429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 24, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ schema: 2.0.0
# Add-AzureRmLogProfile

## SYNOPSIS
Creates a log profile.
Creates a new activity log profile. This profile is used to either archive the activity log to an Azure storage account or stream it to an Azure event hub in the same subscription.

- **Storage Account** - Only standard storage account (premium storage account is not supported) is supported. It could either be of type ARM or Classic. If it's logged to a storage account, the cost of storing the activity log is billed at normal standard storage rates. There could be only one log profile per subscription consequentially only one storage account per subscription can be used to export activity log.

- **Event Hub** - There could be only one log profile per subscription consequentially only one event hub per subscription can be used to export activity log. If activity log is streamed to an event hub, standard event hub pricing will apply.

In the activity log, events can pertain to a region or could be "Global". Global essentially means these events are region agnostics and are independent of region, in fact majority of events fall into this category. If the activity log profile is set from the portal, it implicitly adds "Global" along with any other region selected in the user interface. When using the cmdlet, the location as "Global" must be explicitly mentioned apart from any other region.

**Note** :- **Failing to set "Global" in the locations will result in a majority of activity log not getting exported.**

## SYNTAX

Expand All @@ -22,10 +30,9 @@ Add-AzureRmLogProfile -Name <String> [-StorageAccountId <String>] [-ServiceBusRu
The **Add-AzureRmLogProfile** cmdlet creates a log profile.

## EXAMPLES

### 1:
```

### Example 1 : Add a new log profile to export the activity log matching the location condition to a storage account
```yaml
Add-AzureRmLogProfile -Locations "Global","West US" -Name ExportLogProfile -StorageAccountId /subscriptions/40gpe80s-9sb7-4f07-9042-b1b6a92ja9fk/resourceGroups/activitylogRG/providers/Microsoft.Storage/storageAccounts/activitylogstorageaccount
```

## PARAMETERS
Expand All @@ -46,7 +53,10 @@ Accept wildcard characters: False
```

### -Locations
Specifies the list of locations.
Specifies the location of the log profile.
Valid values: Run below cmdlet to get the latest list of locations.

Get-AzureLocation | Select DisplayName

```yaml
Type: System.Collections.Generic.List`1[System.String]
Expand Down Expand Up @@ -76,7 +86,7 @@ Accept wildcard characters: False
```

### -RetentionInDays
Specifies the retention policy, in days.
Specifies the retention policy, in days. This is the number of days the logs are preserved in the storage account specified. To retain the data forever set this to **0**. If it's not specified, then it defaults to **0**. Normal standard storage or event hub billing rates will apply for data retention.

```yaml
Type: Int32
Expand Down Expand Up @@ -106,7 +116,9 @@ Accept wildcard characters: False
```

### -StorageAccountId
Specifies the ID of the Storage account.
Specifies the ID of the Storage account. ID is the fully qualified Resource ID of the storage account for example

/subscriptions/40gpe80s-9sb7-4f07-9042-b1b6a92ja9fk/resourceGroups/activitylogRG/providers/Microsoft.Storage/storageAccounts/activitylogstorageaccount

```yaml
Type: String
Expand Down