Elimina as definições de diagnóstico existentes para o recurso especificado.
DELETE https://management.azure.com/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}?api-version=2021-05-01-preview
Parâmetros do URI
Name |
Em |
Necessário |
Tipo |
Description |
name
|
path |
True
|
string
|
O nome da definição de diagnóstico.
|
resourceUri
|
path |
True
|
string
|
O identificador do recurso.
|
api-version
|
query |
True
|
string
|
A versão da API a utilizar para esta operação.
|
Respostas
Name |
Tipo |
Description |
200 OK
|
|
Pedido com êxito para remover uma definição de diagnóstico
|
204 No Content
|
|
Pedido com êxito para remover uma definição de diagnóstico
|
Other Status Codes
|
ErrorResponse
|
Resposta de erro que descreve o motivo pela qual a operação falhou.
|
Segurança
azure_auth
Fluxo OAuth2 do Azure Active Directory
Tipo:
oauth2
Fluxo:
implicit
URL de Autorização:
https://login.microsoftonline.com/common/oauth2/authorize
Âmbitos
Name |
Description |
user_impersonation
|
representar a sua conta de utilizador
|
Exemplos
Deletes the diagnostic setting
Pedido de amostra
DELETE https://management.azure.com/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6/providers/Microsoft.Insights/diagnosticSettings/mysetting?api-version=2021-05-01-preview
/**
* Samples for DiagnosticSettingsOperation Delete.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/
* deleteDiagnosticSetting.json
*/
/**
* Sample code: Deletes the diagnostic setting.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void deletesTheDiagnosticSetting(com.azure.resourcemanager.AzureResourceManager azure) {
azure.diagnosticSettings().manager().serviceClient().getDiagnosticSettingsOperations().deleteWithResponse(
"subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6",
"mysetting", 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
package armmonitor_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/deleteDiagnosticSetting.json
func ExampleDiagnosticSettingsClient_Delete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewDiagnosticSettingsClient().Delete(ctx, "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6", "mysetting", 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 { MonitorClient } = require("@azure/arm-monitor");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Deletes existing diagnostic settings for the specified resource.
*
* @summary Deletes existing diagnostic settings for the specified resource.
* x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/deleteDiagnosticSetting.json
*/
async function deletesTheDiagnosticSetting() {
const resourceUri =
"subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6";
const name = "mysetting";
const credential = new DefaultAzureCredential();
const client = new MonitorClient(credential);
const result = await client.diagnosticSettings.delete(resourceUri, name);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Monitor.Models;
using Azure.ResourceManager.Monitor;
// Generated from example definition: specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/deleteDiagnosticSetting.json
// this example is just showing the usage of "DiagnosticSettings_Delete" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://video2.skills-academy.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this DiagnosticSettingResource created on azure
// for more information of creating DiagnosticSettingResource, please refer to the document of DiagnosticSettingResource
string resourceUri = "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6";
string name = "mysetting";
ResourceIdentifier diagnosticSettingResourceId = DiagnosticSettingResource.CreateResourceIdentifier(resourceUri, name);
DiagnosticSettingResource diagnosticSetting = client.GetDiagnosticSettingResource(diagnosticSettingResourceId);
// invoke the operation
await diagnosticSetting.DeleteAsync(WaitUntil.Completed);
Console.WriteLine($"Succeeded");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Definições
ErrorResponse
Descreve o formato da resposta de Erro.
Name |
Tipo |
Description |
code
|
string
|
Código de erro
|
message
|
string
|
Mensagem de erro a indicar o motivo pela qual a operação falhou.
|