From 7f1bd4c48b1525f2bbfccef2c80903e3265929e7 Mon Sep 17 00:00:00 2001 From: ross-p-smith Date: Tue, 4 Jun 2024 21:43:39 +0000 Subject: [PATCH] az login if required during post provision --- README.md | 2 +- infra/prompt-flow/create-prompt-flow.sh | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f8f2e6ce8..bfe41de8f 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ Welcome to the *Chat with your data* Solution accelerator repository! The *Chat ### About this repo -This repository provides an end-to-end solution for users who want to query their data with natural language. It includes a well designed ingestion mechanism for multiple file types, an easy deployment, and a support team for maintenance. The accelerator demonstrates both Push or Pull Ingestion; the choice of orchestration (Semantic Kernel, LangChain, OpenAI Functions or Prompt Flow) and should be the minimum components needed to implement a RAG pattern. It is not intended to be put into Production as-is without experimentation or evaluation of your data. It provides the following features: +This repository provides an end-to-end solution for users who want to query their data with natural language. It includes a well designed ingestion mechanism for multiple file types, an easy deployment, and a support team for maintenance. The accelerator demonstrates both Push or Pull Ingestion; the choice of orchestration (Semantic Kernel, LangChain, OpenAI Functions or [Prompt Flow](docs/prompt_flow.md)) and should be the minimum components needed to implement a RAG pattern. It is not intended to be put into Production as-is without experimentation or evaluation of your data. It provides the following features: * Chat with an Azure OpenAI model using your own data * Upload and process your documents diff --git a/infra/prompt-flow/create-prompt-flow.sh b/infra/prompt-flow/create-prompt-flow.sh index c937555db..93a91e2f5 100755 --- a/infra/prompt-flow/create-prompt-flow.sh +++ b/infra/prompt-flow/create-prompt-flow.sh @@ -11,6 +11,7 @@ while IFS='=' read -r key value; do case "$key" in "ORCHESTRATION_STRATEGY") orchestration_strategy=$value ;; "AZURE_SUBSCRIPTION_ID") subscription_id=$value ;; + "AZURE_TENANT_ID") tenant_id=$value ;; "AZURE_RESOURCE_GROUP") resource_group=$value ;; "AZURE_ML_WORKSPACE_NAME") aml_workspace=$value ;; "RESOURCE_TOKEN") resource_token=$value ;; @@ -63,6 +64,10 @@ sed -i "s@@${connection_id_prefix}/aisearch_connection@g sed -i "s@@${search_service}@g" "$flow_dag_file" sed -i "s@@${search_index}@g" "$flow_dag_file" +# login to Azure if not already logged in +az account show > /dev/null 2>&1 || az login --tenant "$tenant_id" +az account set --subscription "$subscription_id" + set +e tries=1 pfazure flow create --subscription "$subscription_id" --resource-group "$resource_group" \