DELETE https://management.azure.com/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/providers/Microsoft.Insights/logprofiles/Rac46PostSwapRG?api-version=2016-03-01
/**
* Samples for LogProfiles Delete.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteLogProfile.json
*/
/**
* Sample code: Delete log profile.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void deleteLogProfile(com.azure.resourcemanager.AzureResourceManager azure) {
azure.diagnosticSettings().manager().serviceClient().getLogProfiles().deleteWithResponse("Rac46PostSwapRG",
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/stable/2016-03-01/examples/deleteLogProfile.json
func ExampleLogProfilesClient_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.NewLogProfilesClient().Delete(ctx, "Rac46PostSwapRG", 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 the log profile.
*
* @summary Deletes the log profile.
* x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteLogProfile.json
*/
async function deleteLogProfile() {
const subscriptionId =
process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3";
const logProfileName = "Rac46PostSwapRG";
const credential = new DefaultAzureCredential();
const client = new MonitorClient(credential, subscriptionId);
const result = await client.logProfiles.delete(logProfileName);
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/stable/2016-03-01/examples/deleteLogProfile.json
// this example is just showing the usage of "LogProfiles_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 LogProfileResource created on azure
// for more information of creating LogProfileResource, please refer to the document of LogProfileResource
string subscriptionId = "b67f7fec-69fc-4974-9099-a26bd6ffeda3";
string logProfileName = "Rac46PostSwapRG";
ResourceIdentifier logProfileResourceId = LogProfileResource.CreateResourceIdentifier(subscriptionId, logProfileName);
LogProfileResource logProfile = client.GetLogProfileResource(logProfileResourceId);
// invoke the operation
await logProfile.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