我之前使用 Terraform 创建并随后删除了 Azure API 管理服务。它消失在Azure Portal中。几个小时后,当我尝试使用相同名称重新创建 API 管理时,我在 Azure 门户中收到此错误:"name already in use. Please select a different name."
在 Terraform 中也遇到类似的错误。
任何人都知道为什么即使我在资源组中不再看到该名称,也无法重复使用该名称?
检查您的APIM服务是否被软删除 https://learn.microsoft.com/en-us/azure/api-management/soft-delete。如果资源已被软删除,并且您想创建同名的新资源,则需要清除该资源,然后重新创建。
按名称获取软删除实例:
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}?api-version=2020-06-01-preview
列出给定订阅的所有软删除实例:
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/deletedservices?api-version=2020-06-01-preview
恢复已删除的 APIM 实例:
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ApiManagement/service/{apimServiceName}?api-version=2020-06-01-preview
清除软删除的 APIM 实例:
DELETE https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}?api-version=2020-06-01-preview
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)