Skip to content
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
70 changes: 70 additions & 0 deletions sdk/automanage/arm-automanage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,76 @@ const client = new AutomanageClient(new DefaultAzureCredential(), subscriptionId
// const client = new AutomanageClient(credential, subscriptionId);
```

## Examples

#### Create or Update Configuration Profile

To update a file, simply replace any of the values within the **properties** and run the **createOrUpdate()** function again.

```javascript
const newProfile = {
"location": "eastus",
"tags": {
"environment": "prod"
},
"properties": {
"configuration": {
"Antimalware/Enable": true,
"Antimalware/EnableRealTimeProtection": true,
"Antimalware/RunScheduledScan": true,
"Antimalware/ScanType": "Quick",
"Antimalware/ScanDay": 7,
"Antimalware/ScanTimeInMinutes": 120,
"Backup/Enable": true,
"Backup/PolicyName": "dailyBackupPolicy",
"Backup/TimeZone": "UTC",
"Backup/InstantRpRetentionRangeInDays": 2,
"Backup/SchedulePolicy/ScheduleRunFrequency": "Daily",
"Backup/SchedulePolicy/SchedulePolicyType": "SimpleSchedulePolicy",
"Backup/RetentionPolicy/RetentionPolicyType": "LongTermRetentionPolicy",
"Backup/RetentionPolicy/DailySchedule/RetentionDuration/Count": 180,
"Backup/RetentionPolicy/DailySchedule/RetentionDuration/DurationType": "Days",
"WindowsAdminCenter/Enable": false,
"VMInsights/Enable": true,
"AzureSecurityCenter/Enable": true,
"UpdateManagement/Enable": true,
"ChangeTrackingAndInventory/Enable": true,
"GuestConfiguration/Enable": true,
"AutomationAccount/Enable": true,
"LogAnalytics/Enable": true,
"BootDiagnostics/Enable": true
}
}
}

await client.configurationProfiles.createOrUpdate("configurationProfileName", "resourceGroupName", newProfile);
```

#### Delete Configuration Profile
```javascript
await client.configurationProfiles.delete("resourceGroupName", "configurationProfileName");
```
#### Create Best Practices Production Profile Assignment
```javascript
let assignment = {
"properties": {
"configurationProfile": "/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesProduction"
}
}

await client.configurationProfileAssignments.createOrUpdate("default", "resourceGroupName", "vmName", assignment);
```

#### Create Custom Profile Assignment
```javascript
let assignment = {
"properties": {
"configurationProfile": "/subscriptions/<subscription ID>/resourceGroups/resourceGroupName/providers/Microsoft.Automanage/configurationProfiles/configurationProfileName"
}
}

await client.configurationProfileAssignments.createOrUpdate("default", "resourceGroupName", "vmName", assignment);
```

### JavaScript Bundle
To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling).
Expand Down