Alias verwijderen.
DELETE https://management.azure.com/providers/Microsoft.Subscription/aliases/{aliasName}?api-version=2021-10-01
URI-parameters
Name |
In |
Vereist |
Type |
Description |
aliasName
|
path |
True
|
string
|
AliasName is de naam voor de aanvraag voor het maken van een abonnement. Houd er rekening mee dat dit niet hetzelfde is als de abonnementsnaam en dat er geen andere levenscyclus nodig is dan de aanvraag voor het maken van een abonnement.
|
api-version
|
query |
True
|
string
|
Versie van de API die moet worden gebruikt met de clientaanvraag. Huidige versie is 2021-10-01
|
Antwoorden
Name |
Type |
Description |
200 OK
|
|
De alias is verwijderd
|
204 No Content
|
|
Alias bestaat niet
|
Other Status Codes
|
ErrorResponseBody
|
Foutreactie waarin wordt beschreven waarom de bewerking is mislukt.
|
Beveiliging
azure_auth
Azure Active Directory OAuth2-stroom
Type:
oauth2
Stroom:
implicit
Autorisatie-URL:
https://login.microsoftonline.com/common/oauth2/authorize
Bereiken
Name |
Description |
user_impersonation
|
uw gebruikersaccount imiteren
|
Voorbeelden
DeleteAlias
Voorbeeldaanvraag
DELETE https://management.azure.com/providers/Microsoft.Subscription/aliases/aliasForNewSub?api-version=2021-10-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.subscription import SubscriptionClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-subscription
# USAGE
python delete_alias.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 = SubscriptionClient(
credential=DefaultAzureCredential(),
)
response = client.alias.delete(
alias_name="aliasForNewSub",
)
print(response)
# x-ms-original-file: specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/deleteAlias.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 armsubscription_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/subscription/armsubscription"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/deleteAlias.json
func ExampleAliasClient_Delete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsubscription.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewAliasClient().Delete(ctx, "aliasForNewSub", 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 { SubscriptionClient } = require("@azure/arm-subscriptions");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Delete Alias.
*
* @summary Delete Alias.
* x-ms-original-file: specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/deleteAlias.json
*/
async function deleteAlias() {
const aliasName = "aliasForNewSub";
const credential = new DefaultAzureCredential();
const client = new SubscriptionClient(credential);
const result = await client.alias.delete(aliasName);
console.log(result);
}
deleteAlias().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.Subscription;
using Azure.ResourceManager.Subscription.Models;
// Generated from example definition: specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/deleteAlias.json
// this example is just showing the usage of "Alias_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 SubscriptionAliasResource created on azure
// for more information of creating SubscriptionAliasResource, please refer to the document of SubscriptionAliasResource
string aliasName = "aliasForNewSub";
ResourceIdentifier subscriptionAliasResourceId = SubscriptionAliasResource.CreateResourceIdentifier(aliasName);
SubscriptionAliasResource subscriptionAlias = client.GetSubscriptionAliasResource(subscriptionAliasResourceId);
// invoke the operation
await subscriptionAlias.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
Definities
Name |
Description |
ErrorResponse
|
Beschrijft de indeling van foutantwoord.
|
ErrorResponseBody
|
Foutreactie geeft aan dat de service de binnenkomende aanvraag niet kan verwerken. De reden wordt opgegeven in het foutbericht.
|
ErrorResponse
Object
Beschrijft de indeling van foutantwoord.
Name |
Type |
Description |
code
|
string
|
Foutcode
|
message
|
string
|
Foutbericht waarin wordt aangegeven waarom de bewerking is mislukt.
|
ErrorResponseBody
Object
Foutreactie geeft aan dat de service de binnenkomende aanvraag niet kan verwerken. De reden wordt opgegeven in het foutbericht.
Name |
Type |
Description |
code
|
string
|
Foutcode
|
error
|
ErrorResponse
|
De details van de fout.
|
message
|
string
|
Foutbericht waarin wordt aangegeven waarom de bewerking is mislukt.
|