You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You install the Azure CLI and sign in from your local development environment, so that you can use your user credentials to call the Azure OpenAI service.
14
+
15
+
In most cases you can install the Azure CLI from your terminal using the following command:
You can follow instructions [How to install the Azure CLI](/cli/azure/install-azure-cli) if these commands don't work for your particular operating system or setup.
37
+
38
+
After you install the Azure CLI, sign in using the ``az login`` command and sign-in using the browser:
First we need to create a new Python environment we can use to install the prompt flow SDK packages. DO NOT install packages into your global python installation. You should always use a virtual or conda environment when installing python packages, otherwise you can break your global install of Python.
14
+
15
+
### If needed, install Python
16
+
17
+
We recommend using Python 3.10 or later, but having at least Python 3.8 is required. If you don't have a suitable version of Python installed, you can follow the instructions in the [VS Code Python Tutorial](https://code.visualstudio.com/docs/python/python-tutorial#_install-a-python-interpreter) for the easiest way of installing Python on your operating system.
18
+
19
+
### Create a virtual environment
20
+
21
+
If you already have Python 3.10 or higher installed, you can create a virtual environment using the following commands:
22
+
23
+
# [Windows](#tab/windows)
24
+
25
+
```bash
26
+
py -3 -m venv .venv
27
+
.venv\scripts\activate
28
+
```
29
+
30
+
# [Linux](#tab/linux)
31
+
32
+
```bash
33
+
python3 -m venv .venv
34
+
source .venv/bin/activate
35
+
```
36
+
37
+
# [macOS](#tab/macos)
38
+
39
+
```bash
40
+
python3 -m venv .venv
41
+
source .venv/bin/activate
42
+
```
43
+
44
+
---
45
+
46
+
Activating the Python environment means that when you run ```python``` or ```pip``` from the command line, you then use the Python interpreter contained in the ```.venv``` folder of your application.
47
+
48
+
> [!NOTE]
49
+
> You can use the ```deactivate``` command to exit the python virtual environment, and can later reactivate it when needed.
Copy file name to clipboardExpand all lines: articles/ai-studio/quickstarts/get-started-code.md
+3-78Lines changed: 3 additions & 78 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,94 +66,19 @@ To grant yourself access to the Azure AI Services resource that you're using:
66
66
67
67
## Install the Azure CLI and sign in
68
68
69
-
You install the Azure CLI and sign in from your local development environment, so that you can use your user credentials to call the Azure OpenAI service.
70
-
71
-
In most cases you can install the Azure CLI from your terminal using the following command:
You can follow instructions [How to install the Azure CLI](/cli/azure/install-azure-cli) if these commands don't work for your particular operating system or setup.
93
-
94
-
After you install the Azure CLI, sign in using the ``az login`` command and sign-in using the browser:
95
-
```
96
-
az login
97
-
```
69
+
[!INCLUDE [Install the Azure CLI](../includes/install-cli.md)]
98
70
99
71
Now we create our app and call the Azure OpenAI Service from code.
100
72
101
73
## Create a new Python environment
102
74
103
-
First we need to create a new Python environment we can use to install the prompt flow SDK packages. DO NOT install packages into your global python installation. You should always use a virtual or conda environment when installing python packages, otherwise you can break your global install of Python.
104
-
105
-
### If needed, install Python
106
-
107
-
We recommend using Python 3.10 or later, but having at least Python 3.8 is required. If you don't have a suitable version of Python installed, you can follow the instructions in the [VS Code Python Tutorial](https://code.visualstudio.com/docs/python/python-tutorial#_install-a-python-interpreter) for the easiest way of installing Python on your operating system.
108
-
109
-
### Create a virtual environment
110
-
111
-
If you already have Python 3.10 or higher installed, you can create a virtual environment using the following commands:
112
-
113
-
# [Windows](#tab/windows)
114
-
115
-
```bash
116
-
py -3 -m venv .venv
117
-
.venv\scripts\activate
118
-
```
119
-
120
-
# [Linux](#tab/linux)
121
-
122
-
```bash
123
-
python3 -m venv .venv
124
-
source .venv/bin/activate
125
-
```
126
-
127
-
# [macOS](#tab/macos)
128
-
129
-
```bash
130
-
python3 -m venv .venv
131
-
source .venv/bin/activate
132
-
```
133
-
134
-
---
135
-
136
-
Activating the Python environment means that when you run ```python``` or ```pip``` from the command line, you then use the Python interpreter contained in the ```.venv``` folder of your application.
137
-
138
-
> [!NOTE]
139
-
> You can use the ```deactivate``` command to exit the python virtual environment, and can later reactivate it when needed.
In this section, we use prompt flow to build our application. [Prompt flow](https://microsoft.github.io/promptflow) is a suite of development tools designed to streamline the end-to-end development cycle of LLM-based AI applications, from ideation, prototyping, testing, evaluation to production deployment and monitoring.
144
80
145
-
Use pip to install the prompt flow SDK into the virtual environment that you created.
146
-
```
147
-
pip install promptflow
148
-
pip install azure-identity
149
-
```
150
-
151
-
The prompt flow SDK takes a dependency on multiple packages, that you can choose to separately install if you don't want all of them:
152
-
*```promptflow-core```: contains the core prompt flow runtime used for executing LLM code
153
-
*```promptflow-tracing```: lightweight library used for emitting OpenTelemetry traces in standards
154
-
*```promptflow-devkit```: contains the prompt flow test bed and trace viewer tools for local development environments
155
-
*```openai```: client libraries for using the Azure OpenAI service
156
-
*```python-dotenv```: used to set environment variables by reading them from ```.env``` files
0 commit comments