Azure / azure-rest-api-specs

The source for REST API specifications for Microsoft Azure.
MIT License
2.6k stars 5.01k forks source link

[BUG] Incorrect param name in Microsoft.Security securityContacts #29764

Open tony-box opened 1 month ago

tony-box commented 1 month ago

API Spec link

https://github.com/Azure/azure-rest-api-specs/blob/main/specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/securityContacts.json

API Spec version

2023-12-01-preview

Describe the bug

The parameter name notificationsSources in the API documentation is not accurate. If you try to deploy using notificationsSources the following error occurs:

2:27:12 PM - The deployment 'a-p-s-sc-max-t1-20240709T1407134082Z' failed with error(s). Showing 3 out of 3
     | error(s). Status Message: Unable to process template language expressions for resource
     | '/subscriptions/d86dcc28-52cd-4214-bc88-64b465508d8e/providers/Microsoft.Security/securityContacts/default' at
     | line '1' and column '3950'. 'The language expression property 'notificationSources' doesn't exist, available
     | properties are 'emails, isEnabled, notificationsByRole, notificationsSources, phone'.' (Code:InvalidTemplate)
     | Status Message: No HTTP resource was found that matches the request URI 

Instead, the API appears to be looking for notificationSources (note there is no letter 's' in 'notification'). If the parameter is changed to notificationSources, the deployment succeeds.

So either the documentation needs to be fixed to reflect the apporpriate parameter name, or the API needs to be updated to reflect what is in the documentation.

Expected behavior

Deploying with param name = notificationsSources succeeds

Actual behavior

Deploying with param name = notificationsSources fails with a message saying the deployment is missing a parameter named notificationSources

Reproduction Steps

Deploy a Microsoft.Security/securityContacts@2023-12-01-preview resource using the documented notificationsSources param, e.g.:

securityContactProperties: {
        emails: 'foo@contoso.com'
        isEnabled: false
        notificationsByRole: {
          roles: [
            'Contributor'
          ]
          state: 'Off'
        }
        notificationsSources: [
          {
            sourceType: 'AttackPath'
            minimalRiskLevel: 'Critical'
          }
        ]
        phone: '+12345678'
      }

Environment

No response

v-jiaodi commented 1 month ago

@Nessya123 Please help take a look.