Deletes an existing attestation at subscription scope.
DELETE https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/attestations/{attestationName}?api-version=2022-09-01
URI Parameters
Name |
In |
Required |
Type |
Description |
attestationName
|
path |
True
|
string
|
The name of the attestation.
|
subscriptionId
|
path |
True
|
string
|
The ID of the target subscription.
|
api-version
|
query |
True
|
string
|
The API version to use for this operation.
|
Responses
Name |
Type |
Description |
200 OK
|
|
The attestation was successfully deleted.
|
204 No Content
|
|
The attestation did not exist.
|
Other Status Codes
|
ErrorResponse
|
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
Delete attestation at subscription scope
Sample request
DELETE https://management.azure.com/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/providers/Microsoft.PolicyInsights/attestations/790996e6-9871-4b1f-9cd9-ec42cd6ced1e?api-version=2022-09-01
/**
* Samples for Attestations DeleteAtSubscription.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/
* Attestations_DeleteSubscriptionScope.json
*/
/**
* Sample code: Delete attestation at subscription scope.
*
* @param manager Entry point to PolicyInsightsManager.
*/
public static void
deleteAttestationAtSubscriptionScope(com.azure.resourcemanager.policyinsights.PolicyInsightsManager manager) {
manager.attestations().deleteAtSubscriptionWithResponse("790996e6-9871-4b1f-9cd9-ec42cd6ced1e",
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.policyinsights import PolicyInsightsClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-policyinsights
# USAGE
python attestations_delete_subscription_scope.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 = PolicyInsightsClient(
credential=DefaultAzureCredential(),
subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2",
)
response = client.attestations.delete_at_subscription(
attestation_name="790996e6-9871-4b1f-9cd9-ec42cd6ced1e",
)
print(response)
# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_DeleteSubscriptionScope.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 armpolicyinsights_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/policyinsights/armpolicyinsights"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/05a9cdab363b8ec824094ee73950c04594325172/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_DeleteSubscriptionScope.json
func ExampleAttestationsClient_DeleteAtSubscription() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armpolicyinsights.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewAttestationsClient().DeleteAtSubscription(ctx, "790996e6-9871-4b1f-9cd9-ec42cd6ced1e", 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 { PolicyInsightsClient } = require("@azure/arm-policyinsights");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Deletes an existing attestation at subscription scope.
*
* @summary Deletes an existing attestation at subscription scope.
* x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_DeleteSubscriptionScope.json
*/
async function deleteAttestationAtSubscriptionScope() {
const subscriptionId =
process.env["POLICYINSIGHTS_SUBSCRIPTION_ID"] || "35ee058e-5fa0-414c-8145-3ebb8d09b6e2";
const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e";
const credential = new DefaultAzureCredential();
const client = new PolicyInsightsClient(credential, subscriptionId);
const result = await client.attestations.deleteAtSubscription(attestationName);
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
ErrorDefinition
Error definition.
Name |
Type |
Description |
additionalInfo
|
TypedErrorInfo[]
|
Additional scenario specific error details.
|
code
|
string
|
Service specific error code which serves as the substatus for the HTTP error code.
|
details
|
ErrorDefinition[]
|
Internal error details.
|
message
|
string
|
Description of the error.
|
target
|
string
|
The target of the error.
|
ErrorResponse
Error response.
TypedErrorInfo
Scenario specific error details.
Name |
Type |
Description |
info
|
|
The scenario specific error details.
|
type
|
string
|
The type of included error details.
|