Exhibit 23.1
Consent of Independent Registered Public Accounting Firm
We consent to the incorporation by reference in Registration Statement Nos. 333-10229, 333-10245,
333-46695, 333-45965, 333-59161, 333-46796, 333-54712, 333-129485, 333-142559 and 333-145651 of
Allegheny Technologies Incorporated of our reports dated
February 18, 2009, with respect to the
consolidated financial statements of Allegheny Technologies Incorporated, and the effectiveness of
internal control over financial reporting of Allegheny Technologies Incorporated, included in this
Annual Report (Form 10-K) for the year ended December 31, 2008.
/s/ Ernst & Young LLP
Pittsburgh, Pennsylvania
February 18, 2009