Air France will let female air hostesses and pilots opt out of flights to Iran if they are concerned about the country's strict dress code and headscarf rules.

The airline is preparing to start flying to Tehran, Iran, on April 17 and has told employees that all female crew members must wear headscarves and loose-fitting clothing the moment they get off the plane in Tehran. Other airlines also abide by these local rules.

But Air France union members reacted angrily to the headscarf and clothing rules, saying they intruded upon the crew's free will.

Before Air France announced its opt-out policy, the French national air crew union SNPNC said the dress rules are "an attack on freedom of conscience and individual freedoms, and [an] invasion of privacy."

The union later said the Air France offer to opt out of flights to Iran was "fair".

Related: Saudi Arabian prince plans $2 trillion fund

Iran requires women to cover their heads with headscarves and wear pants or long skirts. Men are expected to wear long pants and long-sleeved shirts.

German carrier Lufthansa has been flying to Iran for years, and said it has never had staff complain about wearing the traditional abaya dress when exiting the plane in Tehran.

The carrier now plans to increase that service due to rising demand.

Iran is staging a big economic comeback following its landmark nuclear deal with global powers. The deal was designed to prevent Iran from obtaining a nuclear weapon. In exchange, world powers are dropping many sanctions against the country, which isolated Iran's economy for years.

However, the Air France headscarf issue illustrates the kind of tensions that can arise as the West resumes business relations with the country.

Related: Oil dramatic fall and shocking rise

Air France's female crew have to abide by similar headscarf rules in nearby Saudi Arabia, however, the union notes that the crew do not need to be covered up when they leave the plane. Furthermore, staff stay in a compound in Saudi Arabia where they are not required to wear headscarves.

Iran is now in discussions about whether to resume flights to the U.S., which were suspended in the wake of the Islamic Revolution in 1979 when the country's western-backed monarchy was overthrown.

However, the U.S. Bureau of Consular Affairs continues to warns Americans about the risks of travel to the Iran, noting that "various elements in Iran remain hostile to the United States."

British Airways and KLM are also looking to resume flights to Tehran. KLM stopped flying to Tehran in 2012.

--CNN's Margot Haddad contributed to this report.