1

I've written an Azure function to send data into the Zoho CRM SDK. The SDK needs a file path to write some meta data while its in use (called "resourcePath"). While developing on my local I was using My Documents and it works fine. I need to find a location I can use in the Azure environment.
Based on articles I've read, I've tried System.IO.Path.GetTempPath() and context.FunctionAppDirectory'. Both of which throw a permissions error. The error is from the SDK {{ "code": "OAUTH_SCOPE_MISMATCH", "status": "error", "message": "invalid oauth scope to access this URL" }} I'm told that this is a permissions error on the file location. What location I should be using for an Azure Function?

**Reply to @HariKrishnaRajoli-MT **

I made the path change and now I get Object reference not set to an instance of an object. in CreateRecords(). The RecordOperations, moduleApiName and bodyWrapper are all valid. Nothing is null.

at Com.Zoho.Crm.API.Util.Utility.GetFieldsInfo(String moduleAPIName) at Com.Zoho.Crm.API.Util.Utility.GetFields(String moduleAPIName) at Com.Zoho.Crm.API.Record.RecordOperations.CreateRecords(String moduleAPIName, BodyWrapper request) at Zoho_CRM_Feed.feed_app.Lead.CreateNewLead(List1 leads) in C:\Users\xxxxxxxx\source\repos\Zoho_CRM_Feed\Zoho_CRM_Feed\feed_app\Lead.cs:line 75

Any suggestions?

1 Answer 1

0

You can use
System.IO.Path.GetTempFileName(), this will create a %userprofile%\Local\Temp\tmpE128.tmp file
OR

 System.IO.Path.Combine(System.IO.Path.GetTempPath(),  
    System.IO.Path.GetRandomFileName()) 

If you are getting error INVALID_TOKEN please generate a new access token and check if you are still getting the same error.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.