Unexpected Rules Format. Rules When Deploying Firebase Rules

I'm trying to deploy my firebase rules running firebase deploy --only database:rules. My firebase.json contains an attributes database:

"database": {
  "rules": "database.rules"
}

My file containing the rules is called dabatase.rules. Running the deploy command, I get an error: Error: Unexpected rules format .rules.

Any ideas about what I did wrong ? Thank you!

1 Answer

It's appear that the firebase.json was wrong. I use Firestore Database. So, the attribute into the firebase.json has to be firestore

"firestore": {
  "rules": "database.rules"
}

Editing this, make everything work like a charm.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Marcus Vance

Marcus Vance

Cybersecurity & Digital Privacy Researcher

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.

Share this article
Twitter Facebook Pinterest