Supprime le verrou de gestion d’une ressource ou de tout niveau en dessous de la ressource.
Pour supprimer des verrous de gestion, vous devez avoir accès aux actions Microsoft.Authorization/* ou Microsoft.Authorization/locks/*. Parmi les rôles prédéfinis, seuls les rôles Propriétaire et Administrateur de l'accès utilisateur peuvent effectuer ces actions.
DELETE https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}?api-version=2016-09-01
Paramètres URI
Nom |
Dans |
Obligatoire |
Type |
Description |
lockName
|
path |
True
|
string
|
Nom du verrou à supprimer.
|
parentResourcePath
|
path |
True
|
string
|
Identité de ressource parente.
|
resourceGroupName
|
path |
True
|
string
|
Nom du groupe de ressources contenant la ressource avec le verrou à supprimer.
Modèle d’expression régulière: ^[-\w\._\(\)]+$
|
resourceName
|
path |
True
|
string
|
Nom de la ressource avec le verrou à supprimer.
|
resourceProviderNamespace
|
path |
True
|
string
|
Espace de noms du fournisseur de ressources de la ressource avec le verrou à supprimer.
|
resourceType
|
path |
True
|
string
|
Type de ressource de la ressource avec le verrou à supprimer.
|
subscriptionId
|
path |
True
|
string
|
ID de l’abonnement cible.
|
api-version
|
query |
True
|
string
|
Version de l’API à utiliser pour l’opération.
|
Réponses
Nom |
Type |
Description |
200 OK
|
|
Ok
|
204 No Content
|
|
Pas de contenu
|
Sécurité
azure_auth
Flux OAuth2 Azure Active Directory
Type:
oauth2
Flux:
implicit
URL d’autorisation:
https://login.microsoftonline.com/common/oauth2/authorize
Étendues
Nom |
Description |
user_impersonation
|
Emprunter l’identité de votre compte d’utilisateur
|
Exemples
Delete management lock at resource level
Exemple de requête
DELETE https://management.azure.com/subscriptions/subscriptionId/resourcegroups/resourcegroupname/providers/Microsoft.Storage/parentResourcePath/storageAccounts/teststorageaccount/providers/Microsoft.Authorization/locks/testlock?api-version=2016-09-01
import com.azure.core.util.Context;
/** Samples for ManagementLocks DeleteAtResourceLevel. */
public final class Main {
/*
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Authorization/stable/2016-09-01/examples/ManagementLocks_DeleteAtResourceLevel.json
*/
/**
* Sample code: Delete management lock at resource level.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void deleteManagementLockAtResourceLevel(com.azure.resourcemanager.AzureResourceManager azure) {
azure
.genericResources()
.manager()
.managementLockClient()
.getManagementLocks()
.deleteAtResourceLevelWithResponse(
"resourcegroupname",
"Microsoft.Storage",
"parentResourcePath",
"storageAccounts",
"teststorageaccount",
"testlock",
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.resource import ManagementLockClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-resource
# USAGE
python management_locks_delete_at_resource_level.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 = ManagementLockClient(
credential=DefaultAzureCredential(),
subscription_id="subscriptionId",
)
client.management_locks.delete_at_resource_level(
resource_group_name="resourcegroupname",
resource_provider_namespace="Microsoft.Storage",
parent_resource_path="parentResourcePath",
resource_type="storageAccounts",
resource_name="teststorageaccount",
lock_name="testlock",
)
# x-ms-original-file: specification/resources/resource-manager/Microsoft.Authorization/stable/2016-09-01/examples/ManagementLocks_DeleteAtResourceLevel.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
const { ManagementLockClient } = require("@azure/arm-locks-profile-2020-09-01-hybrid");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions.
*
* @summary To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Authorization/stable/2016-09-01/examples/ManagementLocks_DeleteAtResourceLevel.json
*/
async function deleteManagementLockAtResourceLevel() {
const subscriptionId = process.env["LOCKS_SUBSCRIPTION_ID"] || "subscriptionId";
const resourceGroupName = process.env["LOCKS_RESOURCE_GROUP"] || "resourcegroupname";
const resourceProviderNamespace = "Microsoft.Storage";
const parentResourcePath = "parentResourcePath";
const resourceType = "storageAccounts";
const resourceName = "teststorageaccount";
const lockName = "testlock";
const credential = new DefaultAzureCredential();
const client = new ManagementLockClient(credential, subscriptionId);
const result = await client.managementLocks.deleteAtResourceLevel(
resourceGroupName,
resourceProviderNamespace,
parentResourcePath,
resourceType,
resourceName,
lockName
);
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