I suspect the batch job runs under a different userid that can't access Azure.
The SAS session and batch are run on the same machine. Is it possible they are under different user ids? Do you know where and how can I find this id?
Add
%put xxx&azure_token.xxx;
to your code and inspect/compare the logs.
In SAS session, the token looks ok, but in batch mode, the macro is not resolved because of 400 bad request. The log shows xxxxxx.
The fact that it is not resolved is the cause for the 400 error. Look where the macro variable is defined in your interactive session.
I don't see a variable &path. I do see &pathx
url= "&pathx.?restype=directory&include=timestamps&comp=list"
I also do not see where &path or &pathx is set. So without that bit of info I would say that is the likely problem: the macro variable with the path is not assigned, or assigned incorrectly in batch mode.
Where is the LOG created when you run this? I see several things that SAS might complain about as undefined macro variables that are URL elements.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.