Get the application settings values (Environment) from Azure function for python - python

I am trying to get the application settings values from azure function for python.
I used the below code to get the Data_AzureConnection value.
logging.info("OS Env")
logging.info("Env value")
test = os.environ["Data_AzureConnection"]
logging.info(test)
But I got below result
Why I am not able to see the Data_AzureConnection value?
Is there any way to get the values from azure function for python application settings?
Please let me know if there is a solution.

It only shows Hidden Credential in the log, actually you can get it in the code by using os.environ["Data_AzureConnection"]. It returns the value in the reponse, see my test result below.

Related

Recieving Null response from visitorsession variable during deployment salesIq zo

I am a little baffled with the issue I am facing with Zobot. I have developed a Zobot in which I am using visitorsession to store some values and reuse them later. It works great in Zoho Developer environment, we used Deluge scripts option to do the development.
But when I deploy it using embed script on my website, the visitorsession part of the code is returning null. I searched around and found not a single person facing this issue or posting it, I am really surprised its happening only to me. Can someone please suggest what I should do. I have explained what I am facing below:
I am storing values like this
storeResponse2 = zoho.salesiq.visitorsession.set(portal_name,{"a":"b"});
I am getting the values like this
zoho.salesiq.visitorsession.get(portal_name,"a").get("data").get("a");
It is working great in Zobot Development environment in the Preview section, but when I go to my website where I put the embed, I am getting null.
In both environments, the response I get when I do the set is the same. Its not throwing any error, it is giving me valid response. The response I am getting when I set, in both environments is:
{"url":"/api/v2/bigtalk/visitorsessions","object":"session","data":{"a":"b"}}
But when I do a get, in Zoho environment I get correct value, in production I get null
Attachments area
If this happens, it probably means that you are setting and getting the data from visitorsession in the same execution.
It doesn't work that way. It should be set in one execution and get in further executions (replies). And this won't be a problem anyway, as in the same execution, you'll have the data available already.

NameError: name 'cas_conn' is not defined in sasoptpy

I'm trying to learn sasoptpy. I have installed it in my python 3.6 after that I'm trying to execute the examples
given here
Copied the complete code from here.If you want to check my code then please refer this link but while I'm running it,I'm getting error message as NameError: name 'cas_conn' is not defined Can you suggest me what should I do to avoid this error
cas_conn parameter in that example represents an active CAS (SAS Viya) connection.
SAS Viya is SAS' cloud computing solution. To be able to solve problems with sasoptpy, you will need to have a running server.
See https://sassoftware.github.io/sasoptpy/getting-started.html#creating-a-session for more information about creating a session.
If you have access to a CAS server, try the following:
from swat import CAS
cas_conn = CAS(your_cas_server, your_cas_port)
test(cass_conn)

In TACTIC,while using server.execute_cmd() method, how do we return data to the frontend?

I am actually working on a TACTIC project which uses AngularJS on the frontend and Python scripts on the backend.
Here when the python script is executed using server.execute_cmd(cls_name,args) from the Javascript code, the python script is run, BUT isn't able to return a value back to the front-end!
To return any o/p back to the calling function, you need to populate and return self.info
self.info["your_key_here"] = [your_answer]
In this way, the front-end or the calling command will receive the desired return value. I hope this answers helps others who have had/or will have similar query in future.

Call python script from Jira while creating an issue

Let say I'm creating an issue in Jira and write the summary and the description. Is it possible to call a python script after these are written that sets the value for another field, depending on the values of the summary and the description?
I know how to create an issue and change fields from a python script using the jira-python module. But I have not find a solution for using a python script while editing/creating the issue manually in Jira. Does anyone have an idea of how I manage that?
I solved the problem by using the Add-on Script runner in Jira. There I created a scripted field in Groovy and called the command prompt and run the python script from there. Here is a simple example of the script
def process = ['cmd', '/c', 'filepathToPython.exe', 'filepathToPythonFile.py'].execute()
process.waitfor()
return p.text
process?.err?.text can be used instead of process.text if one want to see eventual error messages.
Take a look at JIRA webhooks calling a small python based web server?

Get the GET query in a Python CGI script (Apache, mod_cgi)

I am trying to get the query string in a CGI python script because for some reason the .FieldStorage and .getvalue functions are returning "None". The query is being generated correctly. I checked it in Wireshark and it is correctly produced.
Any ideas on how I can just get the string itself correctly?
I was trying to use os.environ('QUERY_STRING') but that didn't work either.
Josh
I think I figured it out. I need to use the environ variable passed to the application function by mod_wsgi.
Thanks!

Categories

Resources