サブスクリプション レベルで管理ロックを削除します。
管理ロックを削除するには、Microsoft.Authorization/* または Microsoft.Authorization/locks/* アクションにアクセスできる必要があります。 組み込みロールのうち、所有者とユーザー アクセス管理者にのみこれらのアクションが許可されています。
DELETE https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}?api-version=2016-09-01
URI パラメーター
名前 |
/ |
必須 |
型 |
説明 |
lockName
|
path |
True
|
string
|
削除するロックの名前。
|
subscriptionId
|
path |
True
|
string
|
ターゲット サブスクリプションの ID。
|
api-version
|
query |
True
|
string
|
操作に使用する API バージョン。
|
応答
名前 |
型 |
説明 |
200 OK
|
|
OK
|
204 No Content
|
|
NoContent
|
セキュリティ
azure_auth
Azure Active Directory OAuth2 フロー
型:
oauth2
フロー:
implicit
Authorization URL (承認 URL):
https://login.microsoftonline.com/common/oauth2/authorize
スコープ
名前 |
説明 |
user_impersonation
|
ユーザー アカウントの借用
|
例
Delete management lock at subscription level
要求のサンプル
DELETE https://management.azure.com/subscriptions/subscriptionId/providers/Microsoft.Authorization/locks/testlock?api-version=2016-09-01
import com.azure.core.util.Context;
/** Samples for ManagementLocks DeleteAtSubscriptionLevel. */
public final class Main {
/*
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Authorization/stable/2016-09-01/examples/ManagementLocks_DeleteAtSubscriptionLevel.json
*/
/**
* Sample code: Delete management lock at subscription level.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void deleteManagementLockAtSubscriptionLevel(com.azure.resourcemanager.AzureResourceManager azure) {
azure
.genericResources()
.manager()
.managementLockClient()
.getManagementLocks()
.deleteAtSubscriptionLevelWithResponse("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_subscription_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_subscription_level(
lock_name="testlock",
)
# x-ms-original-file: specification/resources/resource-manager/Microsoft.Authorization/stable/2016-09-01/examples/ManagementLocks_DeleteAtSubscriptionLevel.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_DeleteAtSubscriptionLevel.json
*/
async function deleteManagementLockAtSubscriptionLevel() {
const subscriptionId = process.env["LOCKS_SUBSCRIPTION_ID"] || "subscriptionId";
const lockName = "testlock";
const credential = new DefaultAzureCredential();
const client = new ManagementLockClient(credential, subscriptionId);
const result = await client.managementLocks.deleteAtSubscriptionLevel(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