You do not need a permit if you are building a fence that is in compliance with Cochrane’s Land Use Bylaw (Sections 11.6 and 11.7). This means the fence height should not exceed 2.0m in the rear yard, and should not exceed 1.0m in the front yard. For corner lots, sightlines have to be maintained. This means the property corner facing two streets should maintain a 7.6m x 7.6m triangle sightline, in which no vegetation or structures should exceed 1.0m in height. Also, many properties in Town have utility right-of-ways in their front yards. A fence should not be placed within the right-of-way.
As with any project where digging is required, always do a locate request through Alberta One Call.