Posts Tagged - cosmodb

Azure CLI

log into/out of tenant

az login
az logout

see & select accounts

#ver subscripcion seleccionada
az account show 

# ver todas subscripciones disponibles
az account list 

# seleccionar suscripcion
az account set --subscription {id} 

see & manage resource-groups

az group list
az group delete --name {name} 

Azure Backup Vault atascada

Se me ha quedado un backup atascado que no me dejaba borrarlo por la web. Con CLI hay que desregistrarlo y luego ya se puede borrar

# we should be able to see the resource
az backup container list -g learn-with-ai -v vault-xx00xxxx --backup-management-type AzureStorage

# unregister
az backup container unregister -g learn-with-ai -v vault-xx00xxxx --backup-management-type AzureStorage

Read More

Azure CosmosDB Query Examples

This are examples of queries to use for Azure CosmosDB, as this database uses a restricted version of SQL and it doesn’t allow all queries or joins.

Partial queries

To be used with the main, partial query. This query starts with something such as SELECT * FROM c

WHERE c.ts LIKE "%2022/03/10%" 
ORDER BY c.ts DESC
WHERE c.type = "Writeable" 
AND c.ts LIKE "%2022/03/10, 15:2%" 
ORDER BY c.ts DESC

Full queries

Normal SQL queries to be used as custom queries. Note that CosmosDB doesn’t support a 100% of all SQL statements.

(count number of entries)

SELECT COUNT(1) FROM c 
	WHERE c.ts LIKE "%2022/03/10%" 
	ORDER BY c.ts DESC

Read More