Azure / azure-cli

Azure Command-Line Interface
MIT License
4.03k stars 3.01k forks source link

"Microsoft.Maintenance/configurationAssignments" BICEP giving unexpected generic error suddenly withot code changes #28471

Closed zenturash closed 9 months ago

zenturash commented 9 months ago

Describe the bug

Hi team, previously I have been able to deploy dynamic scope for maintenance configuration using bicep templates, but within the last couple of weeks it stopped working without any code changes to the deployment scripts we have developed please look at this.

it just gives me a InternalServerError with the message "An error has occurred"

Related command

@description('Location of the Resource Group') param location string

@description('rebootSetting: If a reboot is required after installation of updates') param rebootSetting string

@description('Date plus one') param currentDatePlusOne string

@description('Date plus one') param dateTimeToStart string = '${currentDatePlusOne} 02:00'

@description('Sunday maintenance name') param maintenanceNameSunday string

@description('Saturday maintenance name') param maintenanceNameSaturday string

@description('duration of the maintenance window') param maintenanceWindowduration string = '03:00'

@description('maintenance scope: InGuestPatch') param maintenanceScope string

@description('maintenance time zone: Romance Standard Time') param maintenanceTimeZone string

@description('patch day name: Saturday') param patchDayNameSaturday string

@description('patch day name: Sunday') param patchDayNameSunday string

@description(' in guest patch mode: User') param inGuestPatchMode string

@description('Os types: Linux') param osTypesLinux string

@description('Os types: Windows') param osTypesWindows string

@description('resource types: virtualMachines') param resourceTypesVm string

@description('resource types: ArcServers') param resourceTypesArcServers string

@description('Search filter foreach dynamic group') param filterOperator string

// === Saturday configuration === resource Saturday0200 'Microsoft.Maintenance/maintenanceConfigurations@2023-04-01' = { name: maintenanceNameSaturday location: location properties: { extensionProperties: { InGuestPatchMode: inGuestPatchMode } installPatches: { linuxParameters: { classificationsToInclude: [ 'Security' 'Critical' ] } rebootSetting: rebootSetting windowsParameters: { classificationsToInclude: [ 'Critical' 'Security' 'UpdateRollup' 'FeaturePack' 'ServicePack' 'Definition' 'Tools' 'Updates' ] excludeKbsRequiringReboot: false } } maintenanceScope: maintenanceScope maintenanceWindow: { duration: maintenanceWindowduration expirationDateTime: null recurEvery: '1Week ${patchDayNameSaturday}' startDateTime: dateTimeToStart timeZone: maintenanceTimeZone } } }

// === Sunday configuration === resource Sunday0200 'Microsoft.Maintenance/maintenanceConfigurations@2023-04-01' = { name: maintenanceNameSunday location: location properties: { extensionProperties: { InGuestPatchMode: inGuestPatchMode } installPatches: { linuxParameters: { classificationsToInclude: [ 'Security' 'Critical' ] } rebootSetting: rebootSetting windowsParameters: { classificationsToInclude: [ 'Critical' 'Security' 'UpdateRollup' 'FeaturePack' 'ServicePack' 'Definition' 'Tools' 'Updates' ] excludeKbsRequiringReboot: false } } maintenanceScope: maintenanceScope maintenanceWindow: { duration: maintenanceWindowduration expirationDateTime: null recurEvery: '1Week ${patchDayNameSunday}' startDateTime: dateTimeToStart timeZone: maintenanceTimeZone } } }

resource Saturday0200Group 'Microsoft.Maintenance/configurationAssignments@2023-04-01' = { name: '${maintenanceNameSaturday}-filter' properties: { filter: { osTypes: [ osTypesLinux osTypesWindows ] resourceTypes: [ resourceTypesVm resourceTypesArcServers ] tagSettings: { filterOperator: filterOperator tags: { Patch: [ maintenanceNameSaturday ] } } } maintenanceConfigurationId: Saturday0200.id } }

resource Sunday0200Group 'Microsoft.Maintenance/configurationAssignments@2023-04-01' = { name: '${maintenanceNameSunday}-filter' properties: { filter: { osTypes: [ osTypesLinux osTypesWindows ] resourceTypes: [ resourceTypesVm resourceTypesArcServers ] tagSettings: { filterOperator: filterOperator tags: { Patch: [ maintenanceNameSunday ] } } } maintenanceConfigurationId: Sunday0200.id } }

Errors

{ "status": "Failed", "error": { "message": "An error has occurred." } }

Issue script & Debug output

{ "status": "Failed", "error": { "message": "An error has occurred." } }

Expected behavior

it should return status OK

Environment Summary

azure-cli 2.57.0

core 2.57.0 telemetry 1.1.0

Dependencies: msal 1.26.0 azure-mgmt-resource 23.1.0b2

Bicep CLI version 0.25.53 (c0ad57dff6)

2.15.0 Microsoft.Graph.ChangeNotifications PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.DeviceManagement.E… PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.Notes PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.CrossDeviceExperie… PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.DeviceManagement.F… PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.Identity.Directory… PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.Identity.Partner PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.SchemaExtensions PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.DeviceManagement.A… PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.Bookings PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.Authentication PSGallery Microsoft Graph PowerShell Authentication Module. 2.15.0 Microsoft.Graph.DeviceManagement.A… PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.DeviceManagement PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.CloudCommunications PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.Mail PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.Sites PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph PSGallery Microsoft Graph PowerShell module 6.15.1 Az.Resources PSGallery Microsoft Azure PowerShell - Azure Resource Manager and Active Directory cmdlets in Windows PowerShell and PowerShell Core. Manages subscriptions, tenants, resource groups, deployment templates, providers, and resource… 2.15.0 Microsoft.Graph.Calendar PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.Compliance PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.Identity.Governance PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.Teams PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.Reports PSGallery Microsoft Graph PowerShell Cmdlets 7.1.1 Az.Compute PSGallery Microsoft Azure PowerShell - Compute service cmdlets for Azure Resource Manager in Windows PowerShell and PowerShell Core. Manages virtual machines, hosted services, and related resources in Azure Resource Manager.… 2.15.0 Microsoft.Graph.People PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.Users PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.Applications PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.Users.Actions PSGallery Microsoft Graph PowerShell Cmdlets 2.15.1 Az.Accounts PSGallery Microsoft Azure PowerShell - Accounts credential management cmdlets for Azure Resource Manager in Windows PowerShell and PowerShell Core.… 2.15.0 Microsoft.Graph.Identity.SignIns PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.Search PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.Files PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.Groups PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.Users.Functions PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.Devices.CloudPrint PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.Education PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.DirectoryObjects PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.Planner PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.Devices.ServiceAnn… PSGallery Microsoft Graph PowerShell Cmdlets 7.4.0 Az.Network PSGallery Microsoft Azure PowerShell - Networking service cmdlets for Azure Resource Manager in Windows PowerShell and PowerShell Core.… 2.15.0 Microsoft.Graph.PersonalContacts PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.Security PSGallery Microsoft Graph PowerShell Cmdlets 2.15.0 Microsoft.Graph.Devices.CorporateM… PSGallery Microsoft Graph PowerShell Cmdlets

Additional context

No response

yonzhan commented 9 months ago

Thank you for opening this issue, we will look into it.

zenturash commented 9 months ago

I also raised an issues regarding this with the BICEP team: https://github.com/Azure/bicep/issues/13463

polatengin commented 9 months ago

This issue is resolved in the bicep repo ; https://github.com/Azure/bicep/issues/13463#issuecomment-1971233829

I can't close this issue, can I get help to close it @yonzhan , since the same issue on the bicep repo is also closed.