Удаляет веб-тест Application Insights.
DELETE https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}?api-version=2022-06-15
Параметры URI
Имя |
В |
Обязательно |
Тип |
Описание |
resourceGroupName
|
path |
True
|
string
|
Имя группы ресурсов. Регистр букв в имени не учитывается.
|
subscriptionId
|
path |
True
|
string
|
Идентификатор целевой подписки.
|
webTestName
|
path |
True
|
string
|
Имя ресурса WebTest Application Insights.
|
api-version
|
query |
True
|
string
|
Версия API, используемая для данной операции.
|
Ответы
Имя |
Тип |
Описание |
200 OK
|
|
Успешный запрос на удаление определения веб-теста.
|
204 No Content
|
|
Нет содержимого: запрос выполнен успешно, но ответ пуст (запрос на удаление завершился сбоем, так как указанный веб-тест не существует).
|
Безопасность
azure_auth
Поток OAuth2 в Azure Active Directory.
Тип:
oauth2
Flow:
implicit
URL-адрес авторизации:
https://login.microsoftonline.com/common/oauth2/authorize
Области
Имя |
Описание |
user_impersonation
|
олицетворения учетной записи пользователя
|
Примеры
webTestDelete
Образец запроса
DELETE https://management.azure.com/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/webtests/my-webtest-01-mywebservice?api-version=2022-06-15
/** Samples for WebTests Delete. */
public final class Main {
/*
* x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/WebTestDelete.json
*/
/**
* Sample code: webTestDelete.
*
* @param manager Entry point to ApplicationInsightsManager.
*/
public static void webTestDelete(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) {
manager
.webTests()
.deleteByResourceGroupWithResponse(
"my-resource-group", "my-webtest-01-mywebservice", 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.applicationinsights import ApplicationInsightsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-applicationinsights
# USAGE
python web_test_delete.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 = ApplicationInsightsManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.web_tests.delete(
resource_group_name="my-resource-group",
web_test_name="my-webtest-01-mywebservice",
)
print(response)
# x-ms-original-file: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/WebTestDelete.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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ApplicationInsights.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.ApplicationInsights;
// Generated from example definition: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/WebTestDelete.json
// this example is just showing the usage of "WebTests_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://learn.microsoft.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 ApplicationInsightsWebTestResource created on azure
// for more information of creating ApplicationInsightsWebTestResource, please refer to the document of ApplicationInsightsWebTestResource
string subscriptionId = "subid";
string resourceGroupName = "my-resource-group";
string webTestName = "my-webtest-01-mywebservice";
ResourceIdentifier applicationInsightsWebTestResourceId = ApplicationInsightsWebTestResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, webTestName);
ApplicationInsightsWebTestResource applicationInsightsWebTest = client.GetApplicationInsightsWebTestResource(applicationInsightsWebTestResourceId);
// invoke the operation
await applicationInsightsWebTest.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