Skip to content

Commit

Permalink
Merge pull request #117 from Azure-Samples/login
Browse files Browse the repository at this point in the history
commiting changes for login.
  • Loading branch information
marlenezw authored Aug 14, 2024
2 parents 9ca0288 + 3062217 commit 370e08a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,20 @@ The easiest way to get started is GitHub Codespaces, since it will setup all the
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/Azure-Samples/agent-openai-python-prompty)

2. Open a terminal window.
3. Sign in to your Azure account:
3. Sign in to your Azure account. You'll need to login to both the Azure Developer CLI and Azure CLI:

i. First with Azure Developer CLI

```shell
azd auth login
```

ii. Then sign in with Azure CLI

```shell
az login --use-device-code
```

4. Provision the resources and deploy the code:

```shell
Expand Down
9 changes: 0 additions & 9 deletions infra/hooks/postprovision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,7 @@ acr_build () {
}

TAG=$(date +%Y%m%d-%H%M%S)
echo "az login in for api..."
az login --use-device-code
acr_build creativeagentapi:${TAG} ${API_SERVICE_ACA_NAME} ./src/api/ 80
# AZ LOGIN CHECK
EXPIRED_TOKEN=$(az ad signed-in-user show --query 'id' -o tsv 2>/dev/null || true)
# Check if the user is not logged in and if not login again
if [[ -z "$EXPIRED_TOKEN" ]]; then
echo "az login in for web..."
az login --use-device-code
fi
acr_build creativeagentweb:${TAG} ${WEB_SERVICE_ACA_NAME} ./src/web/ 80

# Retrieve service names, resource group name, and other values from environment variables
Expand Down
3 changes: 3 additions & 0 deletions src/api/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
fastapi
fastapi[standard]
openai
requests
prompty
promptflow
promptflow-evals
pandas
azure-monitor-opentelemetry-exporter
opentelemetry-instrumentation-fastapi
Expand Down

0 comments on commit 370e08a

Please sign in to comment.