diff --git a/sdk/automanage/arm-automanage/README.md b/sdk/automanage/arm-automanage/README.md index 264fc03ebef4..12fe822430f5 100644 --- a/sdk/automanage/arm-automanage/README.md +++ b/sdk/automanage/arm-automanage/README.md @@ -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//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).