-
Notifications
You must be signed in to change notification settings - Fork 787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a way to set the trace destination in the Python code, rather than via the command line? #3372
Comments
The reason why I am asking this is, I want to run PromptFlow in an Azure WebApp. I don't want to have to do the az login and set destination every time I restart that web app. |
Hi. The |
@brynn-code That is really frustrating. I am working with an Azure Web App. I am able to access 6 other Azure resources by just loading my credentials into environment variables. How would you recommend I install and use the az login during deployment and then the set trace command with CI/CD with Azure Devops, so I don't have to enter those commands manually every time I deploy? |
Would you like to show me the environment variables you've configured which could let Azure credential get token successfully? We will call the DefaultAzureCredential to retrieve the token, that's a chained credential, |
The |
Hello Brynn, I don't think any of my environment variables allow az login to get the credentials. When I type az login, I need to open a website, enter a code, and log in manually. If there is a way around this I would appreciate some instructions on how to do it. |
I'm sorry but I don't understand the question here. |
I am able to get Promptflow Tracing to work during my build pipeline by logging in manually using the website link and authentication code using az login. However, during the deployment phase, I am getting some errors when trying to do the same thing. How can I set my trace destination during my deployment/release pipeline so my app is ready to go when it is deployed? Do I have to run az login and then set the trace destination after my app is deployed? |
A suggestion: just bypass all the OpenTelemetry stuff and just save things to CosmosDB using the CosmosDB SDK. That way I don't have to mess with az login during build or deployment. |
It appears that I can't set the promptflow config during deployment, because according to pf config -h, that gets saved to ~/.promptflow/config.yaml, which is an unwriteable directory. You guys really did not think this through when writing it, it appears that your software is not compatible with Azure WebApps or Azure FunctionApps. |
@brynn-code It appears that OpenTelemetry with Azure Monitoring uses just a connection string and I don't have to log in, you may want to adopt that approach: https://learn.microsoft.com/en-us/azure/azure-monitor/app/opentelemetry-enable?tabs=python |
Does the error you mentioned here is the one in this issue? #3391 |
The error in #3991 is caused by this error, so the two are similar, yes. I am still unable to deploy my web app while using promptflow tracing, because promptflow tracing requires logging in via the azure command line and then setting the trace destination. |
In this tutorial:
https://learn.microsoft.com/en-us/azure/machine-learning/prompt-flow/how-to-trace-local-sdk?view=azureml-api-2&tabs=python
we are told to set the trace destination using the Azure CLI. It would be really helpful if there was a way to do that in the Python code instead, like we can do with the other connections.
promptflow.trace.subscription_id = "absbas"
prompflow.trace.workspace_name = "my workspace"
etc.
The text was updated successfully, but these errors were encountered: