(Adds investor comments, market details, updates prices)

* TSX ends up 177.84 points, or 0.8%, at 21,271.85

* For the week, the index gains 2.6%

* Energy rises 0.6%, with oil settling 2.3% higher

* Shopify rallies 8.8%; technology ends up 2.7%

TORONTO, Feb 4 (Reuters) - Canada's main stock index rose on Friday, capping a strong week as a seven-year high for oil prices bolstered the index's attractiveness to foreign investors.

The Toronto Stock Exchange's S&P/TSX composite index ended up 177.84 points, or 0.8%, at 21,271.85. For the week, it climbed 2.6%, its biggest advance since March last year.

"Foreign investors when they see oil prices going up it brings money into the Canadian market," said Lorne Steinberg, president of Lorne Steinberg Wealth Management Inc.

The energy sector touched its highest intraday level since August 2018 before closing 0.6% higher, while U.S. crude oil futures settled up 2.3% at $92.31 a barrel as frigid U.S. weather and ongoing political turmoil among major world producers fueled worries about supply disruptions.

Energy and financials combined account for nearly half the value of the Toronto market. Financials also moved higher on Friday, gaining 0.5%.

"Canadian bank stocks still look cheap to us," Steinberg said. "Canadian credit is in fantastic shape, loan losses are minimal, the housing market remains strong."

Wall Street indexes also rallied as Amazon.com Inc's positive numbers boosted sentiment and U.S. jobs data pointed to underlying strength in the economy.

In contrast, the Canadian economy lost more jobs than expected in January as the Omicron-driven COVID-19 wave peaked, but analysts expect a quick rebound in coming months.

Among stocks with the biggest gains on the Toronto market was e-commerce company Shopify Inc. It rallied 8.8%, helping the technology group to a 2.7% advance. (Reporting by Fergal Smith in Toronto Additional reporting by Amal S in Bengaluru Editing by Matthew Lewis)