Suppressions - Create

Enables the snoozed or dismissed attribute of a recommendation. The snoozed or dismissed attribute is referred to as a suppression. Use this API to create or update the snoozed or dismissed status of a recommendation.

PUT https://management.azure.com/{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}?api-version=2023-01-01

URI Parameters

Name In Required Type Description
name
path True

string

The name of the suppression.

recommendationId
path True

string

The recommendation ID.

resourceUri
path True

string

The fully qualified Azure Resource Manager identifier of the resource to which the recommendation applies.

api-version
query True

string

The version of the API to be used with the client request.

Request Body

Name Type Description
properties.suppressionId

string

The GUID of the suppression.

properties.ttl

string

The duration for which the suppression is valid.

Responses

Name Type Description
200 OK

SuppressionContract

OK. Successfully created suppression.

404 Not Found

ArmErrorResponse

Recommendation to be suppressed is not found.

Other Status Codes

ArmErrorResponse

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

CreateSuppression

Sample request

PUT https://management.azure.com/resourceUri/providers/Microsoft.Advisor/recommendations/recommendationId/suppressions/suppressionName1?api-version=2023-01-01

{
  "properties": {
    "ttl": "07:00:00:00"
  }
}

Sample response

{
  "id": "/resourceUri/providers/Microsoft.Advisor/recommendations/recommendationId/suppressions/suppressionName1",
  "name": "suppressionName1",
  "type": "Microsoft.Advisor/suppressions",
  "properties": {
    "suppressionId": "suppressionId",
    "ttl": "07:00:00:00"
  }
}
{
  "error": {
    "code": "NotFound",
    "message": "Recommendation to be suppressed is not found. Subscription Id:{0} Recommendation Id:{1}"
  }
}

Definitions

Name Description
ArmErrorResponse
ARMErrorResponseBody

ARM error response body.

createdByType

The type of identity that created the resource.

SuppressionContract

The details of the snoozed or dismissed rule; for example, the duration, name, and GUID associated with the rule.

systemData

Metadata pertaining to creation and last modification of the resource.

ArmErrorResponse

Name Type Description
error

ARMErrorResponseBody

ARM error response body.

ARMErrorResponseBody

ARM error response body.

Name Type Description
code

string

Gets or sets the string that can be used to programmatically identify the error.

message

string

Gets or sets the string that describes the error in detail and provides debugging information.

createdByType

The type of identity that created the resource.

Name Type Description
Application

string

Key

string

ManagedIdentity

string

User

string

SuppressionContract

The details of the snoozed or dismissed rule; for example, the duration, name, and GUID associated with the rule.

Name Type Description
id

string

Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"

name

string

The name of the resource

properties.expirationTimeStamp

string

Gets or sets the expiration time stamp.

properties.suppressionId

string

The GUID of the suppression.

properties.ttl

string

The duration for which the suppression is valid.

systemData

systemData

Azure Resource Manager metadata containing createdBy and modifiedBy information.

type

string

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.