Be + infinitive

The structure be + infinitive is used to talk about official plans and arrangements in a formal style.

The Prime Minister is to visit Africa next month.
We are to get a wage rise in May.

Be can be followed by a perfect infinitive (to have + past participle) to show that a planned event did not happen.

I was to have returned last month, but I changed my mind.

To talk about pre-conditions

The structure be + infinitive is common in if-clauses, especially when the if-clause expresses a pre-condition.

You will have to work hard if are to pass this exam.

Orders
Be + infinitive is common in orders. Parents and teachers often use this structure when speaking to their children and students.

You are to learn this poem by heart.
You are to do your homework before you can go out.

Be + passive infinitive

The structure be + passive infinitive (to be + past participle) is common in notices and instructions.

The label is not to be removed.
The missing boy was no where to be found.

Tenses

The structure be + infinitive is only possible in present and past tenses. Present perfect or future structures are not possible.

We are to go on a vacation.
We were to go on a vacation
We have been to go on a vacation. (Wrong)
We will be to go on a vacation. (Wrong)