如何清除软删除的文本分析?

Pio*_*rak 5 azure azure-resource-manager azure-cognitive-services

为了测试 ARM 模板,我们首先将它们部署在测试资源组上。在晚上 7 点,这些资源组将被自动删除。昨天它工作正常,今天我无法再部署到相同的测试资源组名称。好久没换模板了。

我无法在 Azure 门户中的任何地方找到这个软删除的服务,也不知道如何清除它。

14:43:17 - Error: Code=FlagMustBeSetForRestore; Message=An existing resource with ID
     | '/subscriptions/GUID/resourceGroups/myRG/providers/Microsoft.CognitiveServices/accounts/my-ta-zneztme4oqjb2' has been
     | soft-deleted. To restore the resource, you must specify 'restore' to be 'true' in the property. If you don't want to restore existing resource, please purge it first.
Run Code Online (Sandbox Code Playgroud)

小智 7

这里是您可以针对认知服务调用的其余端点的链接

有一个端点可以列出已删除的认知服务,您可以像这样调用:

az rest --method get --header 'Accept=application/json' -u 'https://management.azure.com/subscriptions/$SubscriptionId/providers/Microsoft.CognitiveServices/deletedAccounts?api-version=2021-04-30'
Run Code Online (Sandbox Code Playgroud)

它返回已删除认知服务的 json 结构列表。每个已删除的服务都有一个 id 属性,这是您传递给删除方法的内容:

az resource delete --ids $id
Run Code Online (Sandbox Code Playgroud)