N2
にあたり・にあたって
When, When doing something, On the occasion, At the time
就活を始めるに当たり、新しいスーツを買った。
On the occasion of starting my job search, I bought a new suit.
Explanation
Follows a noun or the dictionary form of a verb and means 'at the point of starting ...', for a new beginning: a new term, opening a shop, publishing a book, launching a project. What follows is usually a resolution, preparation, a reminder or thanks: 「大会の開催にあたり、一言ご挨拶を申し上げます」 (As the event opens, let me say a few words). 「にあたり」 is more official than 「にあたって」 and is often the first line of an opening speech.
Mixed up with
Only for positive, forward-looking things. You cannot say 「×地震にあたって」.
Only a future dictionary form or a noun; never the past: not 「×卒業したにあたって」. (「際」 does allow 「した際」.)
To modify a noun, use 「にあたっての」: 「実施にあたっての注意点」 (points to note when carrying it out).