As part of a nightly build test that builds and destroys an environment, I need to disable operational backups on a storage account programmatically after it's been created (via REST API or the az cli or Powershell), but only know how to do this via portal.azure.com
![106081-image.png][1]
The CURL command I'm using to enable operational backups via the REST API is:
curl -X PUT -H "Authorization: Bearer $AZURE_TOKEN_ID" -H "Content-Type: application/json" --data "{\"name\": \"$STORAGE_ACCOUNT-operational-backups\",\"type\": \"Microsoft.DataProtection/backupVaults/backupInstances\",\"properties\": {\"friendlyName\": \"$STORAGE_ACCOUNT\",\"dataSourceInfo\": {\"resourceID\": \"/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP/providers/Microsoft.Storage/storageAccounts/$STORAGE_ACCOUNT\",\"resourceUri\": \"/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP/providers/Microsoft.Storage/storageAccounts/$STORAGE_ACCOUNT\",\"datasourceType\": \"Microsoft.Storage/storageAccounts/blobServices\",\"resourceName\": \"$STORAGE_ACCOUNT\",\"resourceType\": \"Microsoft.Storage/storageAccounts\",\"resourceLocation\": \"australiaeast\",\"objectType\": \"Datasource\"},\"policyInfo\": {\"policyId\": \"/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP/providers/Microsoft.DataProtection/backupVaults/$BACKUP_VAULT_NAME/backupPolicies/$BACKUP_POLICY_NAME\"},\"protectionStatus\": {\"status\": \"ProtectionConfigured\"},\"currentProtectionState\": \"ProtectionConfigured\",\"provisioningState\": \"Succeeded\",\"objectType\": \"BackupInstance\"}}" "https://management.azure.com/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP/providers/Microsoft.DataProtection/BackupVaults/$BACKUP_VAULT_NAME/backupInstances/$STORAGE_ACCOUNT-operational-backups?api-version=2021-01-01"
