azure-sdk-for-go: security center: Cannot delete a cosmos DB after enabling Advanced Threat Protection (API also has no update/create metholds)

Bug Report

  • import path of package in question, e.g. .../services/compute/mgmt/2018-06-01/compute
  • SDK version e.g. master, latest, 18.1.0
  • output of go version
18:05:45] kt@katbook:~/hashi/tf/azure/azurerm▸f/resource_adv_threat_protection-new$ find azurerm -type f -print | xargs grep "security\"$" | cut -d\" -f 2 | sort -u
github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security
[18:06:18] kt@katbook:~/hashi/tf/azure/azurerm▸f/resource_adv_threat_protection-new$ cat go.mod | egrep "(autorest|Azure)"
	github.com/Azure/azure-sdk-for-go v35.0.0+incompatible
	github.com/Azure/go-autorest/autorest v0.9.2
	github.com/Azure/go-autorest/autorest/date v0.2.0
[18:06:35] kt@katbook:~/hashi/tf/azure/azurerm▸f/resource_adv_threat_protection-new$ go version
go version go1.13.1 darwin/amd64
  • What happened? After enabling & then disabling ATP on a cosmos DB account i am unable to delete the cosmosDB. I get the following error:
 testing.go:630: Error destroying resource! WARNING: Dangling resources
        may exist. The full state and error is shown below.

        Error: errors during apply: Error issuing AzureRM delete request for CosmosDB Account 'acctest-191109182228101498': documentdb.DatabaseAccountsClient#Delete: Failure sending request: StatusCode=412 -- Original Error: Code="PreconditionFailed" Message="There is already an operation in progress which requires exlusive lock on this service acctest-191109182228101498. Please retry the operation after sometime.\r\nActivityId: a34dd703-7207-4705-8631-3b28e6d7a74f, Microsoft.Azure.Documents.Common/2.7.0"

Also there is a spelling error in the error message: exlusive

Also also there is no update or delete method for the ATP API, just create which seems… different.

  • What did you expect or want to happen? the cosmos DB should have been able to be deleted. Also there should be at least an update method to change the ATP setting, possibly a delete that waits for such operations on the cosmos DB tok stop before returning.

  • How can we reproduce it? enabled ATP and then disable ATP on a cosmos DB account and try and delete the account.

  • Anything we should know about your environment.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 19 (5 by maintainers)

Most upvoted comments

Thanks for working with Microsoft on GitHub! Tell us how you feel about your experience using the reactions on this comment.