Deletes a provided Microsoft Defender for Cloud pricing configuration in a specific resource. Valid only for resource scope (Supported resources are: 'VirtualMachines, VMSS and ARC MachinesS').
The identifier of the resource, (format: 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName})
api-version
query
True
string
API version for the operation
Responses
Name
Type
Description
200 OK
Successfully deleted the pricing configuration of the resource.
/**
* Samples for Pricings Delete.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/
* DeleteResourcePricing_example.json
*/
/**
* Sample code: Delete a pricing on resource.
*
* @param manager Entry point to SecurityManager.
*/
public static void deleteAPricingOnResource(com.azure.resourcemanager.security.SecurityManager manager) {
manager.pricings().deleteByResourceGroupWithResponse(
"subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1",
"VirtualMachines", com.azure.core.util.Context.NONE);
}
}
const { SecurityCenter } = require("@azure/arm-security");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Deletes a provided Microsoft Defender for Cloud pricing configuration in a specific resource. Valid only for resource scope (Supported resources are: 'VirtualMachines, VMSS and ARC MachinesS').
*
* @summary Deletes a provided Microsoft Defender for Cloud pricing configuration in a specific resource. Valid only for resource scope (Supported resources are: 'VirtualMachines, VMSS and ARC MachinesS').
* x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/DeleteResourcePricing_example.json
*/
async function deleteAPricingOnResource() {
const scopeId =
"subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1";
const pricingName = "VirtualMachines";
const credential = new DefaultAzureCredential();
const client = new SecurityCenter(credential);
const result = await client.pricings.delete(scopeId, pricingName);
console.log(result);
}
Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).
Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).