Deletes a specific version from a Template Spec. When operation completes, status code 200 returned without content.
DELETE https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/templateSpecs/{templateSpecName}/versions/{templateSpecVersion}?api-version=2021-05-01
URI Parameters
Name |
In |
Required |
Type |
Description |
resourceGroupName
|
path |
True
|
string
|
The name of the resource group. The name is case insensitive.
Regex pattern: ^[-\w\._\(\)]+$
|
subscriptionId
|
path |
True
|
string
|
Subscription Id which forms part of the URI for every service call.
|
templateSpecName
|
path |
True
|
string
|
Name of the Template Spec.
Regex pattern: ^[-\w\._\(\)]+$
|
templateSpecVersion
|
path |
True
|
string
|
The version of the Template Spec.
Regex pattern: ^[-\w\._\(\)]+$
|
api-version
|
query |
True
|
string
|
Client Api version.
|
Responses
Name |
Type |
Description |
200 OK
|
|
OK - Template Spec Version deleted.
|
204 No Content
|
|
Template Spec Version does not exist.
|
Other Status Codes
|
TemplateSpecsError
|
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
TemplateSpecVersionsDelete
Sample Request
DELETE https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/templateSpecRG/providers/Microsoft.Resources/templateSpecs/simpleTemplateSpec/versions/v1.0?api-version=2021-05-01
package armtemplatespecs_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armtemplatespecs"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/resources/resource-manager/Microsoft.Resources/stable/2021-05-01/examples/TemplateSpecVersionsDelete.json
func ExampleTemplateSpecVersionsClient_Delete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
return
}
ctx := context.Background()
client, err := armtemplatespecs.NewTemplateSpecVersionsClient("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
return
}
_, err = client.Delete(ctx,
"<resource-group-name>",
"<template-spec-name>",
"<template-spec-version>",
nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
return
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { TemplateSpecsClient } = require("@azure/arm-templatespecs");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Deletes a specific version from a Template Spec. When operation completes, status code 200 returned without content.
*
* @summary Deletes a specific version from a Template Spec. When operation completes, status code 200 returned without content.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2021-05-01/examples/TemplateSpecVersionsDelete.json
*/
async function templateSpecVersionsDelete() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const resourceGroupName = "templateSpecRG";
const templateSpecName = "simpleTemplateSpec";
const templateSpecVersion = "v1.0";
const credential = new DefaultAzureCredential();
const client = new TemplateSpecsClient(credential, subscriptionId);
const result = await client.templateSpecVersions.delete(
resourceGroupName,
templateSpecName,
templateSpecVersion
);
console.log(result);
}
templateSpecVersionsDelete().catch(console.error);
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Resources.Models;
// Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2021-05-01/examples/TemplateSpecVersionsDelete.json
// this example is just showing the usage of "TemplateSpecVersions_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 TemplateSpecVersionResource created on azure
// for more information of creating TemplateSpecVersionResource, please refer to the document of TemplateSpecVersionResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "templateSpecRG";
string templateSpecName = "simpleTemplateSpec";
string templateSpecVersion = "v1.0";
ResourceIdentifier templateSpecVersionResourceId = TemplateSpecVersionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, templateSpecName, templateSpecVersion);
TemplateSpecVersionResource templateSpecVersion0 = client.GetTemplateSpecVersionResource(templateSpecVersionResourceId);
// invoke the operation
await templateSpecVersion0.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
Definitions
ErrorAdditionalInfo
The resource management error additional info.
Name |
Type |
Description |
info
|
object
|
The additional info.
|
type
|
string
|
The additional info type.
|
ErrorResponse
Error Response
Name |
Type |
Description |
additionalInfo
|
ErrorAdditionalInfo[]
|
The error additional info.
|
code
|
string
|
The error code.
|
details
|
ErrorResponse[]
|
The error details.
|
message
|
string
|
The error message.
|
target
|
string
|
The error target.
|
TemplateSpecsError
Template Specs error response.
Name |
Type |
Description |
error
|
ErrorResponse
|
Error Response
Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)
|