Whenever necessary to make an inspection to enforce any of the provisions of this article, or whenever the building officialhas reasonable cause to believe that there exists in any building or upon any premises any condition or codeviolation which makes such building, structure, premises, electrical, gas, mechanical or plumbing systems unsafe, dangerous or hazardous, the building official may enter such building, structure or premises at all reasonable times to inspect the such building, structure or premises or to performanyduty imposed upon the building officialby this article, provided that if such building or premises is occupied, he shall first present proper credentials and request entry. If such building, structure, or premises is unoccupied, he shall first make a reasonable effort to locate the owner or other persons having charge or control of such and request entry. If entryis refused, the building official shall have recourse to every remedy provided by law to secure entry. When the building official shall have first obtaineda proper inspection warrant or other remedy provided by law to secure entry, no owner or occupant or any other persons having charge, care or control of any building, structure, or premises shall fail or neglect, after proper request is made as providedin this section, to promptly permit entry by the building official for the purpose of inspection and examination pursuant to this article.