Errors \ Missing information in docs
The documentation suggests that you can pass in a configuration file when working with Azure Automanage with the CLI.
I've created a configuration-test.json file with this information:
{ "Antimalware/Enable": true, "Antimalware/Exclusions/Paths": "", "Antimalware/Exclusions/Extensions": "", "Antimalware/Exclusions/Processes": "", "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/ScheduleRunTimes": [ "2023-03-20T12:00:00Z" ], "Backup/SchedulePolicy/SchedulePolicyType": "SimpleSchedulePolicy", "Backup/RetentionPolicy/RetentionPolicyType": "LongTermRetentionPolicy", "Backup/RetentionPolicy/DailySchedule/RetentionTimes": [ "2023-03-20T12:00:00Z" ], "Backup/RetentionPolicy/DailySchedule/RetentionDuration/Count": 180, "Backup/RetentionPolicy/DailySchedule/RetentionDuration/DurationType": "Days", "WindowsAdminCenter/Enable": false, "VMInsights/Enable": true, "DefenderForCloud/Enable": true, "UpdateManagement/Enable": false, "ChangeTrackingAndInventory/Enable": false, "GuestConfiguration/Enable": false, "AutomationAccount/Enable": false, "LogAnalytics/Enable": true, "LogAnalytics/Workspace": "/subscriptions/baba41cf-c01d-4a55-b6c5-ca494b802be5/resourceGroups/demo-test/providers/Microsoft.OperationalInsights/workspaces/platform-logs", "LogAnalytics/Reprovision": true, "BootDiagnostics/Enable": true }
The command run was the following:
az automanage configuration-profile create -n test-config1 -g demo-test --configuration configuration-profile.json --location uksouth
This is the error I get:

This log analytics workspace DOES exist. What am I missing? It is the following the suggested syntax in the docs.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: 1c7867eb-90ad-14ce-bcf5-5cb493d1aa98
- Version Independent ID: 29d786f5-5b68-6bf4-9545-283b4fa1dc62
- Content: az automanage configuration-profile
- Content Source: latest/docs-ref-autogen/automanage/configuration-profile.yml
- GitHub Login: @rloutlaw
- Microsoft Alias: routlaw
@calvinhzy for awareness
@georgeollis Wondering if the logged in user have access to the workspace as the error code said forbidden. Have you tried the command without log analytics params and did that work? Including service team to take a look as well.
@georgeollis Wondering if the logged in user have access to the workspace as the error code said forbidden. Have you tried the command without log analytics params and did that work? Including service team to take a look as well.
@calvinhzy
The user has full owner permissions on the subscription.
If I remove the workspace, I get the issue that it's required if I also have reprovision added.
After removing both Workspace and Reprovsion, the deployment works successfully. However, I need the ability to specify an existing LA workspace.
Wrote a bicep file
param customProfileName string param location string param logAnalyticsWorkspace string param LogAnalyticsBehavior bool = false
resource customProfile 'Microsoft.Automanage/configurationProfiles@2022-05-04' = { name: customProfileName location: location properties: { configuration: { 'BootDiagnostics/Enable': true 'LogAnalytics/Enable': true 'LogAnalytics/Reprovision': LogAnalyticsBehavior 'LogAnalytics/Workspace': logAnalyticsWorkspace 'UpdateManagement/Enable': true 'VMInsights/Enable': true } } }
New-AzDeployment -TemplateFile ./test.bicep -Location uksouth -Name "test" -TemplateParameterObject @{ customProfileName = "Test"; location = "uksouth"; logAnalyticsWorkspace = "/subscriptions/baba41cf-c01d-4a55-b6c5-ca494b802be5/resourceGroups/demo-test/providers/Microsoft.OperationalInsights/workspaces/platform-logs"; LogAnalyticsBehavior = $true }
This works, which confirms I have the correct access. Is there an issue with Azure CLI?
Hey @georgeollis. Automanage engineer here.
I've just tested creating a profile with the LogAnalytics parameters and everything seems to be working fine. I did run into a forbidden issue, but I solved it by running az login --use-device-code and then set my subscription with az account set --subscription <subId>. After that I was able to create a profile.
Will look into it @georgeollis, maybe something to do with CLI auth. Thanks.
@georgeollis I was able to get it working right away. Have you perhaps tried Andrew's suggestion?

It is possible the subscription has not been switched to be the default. You can check with this command az account show -n baba41cf-c01d-4a55-b6c5-ca494b802be5 and see if the field isDefault=true

I'm having the same issues here