Security Contacts - Delete
Delete security contact configurations for the subscription
DELETE https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/default?api-version=2023-12-01-preview
URI Parameters
Name
In
Required
Type
Description
securityContactName
path
True
securityContactName
minLength: 7 maxLength: 7 pattern: ^(default)$
Name of the security contact object
subscriptionId
path
True
string
pattern: ^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$
Azure subscription ID
api-version
query
True
string
API version for the operation
Responses
Name
Type
Description
200 OK
Security contact deleted
204 No Content
Security contact was not found
Other Status Codes
CloudError
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
Sample request
DELETE https://management.azure.com/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/securityContacts/default?api-version=2023-12-01-preview
import com.azure.resourcemanager.security.models.SecurityContactName;
/**
* Samples for SecurityContacts Delete.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/SecurityContacts/
* DeleteSecurityContact_example.json
*/
/**
* Sample code: Deletes a security contact data.
*
* @param manager Entry point to SecurityManager.
*/
public static void deletesASecurityContactData(com.azure.resourcemanager.security.SecurityManager manager) {
manager.securityContacts().deleteWithResponse(SecurityContactName.DEFAULT, com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation . To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.security import SecurityCenter
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-security
# USAGE
python delete_security_contact_example.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SecurityCenter(
credential=DefaultAzureCredential(),
subscription_id="20ff7fc3-e762-44dd-bd96-b71116dcdc23",
)
client.security_contacts.delete(
security_contact_name="default",
)
# x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/SecurityContacts/DeleteSecurityContact_example.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation . To provide feedback on this code sample, open a GitHub issue
package armsecurity_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/SecurityContacts/DeleteSecurityContact_example.json
func ExampleContactsClient_Delete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsecurity.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewContactsClient().Delete(ctx, armsecurity.SecurityContactNameDefault, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
}
To use the Azure SDK library in your project, see this documentation . To provide feedback on this code sample, open a GitHub issue
const { SecurityCenter } = require("@azure/arm-security");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Delete security contact configurations for the subscription
*
* @summary Delete security contact configurations for the subscription
* x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/SecurityContacts/DeleteSecurityContact_example.json
*/
async function deletesASecurityContactData() {
const subscriptionId =
process.env["SECURITY_SUBSCRIPTION_ID"] || "20ff7fc3-e762-44dd-bd96-b71116dcdc23";
const securityContactName = "default";
const credential = new DefaultAzureCredential();
const client = new SecurityCenter(credential, subscriptionId);
const result = await client.securityContacts.delete(securityContactName);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation . To provide feedback on this code sample, open a GitHub issue
Definitions
Name
Description
CloudError
Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).
CloudErrorBody
The error detail.
ErrorAdditionalInfo
The resource management error additional info.
securityContactName
Name of the security contact object
CloudError
Object
Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).
Name
Type
Description
error.additionalInfo
ErrorAdditionalInfo []
The error additional info.
error.code
string
The error code.
error.details
CloudErrorBody []
The error details.
error.message
string
The error message.
error.target
string
The error target.
CloudErrorBody
Object
The error detail.
Name
Type
Description
additionalInfo
ErrorAdditionalInfo []
The error additional info.
code
string
The error code.
details
CloudErrorBody []
The error details.
message
string
The error message.
target
string
The error target.
ErrorAdditionalInfo
Object
The resource management error additional info.
Name
Type
Description
info
object
The additional info.
type
string
The additional info type.
Enumeration
Name of the security contact object
Value
Description
default
The single applicable name of the security contact object