@Dheeraj As per the error message looks like your Tenant or subscription ID is invalid. Can you please confirm if this is correct?
You can update your requirements.psd1 Az.Accounts pointing to the latest version and as per the code I don't see you are using legacy AzureRm commands so you can comment Enable-AzureRMAlias
Az.Accounts' = '2.*'
I have tested the same with the below setting and couldn'tt observe any issue. Please make sure that you have enabled the Identity on your function app.