From d677c52872a6a8eb9d0858c254fc1739387244f1 Mon Sep 17 00:00:00 2001 From: Rohini-Microsoft Date: Mon, 9 Sep 2024 10:19:03 +0530 Subject: [PATCH 001/163] update table format system msg in function_app --- ClientAdvisor/App/frontend/src/components/Answer/Answer.tsx | 2 ++ ClientAdvisor/AzureFunction/function_app.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ClientAdvisor/App/frontend/src/components/Answer/Answer.tsx b/ClientAdvisor/App/frontend/src/components/Answer/Answer.tsx index 744a003d..76868bc3 100644 --- a/ClientAdvisor/App/frontend/src/components/Answer/Answer.tsx +++ b/ClientAdvisor/App/frontend/src/components/Answer/Answer.tsx @@ -16,6 +16,7 @@ import { AppStateContext } from '../../state/AppProvider' import { parseAnswer } from './AnswerParser' import styles from './Answer.module.css' +import rehypeRaw from 'rehype-raw' interface Props { answer: AskResponse @@ -250,6 +251,7 @@ export const Answer = ({ answer, onCitationClicked }: Props) => { StreamingResponse: Always consider to give selected client full name only in response and do not use other example names also consider my client means currently selected client. If you cannot answer the question, always return - I cannot answer this question from the data available. Please rephrase or add more details. ** Remove any client identifiers or ids or numbers or ClientId in the final response. - + For any questions requiring a table, always render the table using the following HTML format:
Header 1Header 2
Data 1Data 2
''' user_query = query.replace('?',' ') From cb313879aba5f54873262943a50093fa7f6671b6 Mon Sep 17 00:00:00 2001 From: Rohini-Microsoft Date: Mon, 9 Sep 2024 15:54:12 +0530 Subject: [PATCH 002/163] added tbble css --- ClientAdvisor/AzureFunction/function_app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ClientAdvisor/AzureFunction/function_app.py b/ClientAdvisor/AzureFunction/function_app.py index 94744a8c..5ed1e6fb 100644 --- a/ClientAdvisor/AzureFunction/function_app.py +++ b/ClientAdvisor/AzureFunction/function_app.py @@ -297,7 +297,7 @@ async def stream_openai_text(req: Request) -> StreamingResponse: Always consider to give selected client full name only in response and do not use other example names also consider my client means currently selected client. If you cannot answer the question, always return - I cannot answer this question from the data available. Please rephrase or add more details. ** Remove any client identifiers or ids or numbers or ClientId in the final response. - For any questions requiring a table, always render the table using the following HTML format:
Header 1Header 2
Data 1Data 2
+ For any questions requiring a table, always render the table using the following HTML format:
Header 1Header 2
Data 1Data 2
''' user_query = query.replace('?',' ') From 2249260740a4cc57494be9baec072a9bbe7865da Mon Sep 17 00:00:00 2001 From: Rohini-Microsoft Date: Tue, 10 Sep 2024 21:20:24 +0530 Subject: [PATCH 003/163] added html code into separate file --- ClientAdvisor/AzureFunction/function_app.py | 9 +++++++-- ClientAdvisor/AzureFunction/table.html | 11 +++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 ClientAdvisor/AzureFunction/table.html diff --git a/ClientAdvisor/AzureFunction/function_app.py b/ClientAdvisor/AzureFunction/function_app.py index 5ed1e6fb..a28b8c87 100644 --- a/ClientAdvisor/AzureFunction/function_app.py +++ b/ClientAdvisor/AzureFunction/function_app.py @@ -276,6 +276,10 @@ async def stream_openai_text(req: Request) -> StreamingResponse: settings.max_tokens = 800 settings.temperature = 0 + # Read the HTML file + with open("table.html", "r") as file: + html_content = file.read() + system_message = '''you are a helpful assistant to a wealth advisor. Do not answer any questions not related to wealth advisors queries. If asked, provide information about client meetings according to the requested timeframe: give details about upcoming meetings if asked for "next" or "upcoming" meetings, and provide details about past meetings if asked for "previous" or "last" meetings including the scheduled time. @@ -297,9 +301,10 @@ async def stream_openai_text(req: Request) -> StreamingResponse: Always consider to give selected client full name only in response and do not use other example names also consider my client means currently selected client. If you cannot answer the question, always return - I cannot answer this question from the data available. Please rephrase or add more details. ** Remove any client identifiers or ids or numbers or ClientId in the final response. - For any questions requiring a table, always render the table using the following HTML format:
Header 1Header 2
Data 1Data 2
+ For any questions requiring a table, always render the table using the following HTML format: ''' - + system_message += html_content + user_query = query.replace('?',' ') user_query_prompt = f'''{user_query}. Always send clientId as {user_query.split(':::')[-1]} ''' diff --git a/ClientAdvisor/AzureFunction/table.html b/ClientAdvisor/AzureFunction/table.html new file mode 100644 index 00000000..51ded0be --- /dev/null +++ b/ClientAdvisor/AzureFunction/table.html @@ -0,0 +1,11 @@ + + + + + + + + + + +
Header 1Header 2
Data 1Data 2
\ No newline at end of file From 82974bb2c7e9ebd8f2d7d6fb5cf5b31b70664ec8 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 20 Sep 2024 19:05:04 +0530 Subject: [PATCH 004/163] adding one click deployment automation flow --- .../.github/workflows/deploy.yml | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 ResearchAssistant/.github/workflows/deploy.yml diff --git a/ResearchAssistant/.github/workflows/deploy.yml b/ResearchAssistant/.github/workflows/deploy.yml new file mode 100644 index 00000000..7e2f116b --- /dev/null +++ b/ResearchAssistant/.github/workflows/deploy.yml @@ -0,0 +1,36 @@ +name: Deploy Azure Resources:ResearchAssitent + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Setup Azure CLI + run: | + curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash + az --version # Verify installation + + - name: Login to Azure + run: | + az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }} + + - name: Install Bicep CLI + run: az bicep install + + - name: Deploy Bicep Template + id: deploy + run: | + set -e + az deployment sub create \ + --name autoDemo \ + --location eastus \ + --template-file ResearchAssistant/Deployment/bicep/main.bicep \ + --parameters environmentName=pslautomation location=eastus2 \ No newline at end of file From 2c85585ca9f317384c10b51768356c66482384ad Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 20 Sep 2024 19:18:43 +0530 Subject: [PATCH 005/163] modify code --- {ResearchAssistant/.github => .github}/workflows/deploy.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {ResearchAssistant/.github => .github}/workflows/deploy.yml (100%) diff --git a/ResearchAssistant/.github/workflows/deploy.yml b/.github/workflows/deploy.yml similarity index 100% rename from ResearchAssistant/.github/workflows/deploy.yml rename to .github/workflows/deploy.yml From 7913e370a189c889a602baffa65a2751920f9b65 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 20 Sep 2024 19:20:57 +0530 Subject: [PATCH 006/163] renamed file --- .github/workflows/{deploy.yml => RAdeploy.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{deploy.yml => RAdeploy.yml} (100%) diff --git a/.github/workflows/deploy.yml b/.github/workflows/RAdeploy.yml similarity index 100% rename from .github/workflows/deploy.yml rename to .github/workflows/RAdeploy.yml From 91afa0e98b9aa1563dde2e5a224fb9d5a783d656 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 20 Sep 2024 19:28:07 +0530 Subject: [PATCH 007/163] testing automation flow --- .github/workflows/RAdeploy.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 7e2f116b..c08e52a0 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -29,8 +29,6 @@ jobs: id: deploy run: | set -e - az deployment sub create \ - --name autoDemo \ - --location eastus \ + az deployment group create \ --template-file ResearchAssistant/Deployment/bicep/main.bicep \ --parameters environmentName=pslautomation location=eastus2 \ No newline at end of file From 9131ef9cc8c873fc219e40b37353d00fa2de1afd Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 20 Sep 2024 19:40:11 +0530 Subject: [PATCH 008/163] testing automation flow --- .github/workflows/RAdeploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index c08e52a0..98fc839e 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -30,5 +30,6 @@ jobs: run: | set -e az deployment group create \ + --resource-group pslautomationbyoa \ --template-file ResearchAssistant/Deployment/bicep/main.bicep \ --parameters environmentName=pslautomation location=eastus2 \ No newline at end of file From c3c6f37ab64c803faf77c197da01adc0a5f166af Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 20 Sep 2024 19:52:40 +0530 Subject: [PATCH 009/163] testing automation flow --- .github/workflows/RAdeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 98fc839e..9e3dd025 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -32,4 +32,4 @@ jobs: az deployment group create \ --resource-group pslautomationbyoa \ --template-file ResearchAssistant/Deployment/bicep/main.bicep \ - --parameters environmentName=pslautomation location=eastus2 \ No newline at end of file + --parameters solutionPrefix=pslre \ No newline at end of file From edd0c5e00141542d5c8fb0ff5444bee4313787fa Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 20 Sep 2024 20:59:12 +0530 Subject: [PATCH 010/163] added code to create resource group --- .github/workflows/RAdeploy.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 9e3dd025..b7dce7df 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -24,6 +24,19 @@ jobs: - name: Install Bicep CLI run: az bicep install + + - name: Check and Create Resource Group + id: check_create_rg + run: | + set -e + echo "Checking if resource group exists..." + rg_exists=$(az group exists --name pslautomationbyoa) + if [ "$rg_exists" = "false" ]; then + echo "Resource group does not exist. Creating..." + az group create --name pslautomationbyoa --location eastus || { echo "Error creating resource group"; exit 1; } + else + echo "Resource group already exists." + fi - name: Deploy Bicep Template id: deploy From 236cc2ce44c4f72846b0814c78d1578bcc9d4261 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Tue, 24 Sep 2024 12:55:57 +0530 Subject: [PATCH 011/163] added role assignment --- .github/workflows/RAdeploy.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index b7dce7df..63320672 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -38,6 +38,14 @@ jobs: echo "Resource group already exists." fi + + - name: Assign Role to Service Principal + id: assign_role + run: | + set -e + echo "Assigning User Access Administrator role to the service principal..." + az role assignment create --assignee ${{ secrets.AZURE_CLIENT_ID }} --role "User Access Administrator" --scope /subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/pslautomationbyoa || { echo "Error assigning role"; exit 1; } + - name: Deploy Bicep Template id: deploy run: | From 16d95a37aca9eed08c0fe7c3db844bd6bfb5d484 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Tue, 24 Sep 2024 13:09:45 +0530 Subject: [PATCH 012/163] testing automation flow --- .github/workflows/RAdeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 63320672..f30d6b20 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -44,7 +44,7 @@ jobs: run: | set -e echo "Assigning User Access Administrator role to the service principal..." - az role assignment create --assignee ${{ secrets.AZURE_CLIENT_ID }} --role "User Access Administrator" --scope /subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/pslautomationbyoa || { echo "Error assigning role"; exit 1; } + az role assignment create --assignee ${{ secrets.AZURE_CLIENT_ID }} --role "Owner" --scope /subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/pslautomationbyoa || { echo "Error assigning role"; exit 1; } - name: Deploy Bicep Template id: deploy From c8c2794249bf785756ee3ce4f3c1a68884c9faf9 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Tue, 24 Sep 2024 13:28:33 +0530 Subject: [PATCH 013/163] testing automation flow --- .github/workflows/RAdeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index f30d6b20..63320672 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -44,7 +44,7 @@ jobs: run: | set -e echo "Assigning User Access Administrator role to the service principal..." - az role assignment create --assignee ${{ secrets.AZURE_CLIENT_ID }} --role "Owner" --scope /subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/pslautomationbyoa || { echo "Error assigning role"; exit 1; } + az role assignment create --assignee ${{ secrets.AZURE_CLIENT_ID }} --role "User Access Administrator" --scope /subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/pslautomationbyoa || { echo "Error assigning role"; exit 1; } - name: Deploy Bicep Template id: deploy From 08b6850cfb05e031081b4c470dd1510cb04c133d Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Tue, 24 Sep 2024 13:50:07 +0530 Subject: [PATCH 014/163] modify code --- .github/workflows/RAdeploy.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 63320672..d8a1c57a 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -30,27 +30,27 @@ jobs: run: | set -e echo "Checking if resource group exists..." - rg_exists=$(az group exists --name pslautomationbyoa) + rg_exists=$(az group exists --name pslautomationbyoa2) if [ "$rg_exists" = "false" ]; then echo "Resource group does not exist. Creating..." - az group create --name pslautomationbyoa --location eastus || { echo "Error creating resource group"; exit 1; } + az group create --name pslautomationbyoa2 --location eastus || { echo "Error creating resource group"; exit 1; } else echo "Resource group already exists." fi - - name: Assign Role to Service Principal - id: assign_role - run: | - set -e - echo "Assigning User Access Administrator role to the service principal..." - az role assignment create --assignee ${{ secrets.AZURE_CLIENT_ID }} --role "User Access Administrator" --scope /subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/pslautomationbyoa || { echo "Error assigning role"; exit 1; } + # - name: Assign Role to Service Principal + # id: assign_role + # run: | + # set -e + # echo "Assigning User Access Administrator role to the service principal..." + # az role assignment create --assignee ${{ secrets.AZURE_CLIENT_ID }} --role "User Access Administrator" --scope /subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/pslautomationbyoa2 || { echo "Error assigning role"; exit 1; } - name: Deploy Bicep Template id: deploy run: | set -e az deployment group create \ - --resource-group pslautomationbyoa \ + --resource-group pslautomationbyoa2 \ --template-file ResearchAssistant/Deployment/bicep/main.bicep \ --parameters solutionPrefix=pslre \ No newline at end of file From e28011faa1c1214fc7c7476b24b8a77730fa7d1e Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Tue, 24 Sep 2024 13:53:04 +0530 Subject: [PATCH 015/163] testing automation flow --- .github/workflows/RAdeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index d8a1c57a..b609251e 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -53,4 +53,4 @@ jobs: az deployment group create \ --resource-group pslautomationbyoa2 \ --template-file ResearchAssistant/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=pslre \ No newline at end of file + --parameters solutionPrefix=pslre2 \ No newline at end of file From afa2c25d0138a59ab9098d78a12283d08763cf8f Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Tue, 24 Sep 2024 14:15:58 +0530 Subject: [PATCH 016/163] testing automation flow --- .github/workflows/RAdeploy.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index b609251e..6d4fa034 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -39,12 +39,12 @@ jobs: fi - # - name: Assign Role to Service Principal - # id: assign_role - # run: | - # set -e - # echo "Assigning User Access Administrator role to the service principal..." - # az role assignment create --assignee ${{ secrets.AZURE_CLIENT_ID }} --role "User Access Administrator" --scope /subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/pslautomationbyoa2 || { echo "Error assigning role"; exit 1; } + - name: Assign Role to Service Principal + id: assign_role + run: | + set -e + echo "Assigning User Access Administrator role to the service principal..." + az role assignment create --assignee ${{ secrets.AZURE_CLIENT_ID }} --role "Owner" --scope /subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/pslautomationbyoa2 || { echo "Error assigning role"; exit 1; } - name: Deploy Bicep Template id: deploy From 8a8ec1c878e55ef3d7efecc0d9c0a5e68a15653e Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Tue, 24 Sep 2024 14:37:40 +0530 Subject: [PATCH 017/163] testing automation flow --- .github/workflows/RAdeploy.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 6d4fa034..715e851a 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -39,18 +39,22 @@ jobs: fi - - name: Assign Role to Service Principal - id: assign_role - run: | - set -e - echo "Assigning User Access Administrator role to the service principal..." - az role assignment create --assignee ${{ secrets.AZURE_CLIENT_ID }} --role "Owner" --scope /subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/pslautomationbyoa2 || { echo "Error assigning role"; exit 1; } + # - name: Assign Role to Service Principal + # id: assign_role + # run: | + # set -e + # echo "Assigning Owner role to the service principal..." + # az role assignment create --assignee ${{ secrets.AZURE_CLIENT_ID }} --role "Owner" --scope /subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }} || { echo "Error assigning role"; exit 1; } - name: Deploy Bicep Template id: deploy run: | set -e - az deployment group create \ + output=$(az deployment group create \ --resource-group pslautomationbyoa2 \ --template-file ResearchAssistant/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=pslre2 \ No newline at end of file + --parameters solutionPrefix=pslre2 --debug 2>&1) || { + echo "Deployment failed. Here is the error message:" + echo "$output" + exit 1 + } \ No newline at end of file From 8df946660149bb393db56d1c709d99090e9365e8 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Tue, 24 Sep 2024 15:38:34 +0530 Subject: [PATCH 018/163] testing automation flow --- .github/workflows/RAdeploy.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 715e851a..7e67e840 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -57,4 +57,11 @@ jobs: echo "Deployment failed. Here is the error message:" echo "$output" exit 1 - } \ No newline at end of file + } + + - name: Send Notification on Failure + if: failure() + run: | + curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ + -H "Content-Type: application/json" \ + -d '{"failureMessage": "The deployment failed. Please find below more details. $output"}' \ No newline at end of file From 6b23989a36cb413e19e9b721adc00bce4d02970b Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Tue, 24 Sep 2024 15:59:55 +0530 Subject: [PATCH 019/163] testing automation flow --- .github/workflows/RAdeploy.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 7e67e840..7e846b36 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -55,13 +55,16 @@ jobs: --template-file ResearchAssistant/Deployment/bicep/main.bicep \ --parameters solutionPrefix=pslre2 --debug 2>&1) || { echo "Deployment failed. Here is the error message:" + echo "output=$output" >> $GITHUB_ENV echo "$output" + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" exit 1 } - name: Send Notification on Failure if: failure() run: | + output="${{ env.output }}" curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ -H "Content-Type: application/json" \ -d '{"failureMessage": "The deployment failed. Please find below more details. $output"}' \ No newline at end of file From 93f9b5a40347c189468e9423b6fb53fa75f66897 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Tue, 24 Sep 2024 16:19:46 +0530 Subject: [PATCH 020/163] testing automation flow --- .github/workflows/RAdeploy.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 7e846b36..70b80669 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -54,8 +54,10 @@ jobs: --resource-group pslautomationbyoa2 \ --template-file ResearchAssistant/Deployment/bicep/main.bicep \ --parameters solutionPrefix=pslre2 --debug 2>&1) || { - echo "Deployment failed. Here is the error message:" + echo "Deployment failed. Here is the error mesage:" + echo "###########################################################################" echo "output=$output" >> $GITHUB_ENV + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo "$output" echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" exit 1 From 9befa419440c20865ab4cd763c00dc87b4d5a874 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Tue, 24 Sep 2024 16:35:45 +0530 Subject: [PATCH 021/163] testing automation flow --- .github/workflows/RAdeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 70b80669..2d7fbbf7 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -69,4 +69,4 @@ jobs: output="${{ env.output }}" curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ -H "Content-Type: application/json" \ - -d '{"failureMessage": "The deployment failed. Please find below more details. $output"}' \ No newline at end of file + -d '{"failureMessage": "The deployment failed. Please find below more details." + $output}' \ No newline at end of file From 08d18d6c1ed16989f6396170ee8d93692507310f Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Tue, 24 Sep 2024 16:54:18 +0530 Subject: [PATCH 022/163] testing automation flow --- .github/workflows/RAdeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 2d7fbbf7..02d99960 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -69,4 +69,4 @@ jobs: output="${{ env.output }}" curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ -H "Content-Type: application/json" \ - -d '{"failureMessage": "The deployment failed. Please find below more details." + $output}' \ No newline at end of file + -d '{"failureMessage": $output}' \ No newline at end of file From c98aab95bc9942152fdfb7ccc8670a12db058371 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Tue, 24 Sep 2024 17:54:21 +0530 Subject: [PATCH 023/163] testing automation flow --- .github/workflows/RAdeploy.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 02d99960..96e21e2a 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -56,12 +56,16 @@ jobs: --parameters solutionPrefix=pslre2 --debug 2>&1) || { echo "Deployment failed. Here is the error mesage:" echo "###########################################################################" - echo "output=$output" >> $GITHUB_ENV + echo "$output" >> $GITHUB_ENV echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo "$output" echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" exit 1 } + echo "******************************************************************************" + echo "output=$output" >> $GITHUB_ENV + echo "******************************************************************************" + - name: Send Notification on Failure if: failure() From 6349c7eb9d6fcbc7b5863574810c43bd9532d9ac Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Tue, 24 Sep 2024 18:17:15 +0530 Subject: [PATCH 024/163] testing automation flow --- .github/workflows/RAdeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 96e21e2a..fd1a37a2 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -73,4 +73,4 @@ jobs: output="${{ env.output }}" curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ -H "Content-Type: application/json" \ - -d '{"failureMessage": $output}' \ No newline at end of file + -d "{\"failureMessage\": \"$output\"}" \ No newline at end of file From 22bc9d56d2f68125bf631b6c013e6b95ff984fd6 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Tue, 24 Sep 2024 19:34:24 +0530 Subject: [PATCH 025/163] testing automation flow --- .github/workflows/RAdeploy.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index fd1a37a2..2522937b 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -71,6 +71,9 @@ jobs: if: failure() run: | output="${{ env.output }}" + echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" + echo "$output" + echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ -H "Content-Type: application/json" \ -d "{\"failureMessage\": \"$output\"}" \ No newline at end of file From 125c8e2b993e9915e8c4807893d9f25a220a4ef3 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Tue, 24 Sep 2024 22:27:39 +0530 Subject: [PATCH 026/163] testing automation flow --- .github/workflows/RAdeploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 2522937b..55152f61 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -56,9 +56,9 @@ jobs: --parameters solutionPrefix=pslre2 --debug 2>&1) || { echo "Deployment failed. Here is the error mesage:" echo "###########################################################################" - echo "$output" >> $GITHUB_ENV + echo "$output" | grep -E "error|failed|link" >> $GITHUB_ENV echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - echo "$output" + echo "$output" | grep -E "error|failed|link echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" exit 1 } From 5bb3cd685c4c423d66c2055ebce01c3e10d1de13 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Tue, 24 Sep 2024 22:31:01 +0530 Subject: [PATCH 027/163] testing automation flow --- .github/workflows/RAdeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 55152f61..d432887a 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -58,7 +58,7 @@ jobs: echo "###########################################################################" echo "$output" | grep -E "error|failed|link" >> $GITHUB_ENV echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - echo "$output" | grep -E "error|failed|link + echo "$output" | grep -E "error|failed|link" echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" exit 1 } From 8442abea0702ff944686445318c05910ea913ca7 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Wed, 25 Sep 2024 10:31:59 +0530 Subject: [PATCH 028/163] testing automation flow --- .github/workflows/RAdeploy.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index d432887a..fef0c099 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -53,15 +53,8 @@ jobs: output=$(az deployment group create \ --resource-group pslautomationbyoa2 \ --template-file ResearchAssistant/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=pslre2 --debug 2>&1) || { - echo "Deployment failed. Here is the error mesage:" - echo "###########################################################################" - echo "$output" | grep -E "error|failed|link" >> $GITHUB_ENV - echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - echo "$output" | grep -E "error|failed|link" - echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - exit 1 - } + --parameters solutionPrefix=pslre2 2>&1) + echo "******************************************************************************" echo "output=$output" >> $GITHUB_ENV echo "******************************************************************************" From a75ce07c563801e657ddd2c9687dffdb9f511596 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Wed, 25 Sep 2024 10:52:04 +0530 Subject: [PATCH 029/163] testing automation flow --- .github/workflows/RAdeploy.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index fef0c099..69953788 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -53,8 +53,12 @@ jobs: output=$(az deployment group create \ --resource-group pslautomationbyoa2 \ --template-file ResearchAssistant/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=pslre2 2>&1) - + --parameters solutionPrefix=pslre2 2>&1) + + echo "7777777777777777777777777777777777777777777777777777777" + echo "$output" + echo "8888888888888888888888888888888888888888888888888888888" + echo "******************************************************************************" echo "output=$output" >> $GITHUB_ENV echo "******************************************************************************" From 62fd9c7654a50a3daf35ee8983678a6dc30e096a Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Wed, 25 Sep 2024 11:21:41 +0530 Subject: [PATCH 030/163] testing automation flow --- .github/workflows/RAdeploy.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 69953788..9dc5711d 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -50,19 +50,20 @@ jobs: id: deploy run: | set -e - output=$(az deployment group create \ + output_file=$(mktemp) + az deployment group create \ --resource-group pslautomationbyoa2 \ --template-file ResearchAssistant/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=pslre2 2>&1) + --parameters solutionPrefix=pslre2 \ + &> "$output_file" || echo "Command failed, capturing output and error." - echo "7777777777777777777777777777777777777777777777777777777" - echo "$output" - echo "8888888888888888888888888888888888888888888888888888888" - + output=$(cat "$output_file") + echo "===============================================================================" + echo "$output echo "******************************************************************************" echo "output=$output" >> $GITHUB_ENV echo "******************************************************************************" - + rm "$output_file" - name: Send Notification on Failure if: failure() From c613040efdd6a4a4239f215f01f8cd8a738be549 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Wed, 25 Sep 2024 11:40:01 +0530 Subject: [PATCH 031/163] testing automation code --- .github/workflows/CAdeploy.yml | 55 ++++++++++++++++++++++++++++++++++ .github/workflows/RAdeploy.yml | 2 +- 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/CAdeploy.yml diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml new file mode 100644 index 00000000..009fbe8b --- /dev/null +++ b/.github/workflows/CAdeploy.yml @@ -0,0 +1,55 @@ +name: Deploy Azure Resources:ClientAdvisior + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Setup Azure CLI + run: | + curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash + az --version # Verify installation + + - name: Login to Azure + run: | + az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }} + + - name: Install Bicep CLI + run: az bicep install + + - name: Check and Create Resource Group + id: check_create_rg + run: | + set -e + echo "Checking if resource group exists..." + rg_exists=$(az group exists --name pslautomationca) + if [ "$rg_exists" = "false" ]; then + echo "Resource group does not exist. Creating..." + az group create --name pslautomationbyoa2 --location eastus || { echo "Error creating resource group"; exit 1; } + else + echo "Resource group already exists." + fi + + - name: Deploy Bicep Template + id: deploy + run: | + set -e + az deployment group create \ + --resource-group pslautomationbyoa2 \ + --template-file ClientAdvisor/Deployment/bicep/main.bicep \ + --parameters solutionPrefix=pslca + + - name: Send Notification on Failure + if: failure() + run: | + curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ + -H "Content-Type: application/json" \ + -d "{\"failureMessage\": \"$output\"}" \ No newline at end of file diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 9dc5711d..a603959f 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -59,7 +59,7 @@ jobs: output=$(cat "$output_file") echo "===============================================================================" - echo "$output + echo "$output" echo "******************************************************************************" echo "output=$output" >> $GITHUB_ENV echo "******************************************************************************" From 9f1a5e068f6a07ca5baba0d892a289b3e4bcc011 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Wed, 25 Sep 2024 11:44:21 +0530 Subject: [PATCH 032/163] testing client advisior automation flow --- .github/workflows/CAdeploy.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 009fbe8b..7367cea6 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -4,6 +4,9 @@ on: push: branches: - main + # Trigger on changes in these specific paths + paths: + - 'ClientAdvisor/**' jobs: deploy: From 9d6220c77af0f0c7b78f7c3ba461a99b8a723059 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Wed, 25 Sep 2024 11:55:15 +0530 Subject: [PATCH 033/163] testing research assistant automation flow --- .github/workflows/RAdeploy.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index a603959f..03929bd6 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -4,6 +4,9 @@ on: push: branches: - main + # Trigger on changes in these specific paths + paths: + - 'ResearchAssistant/**' jobs: deploy: From a6ac7514436197dc73506bd1ccac05418397493b Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Wed, 25 Sep 2024 12:49:14 +0530 Subject: [PATCH 034/163] testing research assistant automation flow --- .github/workflows/RAdeploy.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index a603959f..03929bd6 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -4,6 +4,9 @@ on: push: branches: - main + # Trigger on changes in these specific paths + paths: + - 'ResearchAssistant/**' jobs: deploy: From a7ab4e243515d8cedade694c9c32789c3ab37e8d Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Wed, 25 Sep 2024 12:55:18 +0530 Subject: [PATCH 035/163] testing research assistant automation flow --- .github/workflows/RAdeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 03929bd6..091755e0 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -42,7 +42,7 @@ jobs: fi - # - name: Assign Role to Service Principal + ## - name: Assign Role to Service Principal # id: assign_role # run: | # set -e From 73a5394ba5b0b37a41cf68aee5452f34afe1ec81 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Wed, 25 Sep 2024 13:06:08 +0530 Subject: [PATCH 036/163] testing automation flow --- .github/workflows/RAdeploy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 091755e0..d39c1531 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -4,9 +4,9 @@ on: push: branches: - main - # Trigger on changes in these specific paths - paths: - - 'ResearchAssistant/**' + # # Trigger on changes in these specific paths + # paths: + # - 'ResearchAssistant/**' jobs: deploy: From 631c226c0b1543aac8097330e0146878b0d668f9 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Wed, 25 Sep 2024 13:42:04 +0530 Subject: [PATCH 037/163] testing automation flow --- .github/workflows/RAdeploy.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index d39c1531..e0cb51aa 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -53,20 +53,21 @@ jobs: id: deploy run: | set -e - output_file=$(mktemp) - az deployment group create \ + output=$(az deployment group create \ --resource-group pslautomationbyoa2 \ --template-file ResearchAssistant/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=pslre2 \ - &> "$output_file" || echo "Command failed, capturing output and error." - - output=$(cat "$output_file") - echo "===============================================================================" - echo "$output" + --parameters solutionPrefix=pslre2 2>&1) || { + echo "Deployment failed. Here is the error mesage:" + echo "###########################################################################" + echo "$output" >> $GITHUB_ENV + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo "$output" + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + exit 1 + } echo "******************************************************************************" echo "output=$output" >> $GITHUB_ENV echo "******************************************************************************" - rm "$output_file" - name: Send Notification on Failure if: failure() From 12ea9af2910ddb888fbf7647da4d5c8f80dc8c8b Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Wed, 25 Sep 2024 15:11:20 +0530 Subject: [PATCH 038/163] testing research assistant automation flow --- .github/workflows/RAdeploy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index e0cb51aa..ca1737d5 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -4,9 +4,9 @@ on: push: branches: - main - # # Trigger on changes in these specific paths - # paths: - # - 'ResearchAssistant/**' + # Trigger on changes in these specific paths + paths: + - 'ResearchAssistant/**' jobs: deploy: From d592dbdcb6d4d8c0fbc604973d39dbdcfcdfd1be Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Wed, 25 Sep 2024 15:29:10 +0530 Subject: [PATCH 039/163] testing automation flow --- .github/workflows/RAdeploy.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index ca1737d5..2ae02835 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -4,9 +4,9 @@ on: push: branches: - main - # Trigger on changes in these specific paths - paths: - - 'ResearchAssistant/**' + # # Trigger on changes in these specific paths + # paths: + # - 'ResearchAssistant/**' jobs: deploy: @@ -56,7 +56,7 @@ jobs: output=$(az deployment group create \ --resource-group pslautomationbyoa2 \ --template-file ResearchAssistant/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=pslre2 2>&1) || { + --parameters 2>&1) || { echo "Deployment failed. Here is the error mesage:" echo "###########################################################################" echo "$output" >> $GITHUB_ENV From edd802565bdd5fbee35a1835c337419e35f823f1 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Wed, 25 Sep 2024 15:50:48 +0530 Subject: [PATCH 040/163] testing automation flow --- .github/workflows/RAdeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 2ae02835..c7c21fda 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -78,4 +78,4 @@ jobs: echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ -H "Content-Type: application/json" \ - -d "{\"failureMessage\": \"$output\"}" \ No newline at end of file + -d "{\"message\": \"Workflow failed!\", \"runLink\": \"${{ github.run_url }}\"}" \ No newline at end of file From 14b6a42d0ba3ebf043e2680e83782ab5d64e3b98 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Wed, 25 Sep 2024 15:59:55 +0530 Subject: [PATCH 041/163] testing automation flow --- .github/workflows/RAdeploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index c7c21fda..b0f0e735 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -72,6 +72,7 @@ jobs: - name: Send Notification on Failure if: failure() run: | + echo "GitHub Context:" echo "${{ toJson(github) }}" output="${{ env.output }}" echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" echo "$output" From 265e9a20779883d8d77891afe04b4167ea88816b Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Wed, 25 Sep 2024 16:08:49 +0530 Subject: [PATCH 042/163] testing automation flow --- .github/workflows/RAdeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index b0f0e735..7ce5a23d 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -79,4 +79,4 @@ jobs: echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ -H "Content-Type: application/json" \ - -d "{\"message\": \"Workflow failed!\", \"runLink\": \"${{ github.run_url }}\"}" \ No newline at end of file + -d "{\"failureMessage\": \"Workflow failed!\", \"runLink\": \"${{ github.run_url }}\"}" \ No newline at end of file From 60f7bcb39abc2d7e509f5b4df1d97d63d5f236fe Mon Sep 17 00:00:00 2001 From: Roopan-Microsoft <168007406+Roopan-Microsoft@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:31:13 +0530 Subject: [PATCH 043/163] Update RAdeploy.yml --- .github/workflows/RAdeploy.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 7ce5a23d..7d31fac9 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -72,11 +72,16 @@ jobs: - name: Send Notification on Failure if: failure() run: | - echo "GitHub Context:" echo "${{ toJson(github) }}" - output="${{ env.output }}" - echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" - echo "$output" - echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" - curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ + # Construct the full run URL + RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + + # Construct the email body as a simple JSON object + EMAIL_BODY=$(cat < Date: Wed, 25 Sep 2024 16:34:15 +0530 Subject: [PATCH 044/163] testing automation flow --- .github/workflows/RAdeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 7d31fac9..1e50df54 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -84,4 +84,4 @@ jobs: ) curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ -H "Content-Type: application/json" \ - -d "{\"failureMessage\": $EMAIL_BODY}\"} || echo "Failed to send notification" + -d "{\"failureMessage\": "$EMAIL_BODY"}\"} || echo "Failed to send notification" From d3af27f820322e79321ac30f006e8088476553f0 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Wed, 25 Sep 2024 16:38:24 +0530 Subject: [PATCH 045/163] testing automation flow --- .github/workflows/RAdeploy.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 1e50df54..ca72548d 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -72,16 +72,16 @@ jobs: - name: Send Notification on Failure if: failure() run: | - # Construct the full run URL - RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + # Construct the full run URL + RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" - # Construct the email body as a simple JSON object - EMAIL_BODY=$(cat < Date: Wed, 25 Sep 2024 16:42:33 +0530 Subject: [PATCH 046/163] testing automation flow --- .github/workflows/RAdeploy.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index ca72548d..89056a82 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -72,16 +72,17 @@ jobs: - name: Send Notification on Failure if: failure() run: | - # Construct the full run URL RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" - - # Construct the email body as a simple JSON object + + # Construct the email body EMAIL_BODY=$(cat <Dear Team,

We would like to inform you that the CWYD Automation process has encountered an issue and has failed to complete successfully.

Run ID: ${RUN_URL}
Failure Message: ${OUTPUT}

Please investigate the matter at your earliest convenience.

Best regards,
Your Automation Team

" } EOF ) + + # Send the notification curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ -H "Content-Type: application/json" \ - -d "{\"failureMessage\": "$EMAIL_BODY"}\}" || echo "Failed to send notification" + -d "$EMAIL_BODY" || echo "Failed to send notification" \ No newline at end of file From cc7d7a4c05bd483e7e4b7911c23d39aa7aa0d2e8 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Wed, 25 Sep 2024 16:59:10 +0530 Subject: [PATCH 047/163] testing automation flow --- .github/workflows/RAdeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 89056a82..97ae173d 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -77,7 +77,7 @@ jobs: # Construct the email body EMAIL_BODY=$(cat <Dear Team,

We would like to inform you that the CWYD Automation process has encountered an issue and has failed to complete successfully.

Run ID: ${RUN_URL}
Failure Message: ${OUTPUT}

Please investigate the matter at your earliest convenience.

Best regards,
Your Automation Team

" + "body": "

Dear Team,

We would like to inform you that the Research Assistant Automation process has encountered an issue and has failed to complete successfully.

Build URL: ${RUN_URL}
${OUTPUT}

Please investigate the matter at your earliest convenience.

Best regards,
Your Automation Team

" } EOF ) From f35e9088459dd34a5780a2483f2799a425fb6e66 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Wed, 25 Sep 2024 17:27:02 +0530 Subject: [PATCH 048/163] testing automation flow --- .github/workflows/RAdeploy.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 97ae173d..bf6256ee 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -53,21 +53,22 @@ jobs: id: deploy run: | set -e - output=$(az deployment group create \ + output_file=$(mktemp) + az deployment group create \ --resource-group pslautomationbyoa2 \ --template-file ResearchAssistant/Deployment/bicep/main.bicep \ - --parameters 2>&1) || { - echo "Deployment failed. Here is the error mesage:" - echo "###########################################################################" - echo "$output" >> $GITHUB_ENV - echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - echo "$output" - echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - exit 1 + --parameters solutionPrefix=pslre2 \ + &> "$output_file" || { + echo "Command failed, capturing output and error." } + + output=$(< "$output_file") + echo "===============================================================================" + echo "$output" echo "******************************************************************************" echo "output=$output" >> $GITHUB_ENV echo "******************************************************************************" + rm "$output_file" - name: Send Notification on Failure if: failure() From a4e9f3c7e6787db11187cc177cda2e4ab876b8a0 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Wed, 25 Sep 2024 17:55:52 +0530 Subject: [PATCH 049/163] testing automation flow --- .github/workflows/RAdeploy.yml | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index bf6256ee..c7de83cc 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -57,19 +57,30 @@ jobs: az deployment group create \ --resource-group pslautomationbyoa2 \ --template-file ResearchAssistant/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=pslre2 \ - &> "$output_file" || { - echo "Command failed, capturing output and error." - } + --parameters \ + &> "$output_file" || echo "Command failed, capturing output and error." - output=$(< "$output_file") echo "===============================================================================" - echo "$output" - echo "******************************************************************************" - echo "output=$output" >> $GITHUB_ENV + cat "$output_file" + echo "******************************************************************************" + + # Extract only the lines containing 'error' or 'failed' + error_output=$(grep -i -e "error" -e "failed" "$output_file" || true) + + echo "===============================================================================" + cat "$error_output" + echo "******************************************************************************" + + + if [[ -n "$error_output" ]]; then + echo "error_output=$error_output" >> $GITHUB_ENV + else + echo "No errors found in the output." + fi + echo "******************************************************************************" rm "$output_file" - + - name: Send Notification on Failure if: failure() run: | From 857ee2195ba32469e7c32f96ab63a3b879b14256 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Wed, 25 Sep 2024 18:01:07 +0530 Subject: [PATCH 050/163] testing automation flow --- .github/workflows/RAdeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index c7de83cc..6fc63253 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -65,7 +65,7 @@ jobs: echo "******************************************************************************" # Extract only the lines containing 'error' or 'failed' - error_output=$(grep -i -e "error" -e "failed" "$output_file" || true) + error_output=$(grep -i -e "Error" "$output_file" || true) echo "===============================================================================" cat "$error_output" From 7193a1e46108e5bf1c75cd338826aa53a16bf198 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Wed, 25 Sep 2024 18:32:39 +0530 Subject: [PATCH 051/163] testing automation flow --- .github/workflows/RAdeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 6fc63253..f41b5f12 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -65,7 +65,7 @@ jobs: echo "******************************************************************************" # Extract only the lines containing 'error' or 'failed' - error_output=$(grep -i -e "Error" "$output_file" || true) + error_output=$(grep -i -e "ERROR" "$output_file" || true) echo "===============================================================================" cat "$error_output" From 51ae9e030138eeebc02fe2993b1b6f5da0d6360f Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Wed, 25 Sep 2024 18:36:14 +0530 Subject: [PATCH 052/163] testing automation flow --- .github/workflows/RAdeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index f41b5f12..1e7ac8ce 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -65,7 +65,7 @@ jobs: echo "******************************************************************************" # Extract only the lines containing 'error' or 'failed' - error_output=$(grep -i -e "ERROR" "$output_file" || true) + error_output=$(grep -i -e "ERROR:" "$output_file" || true) echo "===============================================================================" cat "$error_output" From 53651b32897e7ec54e6e58086a44b411916e2afe Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Wed, 25 Sep 2024 18:49:03 +0530 Subject: [PATCH 053/163] client advisor automation --- ClientAdvisor/test.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 ClientAdvisor/test.txt diff --git a/ClientAdvisor/test.txt b/ClientAdvisor/test.txt new file mode 100644 index 00000000..e69de29b From 9aea3485f74c0cf273d2a2677b34a023686f3070 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Wed, 25 Sep 2024 18:52:35 +0530 Subject: [PATCH 054/163] research assistant automation --- .github/workflows/RAdeploy.yml | 6 +++--- ResearchAssistant/test.txt | 0 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 ResearchAssistant/test.txt diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 1e7ac8ce..d1fa4b79 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -4,9 +4,9 @@ on: push: branches: - main - # # Trigger on changes in these specific paths - # paths: - # - 'ResearchAssistant/**' + # Trigger on changes in these specific paths + paths: + - 'ResearchAssistant/**' jobs: deploy: diff --git a/ResearchAssistant/test.txt b/ResearchAssistant/test.txt new file mode 100644 index 00000000..e69de29b From 205aac614c13e264cf9f82ada410fbe4469f55ce Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Wed, 25 Sep 2024 18:53:35 +0530 Subject: [PATCH 055/163] client advisor automation --- .github/workflows/CAdeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 7367cea6..661b6567 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -48,7 +48,7 @@ jobs: az deployment group create \ --resource-group pslautomationbyoa2 \ --template-file ClientAdvisor/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=pslca + --parameters solutionPrefix=pslca cosmosLocation=eastus2 - name: Send Notification on Failure if: failure() From 58ebd164916ec7057d1ea26a0e903c09ece304b3 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Wed, 25 Sep 2024 19:58:00 +0530 Subject: [PATCH 056/163] testing research assistant --- .github/workflows/RAdeploy.yml | 37 ++--------------------- ResearchAssistant/{test.txt => test1.txt} | 0 2 files changed, 2 insertions(+), 35 deletions(-) rename ResearchAssistant/{test.txt => test1.txt} (100%) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index d1fa4b79..9747f83d 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -4,7 +4,6 @@ on: push: branches: - main - # Trigger on changes in these specific paths paths: - 'ResearchAssistant/**' @@ -41,46 +40,14 @@ jobs: echo "Resource group already exists." fi - - ## - name: Assign Role to Service Principal - # id: assign_role - # run: | - # set -e - # echo "Assigning Owner role to the service principal..." - # az role assignment create --assignee ${{ secrets.AZURE_CLIENT_ID }} --role "Owner" --scope /subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }} || { echo "Error assigning role"; exit 1; } - - name: Deploy Bicep Template id: deploy run: | - set -e - output_file=$(mktemp) az deployment group create \ --resource-group pslautomationbyoa2 \ --template-file ResearchAssistant/Deployment/bicep/main.bicep \ - --parameters \ - &> "$output_file" || echo "Command failed, capturing output and error." - - echo "===============================================================================" - cat "$output_file" - echo "******************************************************************************" - - # Extract only the lines containing 'error' or 'failed' - error_output=$(grep -i -e "ERROR:" "$output_file" || true) - - echo "===============================================================================" - cat "$error_output" - echo "******************************************************************************" - - - if [[ -n "$error_output" ]]; then - echo "error_output=$error_output" >> $GITHUB_ENV - else - echo "No errors found in the output." - fi - - echo "******************************************************************************" - rm "$output_file" - + --parameters solutionPrefix=pslre2 \ + - name: Send Notification on Failure if: failure() run: | diff --git a/ResearchAssistant/test.txt b/ResearchAssistant/test1.txt similarity index 100% rename from ResearchAssistant/test.txt rename to ResearchAssistant/test1.txt From 697f482321e0917372c1e1d1fa72fbeafefe84b2 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Wed, 25 Sep 2024 20:03:03 +0530 Subject: [PATCH 057/163] testing client advisor --- .github/workflows/CAdeploy.yml | 14 ++++++++++++-- ClientAdvisor/{test.txt => test1.txt} | 0 2 files changed, 12 insertions(+), 2 deletions(-) rename ClientAdvisor/{test.txt => test1.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 661b6567..90715e73 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -4,7 +4,6 @@ on: push: branches: - main - # Trigger on changes in these specific paths paths: - 'ClientAdvisor/**' @@ -53,6 +52,17 @@ jobs: - name: Send Notification on Failure if: failure() run: | + RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + + # Construct the email body + EMAIL_BODY=$(cat <Dear Team,

We would like to inform you that the Client Advisor Automation process has encountered an issue and has failed to complete successfully.

Build URL: ${RUN_URL}
${OUTPUT}

Please investigate the matter at your earliest convenience.

Best regards,
Your Automation Team

" + } + EOF + ) + + # Send the notification curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ -H "Content-Type: application/json" \ - -d "{\"failureMessage\": \"$output\"}" \ No newline at end of file + -d "$EMAIL_BODY" || echo "Failed to send notification" \ No newline at end of file diff --git a/ClientAdvisor/test.txt b/ClientAdvisor/test1.txt similarity index 100% rename from ClientAdvisor/test.txt rename to ClientAdvisor/test1.txt From 715c62bf8e66ec183725817a5b690573ec2ce20d Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Thu, 26 Sep 2024 10:41:54 +0530 Subject: [PATCH 058/163] testing automation flow --- .github/workflows/RAdeploy.yml | 2 +- ResearchAssistant/{test1.txt => test2.txt} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename ResearchAssistant/{test1.txt => test2.txt} (100%) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 9747f83d..1ca047bd 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -46,7 +46,7 @@ jobs: az deployment group create \ --resource-group pslautomationbyoa2 \ --template-file ResearchAssistant/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=pslre2 \ + --parameters \ - name: Send Notification on Failure if: failure() diff --git a/ResearchAssistant/test1.txt b/ResearchAssistant/test2.txt similarity index 100% rename from ResearchAssistant/test1.txt rename to ResearchAssistant/test2.txt From 527a1bee895fca27a6f470668b07da53f826dc58 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Thu, 26 Sep 2024 11:14:55 +0530 Subject: [PATCH 059/163] testing automation flow --- .github/workflows/RAdeploy.yml | 49 ++++++++++++++++++++-- ResearchAssistant/{test2.txt => test4.txt} | 0 2 files changed, 45 insertions(+), 4 deletions(-) rename ResearchAssistant/{test2.txt => test4.txt} (100%) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 1ca047bd..819b7f63 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -26,27 +26,68 @@ jobs: - name: Install Bicep CLI run: az bicep install + + - name: Generate Resource Group Name + id: generate_rg_name + run: | + echo "Generating a unique resource group name..." + TIMESTAMP=$(date +%Y%m%d%H%M%S) + COMMON_PART="pslautomationRes" + UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" + echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV + echo "##########################" + echo "$RESOURCE_GROUP_NAME" + echo "$$$$$$$$$$$$$$$$$$$$$$$$$$$" + echo "${{ env.RESOURCE_GROUP_NAME }}" + echo "888888888888888888888888888" + echo "Generated SOLUTION_PREFIX: ${RESOURCE_GROUP_NAME}" - name: Check and Create Resource Group id: check_create_rg run: | set -e echo "Checking if resource group exists..." - rg_exists=$(az group exists --name pslautomationbyoa2) + rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) if [ "$rg_exists" = "false" ]; then echo "Resource group does not exist. Creating..." - az group create --name pslautomationbyoa2 --location eastus || { echo "Error creating resource group"; exit 1; } + az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location eastus || { echo "Error creating resource group"; exit 1; } else echo "Resource group already exists." fi + - name: Generate Unique Solution Prefix + id: generate_solution_prefix + run: | + set -e + COMMON_PART="psl" + TIMESTAMP=$(date +%s) + UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 2) + UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" + echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV + echo "ssssssssssssssssssssssssssssssssssssssssssssssssssss" + echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" + - name: Deploy Bicep Template id: deploy run: | + set -e az deployment group create \ - --resource-group pslautomationbyoa2 \ + --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ --template-file ResearchAssistant/Deployment/bicep/main.bicep \ - --parameters \ + --parameters solutionPrefix=pslre2 + + - name: Delete Bicep Deployment + run: | + set -e + echo "Checking if resource group exists..." + rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) + if [ "$rg_exists" = "true" ]; then + echo "Resource group exist. Cleaning..." + az group delete \ + --name ${{ env.RESOURCE_GROUP_NAME }} \ + --yes \ + --no-wait + - name: Send Notification on Failure if: failure() diff --git a/ResearchAssistant/test2.txt b/ResearchAssistant/test4.txt similarity index 100% rename from ResearchAssistant/test2.txt rename to ResearchAssistant/test4.txt From 63eacefcfc77afc862e079a4b85c8203df6337d5 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Thu, 26 Sep 2024 11:25:20 +0530 Subject: [PATCH 060/163] testing automation flow --- .github/workflows/RAdeploy.yml | 25 +++++++++++++--------- ResearchAssistant/{test4.txt => test5.txt} | 0 2 files changed, 15 insertions(+), 10 deletions(-) rename ResearchAssistant/{test4.txt => test5.txt} (100%) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 819b7f63..2fe80fea 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -37,14 +37,17 @@ jobs: echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV echo "##########################" echo "$RESOURCE_GROUP_NAME" - echo "$$$$$$$$$$$$$$$$$$$$$$$$$$$" + echo "111111111111111111111111111" echo "${{ env.RESOURCE_GROUP_NAME }}" + echo "222222222222222222222222222" + echo "resssoucce grp: ${{ env.RESOURCE_GROUP_NAME }}" echo "888888888888888888888888888" echo "Generated SOLUTION_PREFIX: ${RESOURCE_GROUP_NAME}" - name: Check and Create Resource Group id: check_create_rg run: | + echo "ressource grp: ${{ env.RESOURCE_GROUP_NAME }}" set -e echo "Checking if resource group exists..." rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) @@ -67,15 +70,6 @@ jobs: echo "ssssssssssssssssssssssssssssssssssssssssssssssssssss" echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" - - name: Deploy Bicep Template - id: deploy - run: | - set -e - az deployment group create \ - --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ - --template-file ResearchAssistant/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=pslre2 - - name: Delete Bicep Deployment run: | set -e @@ -87,6 +81,17 @@ jobs: --name ${{ env.RESOURCE_GROUP_NAME }} \ --yes \ --no-wait + + - name: Deploy Bicep Template + id: deploy + run: | + set -e + az deployment group create \ + --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ + --template-file ResearchAssistant/Deployment/bicep/main.bicep \ + --parameters solutionPrefix=pslre2 + + - name: Send Notification on Failure diff --git a/ResearchAssistant/test4.txt b/ResearchAssistant/test5.txt similarity index 100% rename from ResearchAssistant/test4.txt rename to ResearchAssistant/test5.txt From 4113fb47d5fb87a103f50b2b3bb3db6a94c73864 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Thu, 26 Sep 2024 11:30:49 +0530 Subject: [PATCH 061/163] testing automation flow --- .github/workflows/RAdeploy.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 2fe80fea..1cb7c279 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -35,12 +35,6 @@ jobs: COMMON_PART="pslautomationRes" UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV - echo "##########################" - echo "$RESOURCE_GROUP_NAME" - echo "111111111111111111111111111" - echo "${{ env.RESOURCE_GROUP_NAME }}" - echo "222222222222222222222222222" - echo "resssoucce grp: ${{ env.RESOURCE_GROUP_NAME }}" echo "888888888888888888888888888" echo "Generated SOLUTION_PREFIX: ${RESOURCE_GROUP_NAME}" @@ -81,6 +75,9 @@ jobs: --name ${{ env.RESOURCE_GROUP_NAME }} \ --yes \ --no-wait + else + echo "Resource group does not exists." + fi - name: Deploy Bicep Template id: deploy @@ -91,9 +88,6 @@ jobs: --template-file ResearchAssistant/Deployment/bicep/main.bicep \ --parameters solutionPrefix=pslre2 - - - - name: Send Notification on Failure if: failure() run: | From 13781b6479a54a0a846da64a61f449d47d6d117d Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Thu, 26 Sep 2024 11:31:45 +0530 Subject: [PATCH 062/163] testing automation flow --- ResearchAssistant/{test5.txt => test2.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ResearchAssistant/{test5.txt => test2.txt} (100%) diff --git a/ResearchAssistant/test5.txt b/ResearchAssistant/test2.txt similarity index 100% rename from ResearchAssistant/test5.txt rename to ResearchAssistant/test2.txt From b6242cbc5010bc9c6bcd464540eef36f9eaa8d2c Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Thu, 26 Sep 2024 11:35:43 +0530 Subject: [PATCH 063/163] testing automation flow --- .github/workflows/RAdeploy.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 1cb7c279..967783df 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -36,7 +36,9 @@ jobs: UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV echo "888888888888888888888888888" - echo "Generated SOLUTION_PREFIX: ${RESOURCE_GROUP_NAME}" + echo "Generated SOLUTION_PREFIX: ${UNIQUE_RG_NAME}" + echo "999999999999999999999999999" + echo "Generated SOLUTION_PREFIX: ${{ env.RESOURCE_GROUP_NAME }}" - name: Check and Create Resource Group id: check_create_rg From 2054d311d7e0f2902561bede7c7fc4bbac184e3d Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Thu, 26 Sep 2024 11:38:26 +0530 Subject: [PATCH 064/163] testing automation flow --- ResearchAssistant/{test2.txt => test3.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ResearchAssistant/{test2.txt => test3.txt} (100%) diff --git a/ResearchAssistant/test2.txt b/ResearchAssistant/test3.txt similarity index 100% rename from ResearchAssistant/test2.txt rename to ResearchAssistant/test3.txt From 59eb2df7437a5c6b6fb7b3e2d7beb25e4290a08a Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Thu, 26 Sep 2024 11:46:15 +0530 Subject: [PATCH 065/163] testing automation flow --- .github/workflows/RAdeploy.yml | 26 +++++++++------------- ResearchAssistant/{test3.txt => test4.txt} | 0 2 files changed, 11 insertions(+), 15 deletions(-) rename ResearchAssistant/{test3.txt => test4.txt} (100%) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 967783df..ee340d12 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -35,15 +35,12 @@ jobs: COMMON_PART="pslautomationRes" UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV - echo "888888888888888888888888888" echo "Generated SOLUTION_PREFIX: ${UNIQUE_RG_NAME}" - echo "999999999999999999999999999" - echo "Generated SOLUTION_PREFIX: ${{ env.RESOURCE_GROUP_NAME }}" + - name: Check and Create Resource Group id: check_create_rg run: | - echo "ressource grp: ${{ env.RESOURCE_GROUP_NAME }}" set -e echo "Checking if resource group exists..." rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) @@ -60,12 +57,20 @@ jobs: set -e COMMON_PART="psl" TIMESTAMP=$(date +%s) - UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 2) + UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3) UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV - echo "ssssssssssssssssssssssssssssssssssssssssssssssssssss" echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" + - name: Deploy Bicep Template + id: deploy + run: | + set -e + az deployment group create \ + --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ + --template-file ResearchAssistant/Deployment/bicep/main.bicep \ + --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} + - name: Delete Bicep Deployment run: | set -e @@ -81,15 +86,6 @@ jobs: echo "Resource group does not exists." fi - - name: Deploy Bicep Template - id: deploy - run: | - set -e - az deployment group create \ - --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ - --template-file ResearchAssistant/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=pslre2 - - name: Send Notification on Failure if: failure() run: | diff --git a/ResearchAssistant/test3.txt b/ResearchAssistant/test4.txt similarity index 100% rename from ResearchAssistant/test3.txt rename to ResearchAssistant/test4.txt From 86cc456e93dc71eda4c6c93b82fd26e7ab74d801 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Thu, 26 Sep 2024 12:03:16 +0530 Subject: [PATCH 066/163] testing automation flow --- .github/workflows/RAdeploy.yml | 1 - ResearchAssistant/{test4.txt => test.txt} | 0 2 files changed, 1 deletion(-) rename ResearchAssistant/{test4.txt => test.txt} (100%) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index ee340d12..52a78642 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -36,7 +36,6 @@ jobs: UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV echo "Generated SOLUTION_PREFIX: ${UNIQUE_RG_NAME}" - - name: Check and Create Resource Group id: check_create_rg diff --git a/ResearchAssistant/test4.txt b/ResearchAssistant/test.txt similarity index 100% rename from ResearchAssistant/test4.txt rename to ResearchAssistant/test.txt From c3709bcf5884d32c499b074b1d8921238377f0cb Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Thu, 26 Sep 2024 12:10:12 +0530 Subject: [PATCH 067/163] testing automation flow --- ResearchAssistant/{test.txt => test2.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ResearchAssistant/{test.txt => test2.txt} (100%) diff --git a/ResearchAssistant/test.txt b/ResearchAssistant/test2.txt similarity index 100% rename from ResearchAssistant/test.txt rename to ResearchAssistant/test2.txt From 84b8709f134ecdc2037f38f692af6b1f2e1083d2 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Thu, 26 Sep 2024 12:18:26 +0530 Subject: [PATCH 068/163] testing automation flow --- .github/workflows/RAdeploy.yml | 1 + ResearchAssistant/{test2.txt => test3.txt} | 0 2 files changed, 1 insertion(+) rename ResearchAssistant/{test2.txt => test3.txt} (100%) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 52a78642..92b7de17 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -71,6 +71,7 @@ jobs: --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} - name: Delete Bicep Deployment + if: success() run: | set -e echo "Checking if resource group exists..." diff --git a/ResearchAssistant/test2.txt b/ResearchAssistant/test3.txt similarity index 100% rename from ResearchAssistant/test2.txt rename to ResearchAssistant/test3.txt From 243783d99255805c12ac8db568c674463e2f0dd0 Mon Sep 17 00:00:00 2001 From: Rohini-Microsoft Date: Thu, 26 Sep 2024 14:52:56 +0530 Subject: [PATCH 069/163] removed load_env --- ClientAdvisor/AzureFunction/function_app.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/ClientAdvisor/AzureFunction/function_app.py b/ClientAdvisor/AzureFunction/function_app.py index 0d9e2e61..7c250c8d 100644 --- a/ClientAdvisor/AzureFunction/function_app.py +++ b/ClientAdvisor/AzureFunction/function_app.py @@ -18,8 +18,6 @@ from semantic_kernel.functions.kernel_function_decorator import kernel_function from semantic_kernel.kernel import Kernel import pymssql -from dotenv import load_dotenv -load_dotenv() # Azure Function App app = func.FunctionApp(http_auth_level=func.AuthLevel.ANONYMOUS) From 8f7c299f225b675b1d9cbd61cb1ecb06e32bd89f Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Thu, 26 Sep 2024 16:56:40 +0530 Subject: [PATCH 070/163] testing automation --- .github/workflows/CAdeploy.yml | 2 +- ClientAdvisor/{test1.txt => test2.txt} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename ClientAdvisor/{test1.txt => test2.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 90715e73..6c95a63b 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -35,7 +35,7 @@ jobs: rg_exists=$(az group exists --name pslautomationca) if [ "$rg_exists" = "false" ]; then echo "Resource group does not exist. Creating..." - az group create --name pslautomationbyoa2 --location eastus || { echo "Error creating resource group"; exit 1; } + az group create --name pslautomationbyoa2 --location eastus2 || { echo "Error creating resource group"; exit 1; } else echo "Resource group already exists." fi diff --git a/ClientAdvisor/test1.txt b/ClientAdvisor/test2.txt similarity index 100% rename from ClientAdvisor/test1.txt rename to ClientAdvisor/test2.txt From ba8129c7392810e27c47787c6470375ef85537d3 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Thu, 26 Sep 2024 17:35:46 +0530 Subject: [PATCH 071/163] testing automation flow --- .github/workflows/CAdeploy.yml | 2 +- ClientAdvisor/{test2.txt => test3.txt} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename ClientAdvisor/{test2.txt => test3.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 6c95a63b..90715e73 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -35,7 +35,7 @@ jobs: rg_exists=$(az group exists --name pslautomationca) if [ "$rg_exists" = "false" ]; then echo "Resource group does not exist. Creating..." - az group create --name pslautomationbyoa2 --location eastus2 || { echo "Error creating resource group"; exit 1; } + az group create --name pslautomationbyoa2 --location eastus || { echo "Error creating resource group"; exit 1; } else echo "Resource group already exists." fi diff --git a/ClientAdvisor/test2.txt b/ClientAdvisor/test3.txt similarity index 100% rename from ClientAdvisor/test2.txt rename to ClientAdvisor/test3.txt From d383cb65dc321cd9e1ca44be65bfbecf5a5242b0 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Thu, 26 Sep 2024 18:04:27 +0530 Subject: [PATCH 072/163] testing automation flow --- .github/workflows/CAdeploy.yml | 2 +- ClientAdvisor/{test3.txt => test2.txt} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename ClientAdvisor/{test3.txt => test2.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 90715e73..f9bd5793 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -35,7 +35,7 @@ jobs: rg_exists=$(az group exists --name pslautomationca) if [ "$rg_exists" = "false" ]; then echo "Resource group does not exist. Creating..." - az group create --name pslautomationbyoa2 --location eastus || { echo "Error creating resource group"; exit 1; } + az group create --name pslautomationbyoa2 --location northcentralus || { echo "Error creating resource group"; exit 1; } else echo "Resource group already exists." fi diff --git a/ClientAdvisor/test3.txt b/ClientAdvisor/test2.txt similarity index 100% rename from ClientAdvisor/test3.txt rename to ClientAdvisor/test2.txt From ca9fd63efb6b292b9c76cfb4f79c5d6cc5822747 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Thu, 26 Sep 2024 18:08:03 +0530 Subject: [PATCH 073/163] testing automation flow --- .github/workflows/CAdeploy.yml | 4 ++-- ClientAdvisor/{test2.txt => test3.txt} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename ClientAdvisor/{test2.txt => test3.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index f9bd5793..d45f1ef7 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -35,7 +35,7 @@ jobs: rg_exists=$(az group exists --name pslautomationca) if [ "$rg_exists" = "false" ]; then echo "Resource group does not exist. Creating..." - az group create --name pslautomationbyoa2 --location northcentralus || { echo "Error creating resource group"; exit 1; } + az group create --name pslautomationbyoa3 --location northcentralus || { echo "Error creating resource group"; exit 1; } else echo "Resource group already exists." fi @@ -45,7 +45,7 @@ jobs: run: | set -e az deployment group create \ - --resource-group pslautomationbyoa2 \ + --resource-group pslautomationbyoa3 \ --template-file ClientAdvisor/Deployment/bicep/main.bicep \ --parameters solutionPrefix=pslca cosmosLocation=eastus2 diff --git a/ClientAdvisor/test2.txt b/ClientAdvisor/test3.txt similarity index 100% rename from ClientAdvisor/test2.txt rename to ClientAdvisor/test3.txt From ffa7e5859af4f5484c870d16046775457e1b25eb Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Thu, 26 Sep 2024 18:14:36 +0530 Subject: [PATCH 074/163] testing automation flow --- .github/workflows/CAdeploy.yml | 2 +- ClientAdvisor/{test3.txt => test4.txt} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename ClientAdvisor/{test3.txt => test4.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index d45f1ef7..db502ed9 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -47,7 +47,7 @@ jobs: az deployment group create \ --resource-group pslautomationbyoa3 \ --template-file ClientAdvisor/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=pslca cosmosLocation=eastus2 + --parameters solutionPrefix=pslc cosmosLocation=eastus2 - name: Send Notification on Failure if: failure() diff --git a/ClientAdvisor/test3.txt b/ClientAdvisor/test4.txt similarity index 100% rename from ClientAdvisor/test3.txt rename to ClientAdvisor/test4.txt From 61f087a2ff97cf151d6be303bffffb67c6a6d494 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Thu, 26 Sep 2024 18:22:54 +0530 Subject: [PATCH 075/163] testing automation flow --- .github/workflows/CAdeploy.yml | 2 +- ClientAdvisor/{test4.txt => test5.txt} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename ClientAdvisor/{test4.txt => test5.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index db502ed9..41a9c0d7 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -35,7 +35,7 @@ jobs: rg_exists=$(az group exists --name pslautomationca) if [ "$rg_exists" = "false" ]; then echo "Resource group does not exist. Creating..." - az group create --name pslautomationbyoa3 --location northcentralus || { echo "Error creating resource group"; exit 1; } + az group create --name pslautomationbyoa3 --location southcentralus || { echo "Error creating resource group"; exit 1; } else echo "Resource group already exists." fi diff --git a/ClientAdvisor/test4.txt b/ClientAdvisor/test5.txt similarity index 100% rename from ClientAdvisor/test4.txt rename to ClientAdvisor/test5.txt From c611354839c605151b9c9b4a9ee8052c1ecb7516 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Thu, 26 Sep 2024 18:25:06 +0530 Subject: [PATCH 076/163] testing automation flow --- .github/workflows/CAdeploy.yml | 4 ++-- ClientAdvisor/{test5.txt => test.txt} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename ClientAdvisor/{test5.txt => test.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 41a9c0d7..0c184beb 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -35,7 +35,7 @@ jobs: rg_exists=$(az group exists --name pslautomationca) if [ "$rg_exists" = "false" ]; then echo "Resource group does not exist. Creating..." - az group create --name pslautomationbyoa3 --location southcentralus || { echo "Error creating resource group"; exit 1; } + az group create --name pslautomationbyoa4 --location southcentralus || { echo "Error creating resource group"; exit 1; } else echo "Resource group already exists." fi @@ -45,7 +45,7 @@ jobs: run: | set -e az deployment group create \ - --resource-group pslautomationbyoa3 \ + --resource-group pslautomationbyoa4 \ --template-file ClientAdvisor/Deployment/bicep/main.bicep \ --parameters solutionPrefix=pslc cosmosLocation=eastus2 diff --git a/ClientAdvisor/test5.txt b/ClientAdvisor/test.txt similarity index 100% rename from ClientAdvisor/test5.txt rename to ClientAdvisor/test.txt From e6a12b95c97272f374d0abb443e11f17f8dbbfc3 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Thu, 26 Sep 2024 20:59:12 +0530 Subject: [PATCH 077/163] testing automation flow --- .github/workflows/CAdeploy.yml | 6 +++--- ClientAdvisor/{test.txt => test1.txt} | 0 2 files changed, 3 insertions(+), 3 deletions(-) rename ClientAdvisor/{test.txt => test1.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 0c184beb..7e7cd548 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -35,7 +35,7 @@ jobs: rg_exists=$(az group exists --name pslautomationca) if [ "$rg_exists" = "false" ]; then echo "Resource group does not exist. Creating..." - az group create --name pslautomationbyoa4 --location southcentralus || { echo "Error creating resource group"; exit 1; } + az group create --name pslautomationbyoa5 --location eastus2 || { echo "Error creating resource group"; exit 1; } else echo "Resource group already exists." fi @@ -45,9 +45,9 @@ jobs: run: | set -e az deployment group create \ - --resource-group pslautomationbyoa4 \ + --resource-group pslautomationbyoa5 \ --template-file ClientAdvisor/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=pslc cosmosLocation=eastus2 + --parameters solutionPrefix=pslc2 cosmosLocation=eastus2 - name: Send Notification on Failure if: failure() diff --git a/ClientAdvisor/test.txt b/ClientAdvisor/test1.txt similarity index 100% rename from ClientAdvisor/test.txt rename to ClientAdvisor/test1.txt From 840f4d942b46ced770d27ce8a1df272a30298e85 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Thu, 26 Sep 2024 21:03:56 +0530 Subject: [PATCH 078/163] testing automation flow --- .github/workflows/CAdeploy.yml | 2 +- ClientAdvisor/{test1.txt => test2.txt} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename ClientAdvisor/{test1.txt => test2.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 7e7cd548..e04fffc4 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -35,7 +35,7 @@ jobs: rg_exists=$(az group exists --name pslautomationca) if [ "$rg_exists" = "false" ]; then echo "Resource group does not exist. Creating..." - az group create --name pslautomationbyoa5 --location eastus2 || { echo "Error creating resource group"; exit 1; } + az group create --name pslautomationbyoa5 --location eastus || { echo "Error creating resource group"; exit 1; } else echo "Resource group already exists." fi diff --git a/ClientAdvisor/test1.txt b/ClientAdvisor/test2.txt similarity index 100% rename from ClientAdvisor/test1.txt rename to ClientAdvisor/test2.txt From 008256212ff1cda8d1a2f98bc646a13902790d4a Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Thu, 26 Sep 2024 21:11:29 +0530 Subject: [PATCH 079/163] testing automation flow --- .github/workflows/CAdeploy.yml | 4 ++-- ClientAdvisor/{test2.txt => test3.txt} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename ClientAdvisor/{test2.txt => test3.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index e04fffc4..3f46957a 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -35,7 +35,7 @@ jobs: rg_exists=$(az group exists --name pslautomationca) if [ "$rg_exists" = "false" ]; then echo "Resource group does not exist. Creating..." - az group create --name pslautomationbyoa5 --location eastus || { echo "Error creating resource group"; exit 1; } + az group create --name pslautomationbyoa6 --location eastus || { echo "Error creating resource group"; exit 1; } else echo "Resource group already exists." fi @@ -45,7 +45,7 @@ jobs: run: | set -e az deployment group create \ - --resource-group pslautomationbyoa5 \ + --resource-group pslautomationbyoa6 \ --template-file ClientAdvisor/Deployment/bicep/main.bicep \ --parameters solutionPrefix=pslc2 cosmosLocation=eastus2 diff --git a/ClientAdvisor/test2.txt b/ClientAdvisor/test3.txt similarity index 100% rename from ClientAdvisor/test2.txt rename to ClientAdvisor/test3.txt From 433360610440f0612a9d785515d43f21565ac6e4 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 27 Sep 2024 11:18:17 +0530 Subject: [PATCH 080/163] testing automation flow --- .github/workflows/CAdeploy.yml | 6 +++--- ClientAdvisor/{test3.txt => test2.txt} | 0 2 files changed, 3 insertions(+), 3 deletions(-) rename ClientAdvisor/{test3.txt => test2.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 3f46957a..5320a1c9 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -35,7 +35,7 @@ jobs: rg_exists=$(az group exists --name pslautomationca) if [ "$rg_exists" = "false" ]; then echo "Resource group does not exist. Creating..." - az group create --name pslautomationbyoa6 --location eastus || { echo "Error creating resource group"; exit 1; } + az group create --name pslautomationbyoa2 --location southcentralus || { echo "Error creating resource group"; exit 1; } else echo "Resource group already exists." fi @@ -45,9 +45,9 @@ jobs: run: | set -e az deployment group create \ - --resource-group pslautomationbyoa6 \ + --resource-group pslautomationbyoa2 \ --template-file ClientAdvisor/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=pslc2 cosmosLocation=eastus2 + --parameters solutionPrefix=pslc cosmosLocation=eastus2 - name: Send Notification on Failure if: failure() diff --git a/ClientAdvisor/test3.txt b/ClientAdvisor/test2.txt similarity index 100% rename from ClientAdvisor/test3.txt rename to ClientAdvisor/test2.txt From 53ed688078396b79457ebc8878e1f98a0a259923 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 27 Sep 2024 11:27:29 +0530 Subject: [PATCH 081/163] testing automation flow --- .github/workflows/CAdeploy.yml | 4 ++-- ClientAdvisor/{test2.txt => test3.txt} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename ClientAdvisor/{test2.txt => test3.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 5320a1c9..f1512ecc 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -35,7 +35,7 @@ jobs: rg_exists=$(az group exists --name pslautomationca) if [ "$rg_exists" = "false" ]; then echo "Resource group does not exist. Creating..." - az group create --name pslautomationbyoa2 --location southcentralus || { echo "Error creating resource group"; exit 1; } + az group create --name pslautomationbyoa3 --location uksouth || { echo "Error creating resource group"; exit 1; } else echo "Resource group already exists." fi @@ -45,7 +45,7 @@ jobs: run: | set -e az deployment group create \ - --resource-group pslautomationbyoa2 \ + --resource-group pslautomationbyoa3 \ --template-file ClientAdvisor/Deployment/bicep/main.bicep \ --parameters solutionPrefix=pslc cosmosLocation=eastus2 diff --git a/ClientAdvisor/test2.txt b/ClientAdvisor/test3.txt similarity index 100% rename from ClientAdvisor/test2.txt rename to ClientAdvisor/test3.txt From 1078e2601775b8c1d0f70fd57c00725ac06a4c3d Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 27 Sep 2024 11:30:41 +0530 Subject: [PATCH 082/163] testing automation flow --- .github/workflows/CAdeploy.yml | 6 +++--- ClientAdvisor/{test3.txt => test4.txt} | 0 2 files changed, 3 insertions(+), 3 deletions(-) rename ClientAdvisor/{test3.txt => test4.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index f1512ecc..d1b256ed 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -35,7 +35,7 @@ jobs: rg_exists=$(az group exists --name pslautomationca) if [ "$rg_exists" = "false" ]; then echo "Resource group does not exist. Creating..." - az group create --name pslautomationbyoa3 --location uksouth || { echo "Error creating resource group"; exit 1; } + az group create --name pslautomationbyoa4 --location uksouth || { echo "Error creating resource group"; exit 1; } else echo "Resource group already exists." fi @@ -45,9 +45,9 @@ jobs: run: | set -e az deployment group create \ - --resource-group pslautomationbyoa3 \ + --resource-group pslautomationbyoa4 \ --template-file ClientAdvisor/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=pslc cosmosLocation=eastus2 + --parameters solutionPrefix=pslc2 cosmosLocation=eastus2 - name: Send Notification on Failure if: failure() diff --git a/ClientAdvisor/test3.txt b/ClientAdvisor/test4.txt similarity index 100% rename from ClientAdvisor/test3.txt rename to ClientAdvisor/test4.txt From e207931fc15c9d2b133a9f65ad139d0c5a4e7878 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 27 Sep 2024 11:46:18 +0530 Subject: [PATCH 083/163] testing automation flow --- .github/workflows/CAdeploy.yml | 6 +++--- ClientAdvisor/{test4.txt => test2.txt} | 0 2 files changed, 3 insertions(+), 3 deletions(-) rename ClientAdvisor/{test4.txt => test2.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index d1b256ed..f0b66700 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -35,7 +35,7 @@ jobs: rg_exists=$(az group exists --name pslautomationca) if [ "$rg_exists" = "false" ]; then echo "Resource group does not exist. Creating..." - az group create --name pslautomationbyoa4 --location uksouth || { echo "Error creating resource group"; exit 1; } + az group create --name pslautomationbyoa5 --location uksouth || { echo "Error creating resource group"; exit 1; } else echo "Resource group already exists." fi @@ -45,9 +45,9 @@ jobs: run: | set -e az deployment group create \ - --resource-group pslautomationbyoa4 \ + --resource-group pslautomationbyoa5 \ --template-file ClientAdvisor/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=pslc2 cosmosLocation=eastus2 + --parameters solutionPrefix=pslc3 cosmosLocation=eastus2 - name: Send Notification on Failure if: failure() diff --git a/ClientAdvisor/test4.txt b/ClientAdvisor/test2.txt similarity index 100% rename from ClientAdvisor/test4.txt rename to ClientAdvisor/test2.txt From bd0299d58b10bd3e98ad1205a87bb8fe97d28628 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 27 Sep 2024 13:43:32 +0530 Subject: [PATCH 084/163] testing automation flow --- .github/workflows/CAdeploy.yml | 6 +++--- ClientAdvisor/{test2.txt => test1.txt} | 0 2 files changed, 3 insertions(+), 3 deletions(-) rename ClientAdvisor/{test2.txt => test1.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index f0b66700..5d5ac982 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -35,7 +35,7 @@ jobs: rg_exists=$(az group exists --name pslautomationca) if [ "$rg_exists" = "false" ]; then echo "Resource group does not exist. Creating..." - az group create --name pslautomationbyoa5 --location uksouth || { echo "Error creating resource group"; exit 1; } + az group create --name pslautomationbyoa6 --location uksouth || { echo "Error creating resource group"; exit 1; } else echo "Resource group already exists." fi @@ -45,9 +45,9 @@ jobs: run: | set -e az deployment group create \ - --resource-group pslautomationbyoa5 \ + --resource-group pslautomationbyoa6 \ --template-file ClientAdvisor/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=pslc3 cosmosLocation=eastus2 + --parameters solutionPrefix=pslc4 cosmosLocation=eastus2 VITE_POWERBI_EMBED_URL=test.com - name: Send Notification on Failure if: failure() diff --git a/ClientAdvisor/test2.txt b/ClientAdvisor/test1.txt similarity index 100% rename from ClientAdvisor/test2.txt rename to ClientAdvisor/test1.txt From 93f67e11a4aea52b1352adbf58e010312b85e28f Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 27 Sep 2024 14:09:59 +0530 Subject: [PATCH 085/163] testing automation flow --- .github/workflows/CAdeploy.yml | 6 +++--- ClientAdvisor/Deployment/bicep/main.bicep | 2 ++ ClientAdvisor/{test1.txt => test2.txt} | 0 3 files changed, 5 insertions(+), 3 deletions(-) rename ClientAdvisor/{test1.txt => test2.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 5d5ac982..6a2e2753 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -35,7 +35,7 @@ jobs: rg_exists=$(az group exists --name pslautomationca) if [ "$rg_exists" = "false" ]; then echo "Resource group does not exist. Creating..." - az group create --name pslautomationbyoa6 --location uksouth || { echo "Error creating resource group"; exit 1; } + az group create --name pslautomationbyoa7 --location uksouth || { echo "Error creating resource group"; exit 1; } else echo "Resource group already exists." fi @@ -45,9 +45,9 @@ jobs: run: | set -e az deployment group create \ - --resource-group pslautomationbyoa6 \ + --resource-group pslautomationbyoa7 \ --template-file ClientAdvisor/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=pslc4 cosmosLocation=eastus2 VITE_POWERBI_EMBED_URL=test.com + --parameters solutionPrefix=pslc5 cosmosLocation=eastus2 VITE_POWERBI_EMBED_URL=test.com - name: Send Notification on Failure if: failure() diff --git a/ClientAdvisor/Deployment/bicep/main.bicep b/ClientAdvisor/Deployment/bicep/main.bicep index cb99dc11..10758a61 100644 --- a/ClientAdvisor/Deployment/bicep/main.bicep +++ b/ClientAdvisor/Deployment/bicep/main.bicep @@ -6,6 +6,8 @@ targetScope = 'resourceGroup' @description('Prefix Name') param solutionPrefix string +param vitePowerBIEmbed_URL string + @description('CosmosDB Location') param cosmosLocation string diff --git a/ClientAdvisor/test1.txt b/ClientAdvisor/test2.txt similarity index 100% rename from ClientAdvisor/test1.txt rename to ClientAdvisor/test2.txt From 0e96c3b54b0cc036e40ebac378cbc360d9b9e938 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 27 Sep 2024 14:11:51 +0530 Subject: [PATCH 086/163] testing automation flow --- .github/workflows/CAdeploy.yml | 2 +- ClientAdvisor/{test2.txt => test3.txt} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename ClientAdvisor/{test2.txt => test3.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 6a2e2753..f2602401 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -47,7 +47,7 @@ jobs: az deployment group create \ --resource-group pslautomationbyoa7 \ --template-file ClientAdvisor/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=pslc5 cosmosLocation=eastus2 VITE_POWERBI_EMBED_URL=test.com + --parameters solutionPrefix=pslc5 cosmosLocation=eastus2 vitePowerBIEmbed_URL=test.com - name: Send Notification on Failure if: failure() diff --git a/ClientAdvisor/test2.txt b/ClientAdvisor/test3.txt similarity index 100% rename from ClientAdvisor/test2.txt rename to ClientAdvisor/test3.txt From 8248139488358cedb169e24d6a5040a8c2e3fa68 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 27 Sep 2024 15:20:09 +0530 Subject: [PATCH 087/163] testing automation flow --- .github/workflows/CAdeploy.yml | 6 +++--- ClientAdvisor/Deployment/bicep/main.bicep | 2 +- ClientAdvisor/{test3.txt => test4.txt} | 0 3 files changed, 4 insertions(+), 4 deletions(-) rename ClientAdvisor/{test3.txt => test4.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index f2602401..822d122c 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -35,7 +35,7 @@ jobs: rg_exists=$(az group exists --name pslautomationca) if [ "$rg_exists" = "false" ]; then echo "Resource group does not exist. Creating..." - az group create --name pslautomationbyoa7 --location uksouth || { echo "Error creating resource group"; exit 1; } + az group create --name pslautomationbyoa8 --location uksouth || { echo "Error creating resource group"; exit 1; } else echo "Resource group already exists." fi @@ -45,9 +45,9 @@ jobs: run: | set -e az deployment group create \ - --resource-group pslautomationbyoa7 \ + --resource-group pslautomationbyoa8 \ --template-file ClientAdvisor/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=pslc5 cosmosLocation=eastus2 vitePowerBIEmbed_URL=test.com + --parameters solutionPrefix=pslc6 cosmosLocation=eastus2 vitePowerBIEmbed_URL=test.com - name: Send Notification on Failure if: failure() diff --git a/ClientAdvisor/Deployment/bicep/main.bicep b/ClientAdvisor/Deployment/bicep/main.bicep index 10758a61..c88d9ec5 100644 --- a/ClientAdvisor/Deployment/bicep/main.bicep +++ b/ClientAdvisor/Deployment/bicep/main.bicep @@ -241,7 +241,7 @@ module appserviceModule 'deploy_app_service.bicep' = { AZURE_COSMOSDB_CONVERSATIONS_CONTAINER: cosmosDBModule.outputs.cosmosOutput.cosmosContainerName AZURE_COSMOSDB_DATABASE: cosmosDBModule.outputs.cosmosOutput.cosmosDatabaseName AZURE_COSMOSDB_ENABLE_FEEDBACK: 'True' - VITE_POWERBI_EMBED_URL: 'TBD' + VITE_POWERBI_EMBED_URL: vitePowerBIEmbed_URL } scope: resourceGroup(resourceGroup().name) dependsOn:[azOpenAI,azAIMultiServiceAccount,azSearchService,sqlDBModule,azureFunctionURL,cosmosDBModule] diff --git a/ClientAdvisor/test3.txt b/ClientAdvisor/test4.txt similarity index 100% rename from ClientAdvisor/test3.txt rename to ClientAdvisor/test4.txt From b11f6b585b7339f4c2acaa2430e898f6d6621a2e Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 27 Sep 2024 15:38:48 +0530 Subject: [PATCH 088/163] testing automation flow --- .github/workflows/CAdeploy.yml | 6 +++--- ClientAdvisor/{test4.txt => test5.txt} | 0 2 files changed, 3 insertions(+), 3 deletions(-) rename ClientAdvisor/{test4.txt => test5.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 822d122c..ba92e0c5 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -35,7 +35,7 @@ jobs: rg_exists=$(az group exists --name pslautomationca) if [ "$rg_exists" = "false" ]; then echo "Resource group does not exist. Creating..." - az group create --name pslautomationbyoa8 --location uksouth || { echo "Error creating resource group"; exit 1; } + az group create --name pslautomationbyoa9 --location uksouth || { echo "Error creating resource group"; exit 1; } else echo "Resource group already exists." fi @@ -45,9 +45,9 @@ jobs: run: | set -e az deployment group create \ - --resource-group pslautomationbyoa8 \ + --resource-group pslautomationbyoa9 \ --template-file ClientAdvisor/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=pslc6 cosmosLocation=eastus2 vitePowerBIEmbed_URL=test.com + --parameters solutionPrefix=pslc7 cosmosLocation=eastus2 vitePowerBIEmbed_URL=test.com - name: Send Notification on Failure if: failure() diff --git a/ClientAdvisor/test4.txt b/ClientAdvisor/test5.txt similarity index 100% rename from ClientAdvisor/test4.txt rename to ClientAdvisor/test5.txt From ff60a7c4de5cff3250bd39ab1a6efc995fd586c3 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 27 Sep 2024 17:35:06 +0530 Subject: [PATCH 089/163] testing automation flow --- .github/workflows/CAdeploy.yml | 62 ++++++++++++++++++++-- .github/workflows/RAdeploy.yml | 5 +- ResearchAssistant/{test3.txt => test4.txt} | 0 3 files changed, 61 insertions(+), 6 deletions(-) rename ResearchAssistant/{test3.txt => test4.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index ba92e0c5..f8e71445 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -26,28 +26,82 @@ jobs: - name: Install Bicep CLI run: az bicep install + + - name: Generate Resource Group Name + id: generate_rg_name + run: | + echo "Generating a unique resource group name..." + TIMESTAMP=$(date +%Y%m%d%H%M%S) + COMMON_PART="pslautomationCli" + UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" + echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV + echo "Generated RESOURCE_GROUP_PREFIX: ${UNIQUE_RG_NAME}" - name: Check and Create Resource Group id: check_create_rg run: | set -e echo "Checking if resource group exists..." - rg_exists=$(az group exists --name pslautomationca) + rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) if [ "$rg_exists" = "false" ]; then echo "Resource group does not exist. Creating..." - az group create --name pslautomationbyoa9 --location uksouth || { echo "Error creating resource group"; exit 1; } + az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location uksouth || { echo "Error creating resource group"; exit 1; } else echo "Resource group already exists." fi + + - name: Generate Unique Solution Prefix + id: generate_solution_prefix + run: | + set -e + COMMON_PART="pslc" + TIMESTAMP=$(date +%s) + UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3) + UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" + echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV + echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" - name: Deploy Bicep Template id: deploy run: | set -e az deployment group create \ - --resource-group pslautomationbyoa9 \ + --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ --template-file ClientAdvisor/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=pslc7 cosmosLocation=eastus2 vitePowerBIEmbed_URL=test.com + --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} cosmosLocation=eastus2 vitePowerBIEmbed_URL=test.com + + - name: Delete Bicep Deployment + if: success() + run: | + set -e + echo "Checking if resource group exists..." + rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) + if [ "$rg_exists" = "true" ]; then + echo "Resource group exist. Cleaning..." + az group delete \ + --name ${{ env.RESOURCE_GROUP_NAME }} \ + --yes \ + --no-wait + echo "Resource group deleted... ${{ env.RESOURCE_GROUP_NAME }}" + else + echo "Resource group does not exists." + fi + + - name: Delete Bicep Deployment + if: success() + run: | + set -e + echo "Checking if resource group exists..." + rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) + if [ "$rg_exists" = "true" ]; then + echo "Resource group exist. Cleaning..." + az group delete \ + --name ${{ env.RESOURCE_GROUP_NAME }} \ + --yes \ + --no-wait + else + echo "Resource group does not exists." + fi - name: Send Notification on Failure if: failure() diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 92b7de17..3f4fea59 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -35,7 +35,7 @@ jobs: COMMON_PART="pslautomationRes" UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV - echo "Generated SOLUTION_PREFIX: ${UNIQUE_RG_NAME}" + echo "Generated Resource_GROUP_PREFIX: ${UNIQUE_RG_NAME}" - name: Check and Create Resource Group id: check_create_rg @@ -54,7 +54,7 @@ jobs: id: generate_solution_prefix run: | set -e - COMMON_PART="psl" + COMMON_PART="pslr" TIMESTAMP=$(date +%s) UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3) UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" @@ -82,6 +82,7 @@ jobs: --name ${{ env.RESOURCE_GROUP_NAME }} \ --yes \ --no-wait + echo "Resource group deleted... ${{ env.RESOURCE_GROUP_NAME }}" else echo "Resource group does not exists." fi diff --git a/ResearchAssistant/test3.txt b/ResearchAssistant/test4.txt similarity index 100% rename from ResearchAssistant/test3.txt rename to ResearchAssistant/test4.txt From c2ee03494395864ebbed949b0c3aecb48cb415e7 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 27 Sep 2024 17:37:30 +0530 Subject: [PATCH 090/163] testing client advisor automation --- ClientAdvisor/{test5.txt => test3.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ClientAdvisor/{test5.txt => test3.txt} (100%) diff --git a/ClientAdvisor/test5.txt b/ClientAdvisor/test3.txt similarity index 100% rename from ClientAdvisor/test5.txt rename to ClientAdvisor/test3.txt From e9bbcb857a6bdc2d3cce6a183c5f359200a2437f Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 27 Sep 2024 19:40:35 +0530 Subject: [PATCH 091/163] testing automation flow --- .github/workflows/CAdeploy.yml | 90 +++++++++++++------------- ClientAdvisor/{test3.txt => test4.txt} | 0 2 files changed, 45 insertions(+), 45 deletions(-) rename ClientAdvisor/{test3.txt => test4.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index f8e71445..2ed18317 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -37,38 +37,38 @@ jobs: echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV echo "Generated RESOURCE_GROUP_PREFIX: ${UNIQUE_RG_NAME}" - - name: Check and Create Resource Group - id: check_create_rg - run: | - set -e - echo "Checking if resource group exists..." - rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) - if [ "$rg_exists" = "false" ]; then - echo "Resource group does not exist. Creating..." - az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location uksouth || { echo "Error creating resource group"; exit 1; } - else - echo "Resource group already exists." - fi + # - name: Check and Create Resource Group + # id: check_create_rg + # run: | + # set -e + # echo "Checking if resource group exists..." + # rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) + # if [ "$rg_exists" = "false" ]; then + # echo "Resource group does not exist. Creating..." + # az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location uksouth || { echo "Error creating resource group"; exit 1; } + # else + # echo "Resource group already exists." + # fi - - name: Generate Unique Solution Prefix - id: generate_solution_prefix - run: | - set -e - COMMON_PART="pslc" - TIMESTAMP=$(date +%s) - UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3) - UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" - echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV - echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" + # - name: Generate Unique Solution Prefix + # id: generate_solution_prefix + # run: | + # set -e + # COMMON_PART="pslc" + # TIMESTAMP=$(date +%s) + # UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3) + # UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" + # echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV + # echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" - - name: Deploy Bicep Template - id: deploy - run: | - set -e - az deployment group create \ - --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ - --template-file ClientAdvisor/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} cosmosLocation=eastus2 vitePowerBIEmbed_URL=test.com + # - name: Deploy Bicep Template + # id: deploy + # run: | + # set -e + # az deployment group create \ + # --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ + # --template-file ClientAdvisor/Deployment/bicep/main.bicep \ + # --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} cosmosLocation=eastus2 vitePowerBIEmbed_URL=test.com - name: Delete Bicep Deployment if: success() @@ -103,20 +103,20 @@ jobs: echo "Resource group does not exists." fi - - name: Send Notification on Failure - if: failure() - run: | - RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + # - name: Send Notification on Failure + # if: failure() + # run: | + # RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" - # Construct the email body - EMAIL_BODY=$(cat <Dear Team,

We would like to inform you that the Client Advisor Automation process has encountered an issue and has failed to complete successfully.

Build URL: ${RUN_URL}
${OUTPUT}

Please investigate the matter at your earliest convenience.

Best regards,
Your Automation Team

" - } - EOF - ) + # # Construct the email body + # EMAIL_BODY=$(cat <Dear Team,

We would like to inform you that the Client Advisor Automation process has encountered an issue and has failed to complete successfully.

Build URL: ${RUN_URL}
${OUTPUT}

Please investigate the matter at your earliest convenience.

Best regards,
Your Automation Team

" + # } + # EOF + # ) - # Send the notification - curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ - -H "Content-Type: application/json" \ - -d "$EMAIL_BODY" || echo "Failed to send notification" \ No newline at end of file + # # Send the notification + # curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ + # -H "Content-Type: application/json" \ + # -d "$EMAIL_BODY" || echo "Failed to send notification" \ No newline at end of file diff --git a/ClientAdvisor/test3.txt b/ClientAdvisor/test4.txt similarity index 100% rename from ClientAdvisor/test3.txt rename to ClientAdvisor/test4.txt From 8df8a225952fdb9c13d15a6c32e2aea26940783d Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 27 Sep 2024 19:43:05 +0530 Subject: [PATCH 092/163] testing automation flow --- .github/workflows/CAdeploy.yml | 24 ++++++++++++------------ ClientAdvisor/{test4.txt => test5.txt} | 0 2 files changed, 12 insertions(+), 12 deletions(-) rename ClientAdvisor/{test4.txt => test5.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 2ed18317..d77ae589 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -37,18 +37,18 @@ jobs: echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV echo "Generated RESOURCE_GROUP_PREFIX: ${UNIQUE_RG_NAME}" - # - name: Check and Create Resource Group - # id: check_create_rg - # run: | - # set -e - # echo "Checking if resource group exists..." - # rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) - # if [ "$rg_exists" = "false" ]; then - # echo "Resource group does not exist. Creating..." - # az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location uksouth || { echo "Error creating resource group"; exit 1; } - # else - # echo "Resource group already exists." - # fi + - name: Check and Create Resource Group + id: check_create_rg + run: | + set -e + echo "Checking if resource group exists..." + rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) + if [ "$rg_exists" = "false" ]; then + echo "Resource group does not exist. Creating..." + az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location uksouth || { echo "Error creating resource group"; exit 1; } + else + echo "Resource group already exists." + fi # - name: Generate Unique Solution Prefix # id: generate_solution_prefix diff --git a/ClientAdvisor/test4.txt b/ClientAdvisor/test5.txt similarity index 100% rename from ClientAdvisor/test4.txt rename to ClientAdvisor/test5.txt From 03c7b8f40fde9ff6d712962392550d0322d85791 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 27 Sep 2024 19:45:37 +0530 Subject: [PATCH 093/163] testing automation flow --- .github/workflows/CAdeploy.yml | 82 ++++++++++++++-------------------- 1 file changed, 33 insertions(+), 49 deletions(-) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index d77ae589..9bd68d2d 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -50,25 +50,25 @@ jobs: echo "Resource group already exists." fi - # - name: Generate Unique Solution Prefix - # id: generate_solution_prefix - # run: | - # set -e - # COMMON_PART="pslc" - # TIMESTAMP=$(date +%s) - # UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3) - # UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" - # echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV - # echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" + - name: Generate Unique Solution Prefix + id: generate_solution_prefix + run: | + set -e + COMMON_PART="pslc" + TIMESTAMP=$(date +%s) + UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3) + UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" + echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV + echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" - # - name: Deploy Bicep Template - # id: deploy - # run: | - # set -e - # az deployment group create \ - # --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ - # --template-file ClientAdvisor/Deployment/bicep/main.bicep \ - # --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} cosmosLocation=eastus2 vitePowerBIEmbed_URL=test.com + - name: Deploy Bicep Template + id: deploy + run: | + set -e + az deployment group create \ + --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ + --template-file ClientAdvisor/Deployment/bicep/main.bicep \ + --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} cosmosLocation=eastus2 vitePowerBIEmbed_URL=test.com - name: Delete Bicep Deployment if: success() @@ -86,37 +86,21 @@ jobs: else echo "Resource group does not exists." fi - - - name: Delete Bicep Deployment - if: success() - run: | - set -e - echo "Checking if resource group exists..." - rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) - if [ "$rg_exists" = "true" ]; then - echo "Resource group exist. Cleaning..." - az group delete \ - --name ${{ env.RESOURCE_GROUP_NAME }} \ - --yes \ - --no-wait - else - echo "Resource group does not exists." - fi - # - name: Send Notification on Failure - # if: failure() - # run: | - # RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + - name: Send Notification on Failure + if: failure() + run: | + RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" - # # Construct the email body - # EMAIL_BODY=$(cat <Dear Team,

We would like to inform you that the Client Advisor Automation process has encountered an issue and has failed to complete successfully.

Build URL: ${RUN_URL}
${OUTPUT}

Please investigate the matter at your earliest convenience.

Best regards,
Your Automation Team

" - # } - # EOF - # ) + # Construct the email body + EMAIL_BODY=$(cat <Dear Team,

We would like to inform you that the Client Advisor Automation process has encountered an issue and has failed to complete successfully.

Build URL: ${RUN_URL}
${OUTPUT}

Please investigate the matter at your earliest convenience.

Best regards,
Your Automation Team

" + } + EOF + ) - # # Send the notification - # curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ - # -H "Content-Type: application/json" \ - # -d "$EMAIL_BODY" || echo "Failed to send notification" \ No newline at end of file + # Send the notification + curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ + -H "Content-Type: application/json" \ + -d "$EMAIL_BODY" || echo "Failed to send notification" \ No newline at end of file From d442ae25173772ed3b2d921485f0b0008129e395 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 10:55:06 +0530 Subject: [PATCH 094/163] testing automation flow --- .github/workflows/RAdeploy.yml | 32 +++++++++++----------- ClientAdvisor/{test5.txt => test3.txt} | 0 ResearchAssistant/{test4.txt => test2.txt} | 0 3 files changed, 16 insertions(+), 16 deletions(-) rename ClientAdvisor/{test5.txt => test3.txt} (100%) rename ResearchAssistant/{test4.txt => test2.txt} (100%) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 3f4fea59..706c75c0 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -70,22 +70,22 @@ jobs: --template-file ResearchAssistant/Deployment/bicep/main.bicep \ --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} - - name: Delete Bicep Deployment - if: success() - run: | - set -e - echo "Checking if resource group exists..." - rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) - if [ "$rg_exists" = "true" ]; then - echo "Resource group exist. Cleaning..." - az group delete \ - --name ${{ env.RESOURCE_GROUP_NAME }} \ - --yes \ - --no-wait - echo "Resource group deleted... ${{ env.RESOURCE_GROUP_NAME }}" - else - echo "Resource group does not exists." - fi + # - name: Delete Bicep Deployment + # if: success() + # run: | + # set -e + # echo "Checking if resource group exists..." + # rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) + # if [ "$rg_exists" = "true" ]; then + # echo "Resource group exist. Cleaning..." + # az group delete \ + # --name ${{ env.RESOURCE_GROUP_NAME }} \ + # --yes \ + # --no-wait + # echo "Resource group deleted... ${{ env.RESOURCE_GROUP_NAME }}" + # else + # echo "Resource group does not exists." + # fi - name: Send Notification on Failure if: failure() diff --git a/ClientAdvisor/test5.txt b/ClientAdvisor/test3.txt similarity index 100% rename from ClientAdvisor/test5.txt rename to ClientAdvisor/test3.txt diff --git a/ResearchAssistant/test4.txt b/ResearchAssistant/test2.txt similarity index 100% rename from ResearchAssistant/test4.txt rename to ResearchAssistant/test2.txt From fa95596d16e61808f366a654b121e9d66215b546 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 11:12:57 +0530 Subject: [PATCH 095/163] testing automation flow --- .github/workflows/RAdeploy.yml | 32 +++++++++++----------- ResearchAssistant/{test2.txt => test3.txt} | 0 2 files changed, 16 insertions(+), 16 deletions(-) rename ResearchAssistant/{test2.txt => test3.txt} (100%) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 706c75c0..3f4fea59 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -70,22 +70,22 @@ jobs: --template-file ResearchAssistant/Deployment/bicep/main.bicep \ --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} - # - name: Delete Bicep Deployment - # if: success() - # run: | - # set -e - # echo "Checking if resource group exists..." - # rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) - # if [ "$rg_exists" = "true" ]; then - # echo "Resource group exist. Cleaning..." - # az group delete \ - # --name ${{ env.RESOURCE_GROUP_NAME }} \ - # --yes \ - # --no-wait - # echo "Resource group deleted... ${{ env.RESOURCE_GROUP_NAME }}" - # else - # echo "Resource group does not exists." - # fi + - name: Delete Bicep Deployment + if: success() + run: | + set -e + echo "Checking if resource group exists..." + rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) + if [ "$rg_exists" = "true" ]; then + echo "Resource group exist. Cleaning..." + az group delete \ + --name ${{ env.RESOURCE_GROUP_NAME }} \ + --yes \ + --no-wait + echo "Resource group deleted... ${{ env.RESOURCE_GROUP_NAME }}" + else + echo "Resource group does not exists." + fi - name: Send Notification on Failure if: failure() diff --git a/ResearchAssistant/test2.txt b/ResearchAssistant/test3.txt similarity index 100% rename from ResearchAssistant/test2.txt rename to ResearchAssistant/test3.txt From 6ce5a74874dd342bfd704df8d185d0475591462d Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 11:42:59 +0530 Subject: [PATCH 096/163] testing automation flow --- .github/workflows/RAdeploy.yml | 82 +++++++++++----------- ResearchAssistant/{test3.txt => test2.txt} | 0 2 files changed, 41 insertions(+), 41 deletions(-) rename ResearchAssistant/{test3.txt => test2.txt} (100%) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 3f4fea59..fed42147 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -27,59 +27,59 @@ jobs: - name: Install Bicep CLI run: az bicep install - - name: Generate Resource Group Name - id: generate_rg_name - run: | - echo "Generating a unique resource group name..." - TIMESTAMP=$(date +%Y%m%d%H%M%S) - COMMON_PART="pslautomationRes" - UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" - echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV - echo "Generated Resource_GROUP_PREFIX: ${UNIQUE_RG_NAME}" + # - name: Generate Resource Group Name + # id: generate_rg_name + # run: | + # echo "Generating a unique resource group name..." + # TIMESTAMP=$(date +%Y%m%d%H%M%S) + # COMMON_PART="pslautomationRes" + # UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" + # echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV + # echo "Generated Resource_GROUP_PREFIX: ${UNIQUE_RG_NAME}" - - name: Check and Create Resource Group - id: check_create_rg - run: | - set -e - echo "Checking if resource group exists..." - rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) - if [ "$rg_exists" = "false" ]; then - echo "Resource group does not exist. Creating..." - az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location eastus || { echo "Error creating resource group"; exit 1; } - else - echo "Resource group already exists." - fi + # - name: Check and Create Resource Group + # id: check_create_rg + # run: | + # set -e + # echo "Checking if resource group exists..." + # rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) + # if [ "$rg_exists" = "false" ]; then + # echo "Resource group does not exist. Creating..." + # az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location eastus || { echo "Error creating resource group"; exit 1; } + # else + # echo "Resource group already exists." + # fi - - name: Generate Unique Solution Prefix - id: generate_solution_prefix - run: | - set -e - COMMON_PART="pslr" - TIMESTAMP=$(date +%s) - UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3) - UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" - echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV - echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" + # - name: Generate Unique Solution Prefix + # id: generate_solution_prefix + # run: | + # set -e + # COMMON_PART="pslr" + # TIMESTAMP=$(date +%s) + # UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3) + # UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" + # echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV + # echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" - - name: Deploy Bicep Template - id: deploy - run: | - set -e - az deployment group create \ - --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ - --template-file ResearchAssistant/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} + # - name: Deploy Bicep Template + # id: deploy + # run: | + # set -e + # az deployment group create \ + # --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ + # --template-file ResearchAssistant/Deployment/bicep/main.bicep \ + # --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} - name: Delete Bicep Deployment if: success() run: | set -e echo "Checking if resource group exists..." - rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) + rg_exists=$(az group exists --name pslautomationRes20240930054347 if [ "$rg_exists" = "true" ]; then echo "Resource group exist. Cleaning..." az group delete \ - --name ${{ env.RESOURCE_GROUP_NAME }} \ + # --name pslautomationRes20240930054347 \ --yes \ --no-wait echo "Resource group deleted... ${{ env.RESOURCE_GROUP_NAME }}" diff --git a/ResearchAssistant/test3.txt b/ResearchAssistant/test2.txt similarity index 100% rename from ResearchAssistant/test3.txt rename to ResearchAssistant/test2.txt From bee780efc5b7d3fba15fd20eb4663a1b6f084d15 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 11:45:26 +0530 Subject: [PATCH 097/163] testing automation flow --- .github/workflows/RAdeploy.yml | 2 +- ResearchAssistant/{test2.txt => test3.txt} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename ResearchAssistant/{test2.txt => test3.txt} (100%) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index fed42147..b371f9cf 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -79,7 +79,7 @@ jobs: if [ "$rg_exists" = "true" ]; then echo "Resource group exist. Cleaning..." az group delete \ - # --name pslautomationRes20240930054347 \ + --name pslautomationRes20240930054347 \ --yes \ --no-wait echo "Resource group deleted... ${{ env.RESOURCE_GROUP_NAME }}" diff --git a/ResearchAssistant/test2.txt b/ResearchAssistant/test3.txt similarity index 100% rename from ResearchAssistant/test2.txt rename to ResearchAssistant/test3.txt From 27d3011db1e2d32e7e8b44e84cfeab61190bd38d Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 11:48:13 +0530 Subject: [PATCH 098/163] testing automation flow --- .github/workflows/RAdeploy.yml | 2 +- ResearchAssistant/{test3.txt => test2.txt} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename ResearchAssistant/{test3.txt => test2.txt} (100%) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index b371f9cf..dbe2cdcb 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -75,7 +75,7 @@ jobs: run: | set -e echo "Checking if resource group exists..." - rg_exists=$(az group exists --name pslautomationRes20240930054347 + rg_exists=$(az group exists --name pslautomationRes20240930054347) if [ "$rg_exists" = "true" ]; then echo "Resource group exist. Cleaning..." az group delete \ diff --git a/ResearchAssistant/test3.txt b/ResearchAssistant/test2.txt similarity index 100% rename from ResearchAssistant/test3.txt rename to ResearchAssistant/test2.txt From e619de942febee57668103b9f358f197d02a9a5f Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 12:04:09 +0530 Subject: [PATCH 099/163] testing automation flow --- .github/workflows/RAdeploy.yml | 118 ++++++++++++--------- ResearchAssistant/{test2.txt => test3.txt} | 0 2 files changed, 65 insertions(+), 53 deletions(-) rename ResearchAssistant/{test2.txt => test3.txt} (100%) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index dbe2cdcb..59f82087 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -27,66 +27,78 @@ jobs: - name: Install Bicep CLI run: az bicep install - # - name: Generate Resource Group Name - # id: generate_rg_name - # run: | - # echo "Generating a unique resource group name..." - # TIMESTAMP=$(date +%Y%m%d%H%M%S) - # COMMON_PART="pslautomationRes" - # UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" - # echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV - # echo "Generated Resource_GROUP_PREFIX: ${UNIQUE_RG_NAME}" + - name: Generate Resource Group Name + id: generate_rg_name + run: | + echo "Generating a unique resource group name..." + TIMESTAMP=$(date +%Y%m%d%H%M%S) + COMMON_PART="pslautomationRes" + UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" + echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV + echo "Generated Resource_GROUP_PREFIX: ${UNIQUE_RG_NAME}" - # - name: Check and Create Resource Group - # id: check_create_rg - # run: | - # set -e - # echo "Checking if resource group exists..." - # rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) - # if [ "$rg_exists" = "false" ]; then - # echo "Resource group does not exist. Creating..." - # az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location eastus || { echo "Error creating resource group"; exit 1; } - # else - # echo "Resource group already exists." - # fi - - # - name: Generate Unique Solution Prefix - # id: generate_solution_prefix - # run: | - # set -e - # COMMON_PART="pslr" - # TIMESTAMP=$(date +%s) - # UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3) - # UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" - # echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV - # echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" - - # - name: Deploy Bicep Template - # id: deploy - # run: | - # set -e - # az deployment group create \ - # --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ - # --template-file ResearchAssistant/Deployment/bicep/main.bicep \ - # --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} - - - name: Delete Bicep Deployment - if: success() + - name: Check and Create Resource Group + id: check_create_rg run: | set -e echo "Checking if resource group exists..." - rg_exists=$(az group exists --name pslautomationRes20240930054347) - if [ "$rg_exists" = "true" ]; then - echo "Resource group exist. Cleaning..." - az group delete \ - --name pslautomationRes20240930054347 \ - --yes \ - --no-wait - echo "Resource group deleted... ${{ env.RESOURCE_GROUP_NAME }}" + rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) + if [ "$rg_exists" = "false" ]; then + echo "Resource group does not exist. Creating..." + az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location eastus || { echo "Error creating resource group"; exit 1; } else - echo "Resource group does not exists." + echo "Resource group already exists." fi + - name: Generate Unique Solution Prefix + id: generate_solution_prefix + run: | + set -e + COMMON_PART="pslr" + TIMESTAMP=$(date +%s) + UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3) + UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" + echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV + echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" + + - name: Deploy Bicep Template + id: deploy + run: | + set -e + az deployment group create \ + --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ + --template-file ResearchAssistant/Deployment/bicep/main.bicep \ + --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} + + - name: Delete Bicep Deployment + if: success() + run: | + set -e + echo "Checking if resource group exists..." + rg_exists=$(az group exists --name pslautomationRes20240930052609) + if [ "$rg_exists" = "true" ]; then + echo "Resource group exists. Cleaning resources..." + # List all resources in the resource group and delete them + resources=$(az resource list --resource-group pslautomationRes20240930052609 --query "[].id" -o tsv) + echo "Resource lists... resources" + echo "Resource lists:: $resources" + if [ -n "$resources" ]; then + for resource in $resources; do + echo "Deleting resource: $resource" + az resource delete --ids "$resource" + done + echo "All resources deleted from the resource group: pslautomationRes20240930052609" + else + echo "No resources found in the resource group." + fi + # Optionally, you can delete the resource group itself afterward + # echo "Deleting resource group: pslautomationRes20240930052609" + # az group delete --name pslautomationRes20240930052609 --yes --no-wait + else + echo "Resource group does not exist." + fi + + - name: Send Notification on Failure if: failure() run: | diff --git a/ResearchAssistant/test2.txt b/ResearchAssistant/test3.txt similarity index 100% rename from ResearchAssistant/test2.txt rename to ResearchAssistant/test3.txt From f659bdc65b9b296aed760104b76a6cc08d88066f Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 12:06:34 +0530 Subject: [PATCH 100/163] testing automation flow --- .github/workflows/RAdeploy.yml | 130 ++++++++++----------- ResearchAssistant/{test3.txt => test4.txt} | 0 2 files changed, 65 insertions(+), 65 deletions(-) rename ResearchAssistant/{test3.txt => test4.txt} (100%) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 59f82087..337778bb 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -27,76 +27,76 @@ jobs: - name: Install Bicep CLI run: az bicep install - - name: Generate Resource Group Name - id: generate_rg_name - run: | - echo "Generating a unique resource group name..." - TIMESTAMP=$(date +%Y%m%d%H%M%S) - COMMON_PART="pslautomationRes" - UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" - echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV - echo "Generated Resource_GROUP_PREFIX: ${UNIQUE_RG_NAME}" + # - name: Generate Resource Group Name + # id: generate_rg_name + # run: | + # echo "Generating a unique resource group name..." + # TIMESTAMP=$(date +%Y%m%d%H%M%S) + # COMMON_PART="pslautomationRes" + # UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" + # echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV + # echo "Generated Resource_GROUP_PREFIX: ${UNIQUE_RG_NAME}" - - name: Check and Create Resource Group - id: check_create_rg - run: | - set -e - echo "Checking if resource group exists..." - rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) - if [ "$rg_exists" = "false" ]; then - echo "Resource group does not exist. Creating..." - az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location eastus || { echo "Error creating resource group"; exit 1; } - else - echo "Resource group already exists." - fi + # - name: Check and Create Resource Group + # id: check_create_rg + # run: | + # set -e + # echo "Checking if resource group exists..." + # rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) + # if [ "$rg_exists" = "false" ]; then + # echo "Resource group does not exist. Creating..." + # az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location eastus || { echo "Error creating resource group"; exit 1; } + # else + # echo "Resource group already exists." + # fi - - name: Generate Unique Solution Prefix - id: generate_solution_prefix - run: | - set -e - COMMON_PART="pslr" - TIMESTAMP=$(date +%s) - UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3) - UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" - echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV - echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" + # - name: Generate Unique Solution Prefix + # id: generate_solution_prefix + # run: | + # set -e + # COMMON_PART="pslr" + # TIMESTAMP=$(date +%s) + # UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3) + # UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" + # echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV + # echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" - - name: Deploy Bicep Template - id: deploy + # - name: Deploy Bicep Template + # id: deploy + # run: | + # set -e + # az deployment group create \ + # --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ + # --template-file ResearchAssistant/Deployment/bicep/main.bicep \ + # --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} + + - name: Delete Bicep Deployment + if: success() run: | set -e - az deployment group create \ - --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ - --template-file ResearchAssistant/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} - - - name: Delete Bicep Deployment - if: success() - run: | - set -e - echo "Checking if resource group exists..." - rg_exists=$(az group exists --name pslautomationRes20240930052609) - if [ "$rg_exists" = "true" ]; then - echo "Resource group exists. Cleaning resources..." - # List all resources in the resource group and delete them - resources=$(az resource list --resource-group pslautomationRes20240930052609 --query "[].id" -o tsv) - echo "Resource lists... resources" - echo "Resource lists:: $resources" - if [ -n "$resources" ]; then - for resource in $resources; do - echo "Deleting resource: $resource" - az resource delete --ids "$resource" - done - echo "All resources deleted from the resource group: pslautomationRes20240930052609" - else - echo "No resources found in the resource group." - fi - # Optionally, you can delete the resource group itself afterward - # echo "Deleting resource group: pslautomationRes20240930052609" - # az group delete --name pslautomationRes20240930052609 --yes --no-wait - else - echo "Resource group does not exist." - fi + echo "Checking if resource group exists..." + rg_exists=$(az group exists --name pslautomationRes20240930052609) + if [ "$rg_exists" = "true" ]; then + echo "Resource group exists. Cleaning resources..." + # List all resources in the resource group and delete them + resources=$(az resource list --resource-group pslautomationRes20240930052609 --query "[].id" -o tsv) + echo "Resource lists... resources" + echo "Resource lists:: $resources" + if [ -n "$resources" ]; then + for resource in $resources; do + echo "Deleting resource: $resource" + az resource delete --ids "$resource" + done + echo "All resources deleted from the resource group: pslautomationRes20240930052609" + else + echo "No resources found in the resource group." + fi + # Optionally, you can delete the resource group itself afterward + # echo "Deleting resource group: pslautomationRes20240930052609" + # az group delete --name pslautomationRes20240930052609 --yes --no-wait + else + echo "Resource group does not exist." + fi - name: Send Notification on Failure diff --git a/ResearchAssistant/test3.txt b/ResearchAssistant/test4.txt similarity index 100% rename from ResearchAssistant/test3.txt rename to ResearchAssistant/test4.txt From a78ea5f112541cbe7afb8feda5ae3c2fab3f73bb Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 12:42:23 +0530 Subject: [PATCH 101/163] testing automation flow --- .github/workflows/RAdeploy.yml | 3 ++- ResearchAssistant/{test4.txt => test2.txt} | 0 2 files changed, 2 insertions(+), 1 deletion(-) rename ResearchAssistant/{test4.txt => test2.txt} (100%) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 337778bb..4ff94227 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -85,7 +85,8 @@ jobs: if [ -n "$resources" ]; then for resource in $resources; do echo "Deleting resource: $resource" - az resource delete --ids "$resource" + echo "Deleting resource: "$resource"" + az resource delete --ids "$resource" --verbose done echo "All resources deleted from the resource group: pslautomationRes20240930052609" else diff --git a/ResearchAssistant/test4.txt b/ResearchAssistant/test2.txt similarity index 100% rename from ResearchAssistant/test4.txt rename to ResearchAssistant/test2.txt From 358fb992dfa3ec6f34e8afabc8c13a52af1ecc35 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 12:52:26 +0530 Subject: [PATCH 102/163] testing automation flow --- .github/workflows/RAdeploy.yml | 2 +- ResearchAssistant/{test2.txt => test3.txt} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename ResearchAssistant/{test2.txt => test3.txt} (100%) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 4ff94227..8ea0de16 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -85,7 +85,7 @@ jobs: if [ -n "$resources" ]; then for resource in $resources; do echo "Deleting resource: $resource" - echo "Deleting resource: "$resource"" + echo "Deleting resource:: "$resource"" az resource delete --ids "$resource" --verbose done echo "All resources deleted from the resource group: pslautomationRes20240930052609" diff --git a/ResearchAssistant/test2.txt b/ResearchAssistant/test3.txt similarity index 100% rename from ResearchAssistant/test2.txt rename to ResearchAssistant/test3.txt From e4142c7ef3694831377e3b55625f8ff4bdc74f73 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 12:55:54 +0530 Subject: [PATCH 103/163] testing automation flow --- .github/workflows/RAdeploy.yml | 2 +- ResearchAssistant/{test3.txt => test1.txt} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename ResearchAssistant/{test3.txt => test1.txt} (100%) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 8ea0de16..66132f28 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -81,7 +81,7 @@ jobs: # List all resources in the resource group and delete them resources=$(az resource list --resource-group pslautomationRes20240930052609 --query "[].id" -o tsv) echo "Resource lists... resources" - echo "Resource lists:: $resources" + echo "Resource lists::: "$resources"" if [ -n "$resources" ]; then for resource in $resources; do echo "Deleting resource: $resource" diff --git a/ResearchAssistant/test3.txt b/ResearchAssistant/test1.txt similarity index 100% rename from ResearchAssistant/test3.txt rename to ResearchAssistant/test1.txt From dfd7857085d54978e41a4769d6fc2035700a189f Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 13:14:07 +0530 Subject: [PATCH 104/163] testing automation flow --- .github/workflows/RAdeploy.yml | 26 +++++----------------- ResearchAssistant/{test1.txt => test2.txt} | 0 2 files changed, 6 insertions(+), 20 deletions(-) rename ResearchAssistant/{test1.txt => test2.txt} (100%) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 66132f28..ffeeac8c 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -73,32 +73,18 @@ jobs: - name: Delete Bicep Deployment if: success() run: | - set -e + set -e echo "Checking if resource group exists..." rg_exists=$(az group exists --name pslautomationRes20240930052609) if [ "$rg_exists" = "true" ]; then - echo "Resource group exists. Cleaning resources..." - # List all resources in the resource group and delete them - resources=$(az resource list --resource-group pslautomationRes20240930052609 --query "[].id" -o tsv) - echo "Resource lists... resources" - echo "Resource lists::: "$resources"" - if [ -n "$resources" ]; then - for resource in $resources; do - echo "Deleting resource: $resource" - echo "Deleting resource:: "$resource"" - az resource delete --ids "$resource" --verbose - done - echo "All resources deleted from the resource group: pslautomationRes20240930052609" - else - echo "No resources found in the resource group." - fi - # Optionally, you can delete the resource group itself afterward - # echo "Deleting resource group: pslautomationRes20240930052609" - # az group delete --name pslautomationRes20240930052609 --yes --no-wait + echo "Resource group exists. Cleaning..." + # Using azd down to remove all resources associated with the project + @azd down --force --purge --no-prompt + echo "All resources in the resource group deleted..." else echo "Resource group does not exist." fi - + - name: Send Notification on Failure if: failure() diff --git a/ResearchAssistant/test1.txt b/ResearchAssistant/test2.txt similarity index 100% rename from ResearchAssistant/test1.txt rename to ResearchAssistant/test2.txt From c7d9e8dff19252377e0f59750bb8eb9edb570f93 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 13:17:32 +0530 Subject: [PATCH 105/163] testing automation flow --- .github/workflows/RAdeploy.yml | 2 +- ResearchAssistant/{test2.txt => test3.txt} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename ResearchAssistant/{test2.txt => test3.txt} (100%) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index ffeeac8c..f10fba3e 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -79,7 +79,7 @@ jobs: if [ "$rg_exists" = "true" ]; then echo "Resource group exists. Cleaning..." # Using azd down to remove all resources associated with the project - @azd down --force --purge --no-prompt + azd down --force --purge --no-prompt echo "All resources in the resource group deleted..." else echo "Resource group does not exist." diff --git a/ResearchAssistant/test2.txt b/ResearchAssistant/test3.txt similarity index 100% rename from ResearchAssistant/test2.txt rename to ResearchAssistant/test3.txt From 001374a1fe526e860d6f25cbbc9f4696045e76cc Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 13:21:06 +0530 Subject: [PATCH 106/163] testing automation flow --- .github/workflows/RAdeploy.yml | 5 +++++ ResearchAssistant/{test3.txt => test4.txt} | 0 2 files changed, 5 insertions(+) rename ResearchAssistant/{test3.txt => test4.txt} (100%) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index f10fba3e..92a3312f 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -19,6 +19,11 @@ jobs: run: | curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash az --version # Verify installation + + - name: Install Azure Developer CLI + run: | + npm install -g @azure/azure-dev-cli + azd --version # Verify installation - name: Login to Azure run: | diff --git a/ResearchAssistant/test3.txt b/ResearchAssistant/test4.txt similarity index 100% rename from ResearchAssistant/test3.txt rename to ResearchAssistant/test4.txt From 8a3488c6a542d726126f490d18f6bd7bae55bae5 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 13:23:26 +0530 Subject: [PATCH 107/163] testing automation flow --- .github/workflows/RAdeploy.yml | 2 +- ResearchAssistant/{test4.txt => test5.txt} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename ResearchAssistant/{test4.txt => test5.txt} (100%) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 92a3312f..e99a8f9f 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -22,7 +22,7 @@ jobs: - name: Install Azure Developer CLI run: | - npm install -g @azure/azure-dev-cli + curl -sL https://aka.ms/InstallAzureDevCLI | sudo bash azd --version # Verify installation - name: Login to Azure diff --git a/ResearchAssistant/test4.txt b/ResearchAssistant/test5.txt similarity index 100% rename from ResearchAssistant/test4.txt rename to ResearchAssistant/test5.txt From 7c35bcb6cf886b9f7505f7fddc93bf47c1cfc3b8 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 13:26:46 +0530 Subject: [PATCH 108/163] testing automation flow --- .github/workflows/RAdeploy.yml | 37 ++++++++++++---------- ResearchAssistant/{test5.txt => test6.txt} | 0 2 files changed, 21 insertions(+), 16 deletions(-) rename ResearchAssistant/{test5.txt => test6.txt} (100%) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index e99a8f9f..8e442da4 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -20,9 +20,14 @@ jobs: curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash az --version # Verify installation + - name: Install Node.js + uses: actions/setup-node@v2 + with: + node-version: '16' # Specify the desired Node.js version + - name: Install Azure Developer CLI run: | - curl -sL https://aka.ms/InstallAzureDevCLI | sudo bash + npm install -g azure-dev-cli azd --version # Verify installation - name: Login to Azure @@ -91,20 +96,20 @@ jobs: fi - - name: Send Notification on Failure - if: failure() - run: | - RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + # - name: Send Notification on Failure + # if: failure() + # run: | + # RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" - # Construct the email body - EMAIL_BODY=$(cat <Dear Team,

We would like to inform you that the Research Assistant Automation process has encountered an issue and has failed to complete successfully.

Build URL: ${RUN_URL}
${OUTPUT}

Please investigate the matter at your earliest convenience.

Best regards,
Your Automation Team

" - } - EOF - ) + # # Construct the email body + # EMAIL_BODY=$(cat <Dear Team,

We would like to inform you that the Research Assistant Automation process has encountered an issue and has failed to complete successfully.

Build URL: ${RUN_URL}
${OUTPUT}

Please investigate the matter at your earliest convenience.

Best regards,
Your Automation Team

" + # } + # EOF + # ) - # Send the notification - curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ - -H "Content-Type: application/json" \ - -d "$EMAIL_BODY" || echo "Failed to send notification" \ No newline at end of file + # # Send the notification + # curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ + # -H "Content-Type: application/json" \ + # -d "$EMAIL_BODY" || echo "Failed to send notification" \ No newline at end of file diff --git a/ResearchAssistant/test5.txt b/ResearchAssistant/test6.txt similarity index 100% rename from ResearchAssistant/test5.txt rename to ResearchAssistant/test6.txt From 54227a9e6b9900c6ff71e21db027c24916dcb6b8 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 13:29:34 +0530 Subject: [PATCH 109/163] testing automation flow --- .github/workflows/RAdeploy.yml | 7 +------ ResearchAssistant/{test6.txt => test7.txt} | 0 2 files changed, 1 insertion(+), 6 deletions(-) rename ResearchAssistant/{test6.txt => test7.txt} (100%) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 8e442da4..a54389bd 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -20,14 +20,9 @@ jobs: curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash az --version # Verify installation - - name: Install Node.js - uses: actions/setup-node@v2 - with: - node-version: '16' # Specify the desired Node.js version - - name: Install Azure Developer CLI run: | - npm install -g azure-dev-cli + curl -sL https://aka.ms/InstallAzureDevCLI | sudo bash azd --version # Verify installation - name: Login to Azure diff --git a/ResearchAssistant/test6.txt b/ResearchAssistant/test7.txt similarity index 100% rename from ResearchAssistant/test6.txt rename to ResearchAssistant/test7.txt From b9f954f4748e0aa5a21fc231c70d55ae89269e7a Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 13:41:14 +0530 Subject: [PATCH 110/163] testing automation flow --- .github/workflows/RAdeploy.yml | 48 +++++++++++++++++----- ResearchAssistant/{test7.txt => test2.txt} | 0 2 files changed, 38 insertions(+), 10 deletions(-) rename ResearchAssistant/{test7.txt => test2.txt} (100%) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index a54389bd..d31a97e3 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -20,10 +20,10 @@ jobs: curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash az --version # Verify installation - - name: Install Azure Developer CLI - run: | - curl -sL https://aka.ms/InstallAzureDevCLI | sudo bash - azd --version # Verify installation + # - name: Install Azure Developer CLI + # run: | + # curl -sL https://aka.ms/InstallAzureDevCLI | sudo bash + # azd --version # Verify installation - name: Login to Azure run: | @@ -75,21 +75,49 @@ jobs: # --template-file ResearchAssistant/Deployment/bicep/main.bicep \ # --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} - - name: Delete Bicep Deployment + - name: Delete OpenAI Resources if: success() run: | set -e echo "Checking if resource group exists..." rg_exists=$(az group exists --name pslautomationRes20240930052609) if [ "$rg_exists" = "true" ]; then - echo "Resource group exists. Cleaning..." - # Using azd down to remove all resources associated with the project - azd down --force --purge --no-prompt - echo "All resources in the resource group deleted..." + echo "Resource group exists. Cleaning up OpenAI resources..." + + # List all OpenAI resources in the resource group + resources=$(az resource list --resource-group pslautomationRes20240930052609 --query "[?type=='Microsoft.CognitiveServices/accounts' || type=='Microsoft.CognitiveServices/openAIModels'].{id:id, type:type}" -o json) + + # Check if there are resources to delete + if [ "$(echo $resources | jq '. | length')" -gt 0 ]; then + for resource in $(echo $resources | jq -c '.[]'); do + resource_id=$(echo $resource | jq -r '.id') + resource_type=$(echo $resource | jq -r '.type') + + echo "Deleting resource: $resource_id" + + # Use specific commands for OpenAI resources + case $resource_type in + "Microsoft.CognitiveServices/accounts") + account_name=$(basename "$resource_id") + az cognitiveservices account delete --name "$account_name" --resource-group pslautomationRes20240930052609 --yes --no-wait + ;; + "Microsoft.CognitiveServices/openAIModels") + model_name=$(basename "$resource_id") + az cognitiveservices openai model delete --name "$model_name" --resource-group pslautomationRes20240930052609 --yes --no-wait + ;; + *) + echo "Unknown resource type: $resource_type. Skipping deletion." + ;; + esac + done + echo "All OpenAI resources processed in resource group pslautomationRes20240930052609" + else + echo "No OpenAI resources found in resource group." + fi else echo "Resource group does not exist." fi - + # - name: Send Notification on Failure # if: failure() diff --git a/ResearchAssistant/test7.txt b/ResearchAssistant/test2.txt similarity index 100% rename from ResearchAssistant/test7.txt rename to ResearchAssistant/test2.txt From 7d1aefd7fd1c950a1b32a73be1a742ae8173c3b8 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 13:47:15 +0530 Subject: [PATCH 111/163] testing automation flow --- .github/workflows/RAdeploy.yml | 158 +++++++++++++-------------------- 1 file changed, 63 insertions(+), 95 deletions(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index d31a97e3..3f4fea59 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -19,11 +19,6 @@ jobs: run: | curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash az --version # Verify installation - - # - name: Install Azure Developer CLI - # run: | - # curl -sL https://aka.ms/InstallAzureDevCLI | sudo bash - # azd --version # Verify installation - name: Login to Azure run: | @@ -32,107 +27,80 @@ jobs: - name: Install Bicep CLI run: az bicep install - # - name: Generate Resource Group Name - # id: generate_rg_name - # run: | - # echo "Generating a unique resource group name..." - # TIMESTAMP=$(date +%Y%m%d%H%M%S) - # COMMON_PART="pslautomationRes" - # UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" - # echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV - # echo "Generated Resource_GROUP_PREFIX: ${UNIQUE_RG_NAME}" + - name: Generate Resource Group Name + id: generate_rg_name + run: | + echo "Generating a unique resource group name..." + TIMESTAMP=$(date +%Y%m%d%H%M%S) + COMMON_PART="pslautomationRes" + UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" + echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV + echo "Generated Resource_GROUP_PREFIX: ${UNIQUE_RG_NAME}" - # - name: Check and Create Resource Group - # id: check_create_rg - # run: | - # set -e - # echo "Checking if resource group exists..." - # rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) - # if [ "$rg_exists" = "false" ]; then - # echo "Resource group does not exist. Creating..." - # az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location eastus || { echo "Error creating resource group"; exit 1; } - # else - # echo "Resource group already exists." - # fi + - name: Check and Create Resource Group + id: check_create_rg + run: | + set -e + echo "Checking if resource group exists..." + rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) + if [ "$rg_exists" = "false" ]; then + echo "Resource group does not exist. Creating..." + az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location eastus || { echo "Error creating resource group"; exit 1; } + else + echo "Resource group already exists." + fi - # - name: Generate Unique Solution Prefix - # id: generate_solution_prefix - # run: | - # set -e - # COMMON_PART="pslr" - # TIMESTAMP=$(date +%s) - # UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3) - # UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" - # echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV - # echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" + - name: Generate Unique Solution Prefix + id: generate_solution_prefix + run: | + set -e + COMMON_PART="pslr" + TIMESTAMP=$(date +%s) + UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3) + UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" + echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV + echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" - # - name: Deploy Bicep Template - # id: deploy - # run: | - # set -e - # az deployment group create \ - # --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ - # --template-file ResearchAssistant/Deployment/bicep/main.bicep \ - # --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} + - name: Deploy Bicep Template + id: deploy + run: | + set -e + az deployment group create \ + --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ + --template-file ResearchAssistant/Deployment/bicep/main.bicep \ + --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} - - name: Delete OpenAI Resources + - name: Delete Bicep Deployment if: success() run: | set -e echo "Checking if resource group exists..." - rg_exists=$(az group exists --name pslautomationRes20240930052609) + rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) if [ "$rg_exists" = "true" ]; then - echo "Resource group exists. Cleaning up OpenAI resources..." - - # List all OpenAI resources in the resource group - resources=$(az resource list --resource-group pslautomationRes20240930052609 --query "[?type=='Microsoft.CognitiveServices/accounts' || type=='Microsoft.CognitiveServices/openAIModels'].{id:id, type:type}" -o json) - - # Check if there are resources to delete - if [ "$(echo $resources | jq '. | length')" -gt 0 ]; then - for resource in $(echo $resources | jq -c '.[]'); do - resource_id=$(echo $resource | jq -r '.id') - resource_type=$(echo $resource | jq -r '.type') - - echo "Deleting resource: $resource_id" - - # Use specific commands for OpenAI resources - case $resource_type in - "Microsoft.CognitiveServices/accounts") - account_name=$(basename "$resource_id") - az cognitiveservices account delete --name "$account_name" --resource-group pslautomationRes20240930052609 --yes --no-wait - ;; - "Microsoft.CognitiveServices/openAIModels") - model_name=$(basename "$resource_id") - az cognitiveservices openai model delete --name "$model_name" --resource-group pslautomationRes20240930052609 --yes --no-wait - ;; - *) - echo "Unknown resource type: $resource_type. Skipping deletion." - ;; - esac - done - echo "All OpenAI resources processed in resource group pslautomationRes20240930052609" - else - echo "No OpenAI resources found in resource group." - fi + echo "Resource group exist. Cleaning..." + az group delete \ + --name ${{ env.RESOURCE_GROUP_NAME }} \ + --yes \ + --no-wait + echo "Resource group deleted... ${{ env.RESOURCE_GROUP_NAME }}" else - echo "Resource group does not exist." + echo "Resource group does not exists." fi - - # - name: Send Notification on Failure - # if: failure() - # run: | - # RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + - name: Send Notification on Failure + if: failure() + run: | + RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" - # # Construct the email body - # EMAIL_BODY=$(cat <Dear Team,

We would like to inform you that the Research Assistant Automation process has encountered an issue and has failed to complete successfully.

Build URL: ${RUN_URL}
${OUTPUT}

Please investigate the matter at your earliest convenience.

Best regards,
Your Automation Team

" - # } - # EOF - # ) + # Construct the email body + EMAIL_BODY=$(cat <Dear Team,

We would like to inform you that the Research Assistant Automation process has encountered an issue and has failed to complete successfully.

Build URL: ${RUN_URL}
${OUTPUT}

Please investigate the matter at your earliest convenience.

Best regards,
Your Automation Team

" + } + EOF + ) - # # Send the notification - # curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ - # -H "Content-Type: application/json" \ - # -d "$EMAIL_BODY" || echo "Failed to send notification" \ No newline at end of file + # Send the notification + curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ + -H "Content-Type: application/json" \ + -d "$EMAIL_BODY" || echo "Failed to send notification" \ No newline at end of file From afea4c7001562984c4a657edff9e08a332931313 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 14:58:45 +0530 Subject: [PATCH 112/163] testing automation flow --- .github/workflows/CAdeploy.yml | 22 ++++++++++++++-------- ClientAdvisor/{test3.txt => test2.txt} | 0 2 files changed, 14 insertions(+), 8 deletions(-) rename ClientAdvisor/{test3.txt => test2.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 9bd68d2d..ef61598e 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -6,6 +6,12 @@ on: - main paths: - 'ClientAdvisor/**' + workflow_dispatch: + # inputs: + # environmentName: + # description: 'The name of the powerbi url' + # required: true + # default: "test.com" jobs: deploy: @@ -61,14 +67,14 @@ jobs: echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" - - name: Deploy Bicep Template - id: deploy - run: | - set -e - az deployment group create \ - --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ - --template-file ClientAdvisor/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} cosmosLocation=eastus2 vitePowerBIEmbed_URL=test.com + # - name: Deploy Bicep Template + # id: deploy + # run: | + # set -e + # az deployment group create \ + # --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ + # --template-file ClientAdvisor/Deployment/bicep/main.bicep \ + # --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} cosmosLocation=eastus2 vitePowerBIEmbed_URL=test.com - name: Delete Bicep Deployment if: success() diff --git a/ClientAdvisor/test3.txt b/ClientAdvisor/test2.txt similarity index 100% rename from ClientAdvisor/test3.txt rename to ClientAdvisor/test2.txt From 5f5246a208aef29c08d0634a7a166794086c4036 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 15:08:00 +0530 Subject: [PATCH 113/163] testing automation flow --- .github/workflows/CAdeploy.yml | 26 +++++++++++++------------- ClientAdvisor/{test2.txt => test.txt} | 0 2 files changed, 13 insertions(+), 13 deletions(-) rename ClientAdvisor/{test2.txt => test.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index ef61598e..7077855b 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -7,11 +7,11 @@ on: paths: - 'ClientAdvisor/**' workflow_dispatch: - # inputs: - # environmentName: - # description: 'The name of the powerbi url' - # required: true - # default: "test.com" + inputs: + environmentName: + description: 'The name of the powerbi url' + required: true + default: "test.com" jobs: deploy: @@ -67,14 +67,14 @@ jobs: echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" - # - name: Deploy Bicep Template - # id: deploy - # run: | - # set -e - # az deployment group create \ - # --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ - # --template-file ClientAdvisor/Deployment/bicep/main.bicep \ - # --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} cosmosLocation=eastus2 vitePowerBIEmbed_URL=test.com + - name: Deploy Bicep Template + id: deploy + run: | + set -e + az deployment group create \ + --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ + --template-file ClientAdvisor/Deployment/bicep/main.bicep \ + --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} cosmosLocation=eastus2 vitePowerBIEmbed_URL=${{ github.event.inputs.environmentName }} - name: Delete Bicep Deployment if: success() diff --git a/ClientAdvisor/test2.txt b/ClientAdvisor/test.txt similarity index 100% rename from ClientAdvisor/test2.txt rename to ClientAdvisor/test.txt From 6313a92fae1fce53093ae27a83d2cd4e2f8ddcc7 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 17:05:09 +0530 Subject: [PATCH 114/163] testing automation flow --- .github/workflows/CAdeploy.yml | 155 ++++++++++++++------------ ClientAdvisor/{test.txt => test2.txt} | 0 2 files changed, 84 insertions(+), 71 deletions(-) rename ClientAdvisor/{test.txt => test2.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 7077855b..7d45cacd 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -8,10 +8,15 @@ on: - 'ClientAdvisor/**' workflow_dispatch: inputs: - environmentName: + powerbiURL: description: 'The name of the powerbi url' required: true default: "test.com" + ApplicationName: + description: 'The name of the powerbi url' + required: true + default: "test" + jobs: deploy: @@ -33,80 +38,88 @@ jobs: - name: Install Bicep CLI run: az bicep install - - name: Generate Resource Group Name - id: generate_rg_name - run: | - echo "Generating a unique resource group name..." - TIMESTAMP=$(date +%Y%m%d%H%M%S) - COMMON_PART="pslautomationCli" - UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" - echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV - echo "Generated RESOURCE_GROUP_PREFIX: ${UNIQUE_RG_NAME}" + # - name: Generate Resource Group Name + # id: generate_rg_name + # run: | + # echo "Generating a unique resource group name..." + # TIMESTAMP=$(date +%Y%m%d%H%M%S) + # COMMON_PART="pslautomationCli" + # UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" + # echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV + # echo "Generated RESOURCE_GROUP_PREFIX: ${UNIQUE_RG_NAME}" - - name: Check and Create Resource Group - id: check_create_rg - run: | - set -e - echo "Checking if resource group exists..." - rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) - if [ "$rg_exists" = "false" ]; then - echo "Resource group does not exist. Creating..." - az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location uksouth || { echo "Error creating resource group"; exit 1; } - else - echo "Resource group already exists." - fi + # - name: Check and Create Resource Group + # id: check_create_rg + # run: | + # set -e + # echo "Checking if resource group exists..." + # rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) + # if [ "$rg_exists" = "false" ]; then + # echo "Resource group does not exist. Creating..." + # az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location uksouth || { echo "Error creating resource group"; exit 1; } + # else + # echo "Resource group already exists." + # fi - - name: Generate Unique Solution Prefix - id: generate_solution_prefix - run: | - set -e - COMMON_PART="pslc" - TIMESTAMP=$(date +%s) - UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3) - UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" - echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV - echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" + # - name: Generate Unique Solution Prefix + # id: generate_solution_prefix + # run: | + # set -e + # COMMON_PART="pslc" + # TIMESTAMP=$(date +%s) + # UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3) + # UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" + # echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV + # echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" - - name: Deploy Bicep Template - id: deploy - run: | - set -e - az deployment group create \ - --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ - --template-file ClientAdvisor/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} cosmosLocation=eastus2 vitePowerBIEmbed_URL=${{ github.event.inputs.environmentName }} + # - name: Deploy Bicep Template + # id: deploy + # run: | + # set -e + # az deployment group create \ + # --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ + # --template-file ClientAdvisor/Deployment/bicep/main.bicep \ + # --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} cosmosLocation=eastus2 vitePowerBIEmbed_URL=${{ github.event.inputs.powerbiURL }} - - name: Delete Bicep Deployment - if: success() - run: | - set -e - echo "Checking if resource group exists..." - rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) - if [ "$rg_exists" = "true" ]; then - echo "Resource group exist. Cleaning..." - az group delete \ - --name ${{ env.RESOURCE_GROUP_NAME }} \ - --yes \ - --no-wait - echo "Resource group deleted... ${{ env.RESOURCE_GROUP_NAME }}" - else - echo "Resource group does not exists." - fi + # - name: Delete Bicep Deployment + # if: success() + # run: | + # set -e + # echo "Checking if resource group exists..." + # rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) + # if [ "$rg_exists" = "true" ]; then + # echo "Resource group exist. Cleaning..." + # az group delete \ + # --name ${{ env.RESOURCE_GROUP_NAME }} \ + # --yes \ + # --no-wait + # echo "Resource group deleted... ${{ env.RESOURCE_GROUP_NAME }}" + # else + # echo "Resource group does not exists." + # fi - - name: Send Notification on Failure - if: failure() - run: | - RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + # - name: Send Notification on Failure + # if: failure() + # run: | + # RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" - # Construct the email body - EMAIL_BODY=$(cat <Dear Team,

We would like to inform you that the Client Advisor Automation process has encountered an issue and has failed to complete successfully.

Build URL: ${RUN_URL}
${OUTPUT}

Please investigate the matter at your earliest convenience.

Best regards,
Your Automation Team

" - } - EOF - ) + # # Construct the email body + # EMAIL_BODY=$(cat <Dear Team,

We would like to inform you that the Client Advisor Automation process has encountered an issue and has failed to complete successfully.

Build URL: ${RUN_URL}
${OUTPUT}

Please investigate the matter at your earliest convenience.

Best regards,
Your Automation Team

" + # } + # EOF + # ) - # Send the notification - curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ - -H "Content-Type: application/json" \ - -d "$EMAIL_BODY" || echo "Failed to send notification" \ No newline at end of file + # # Send the notification + # curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ + # -H "Content-Type: application/json" \ + # -d "$EMAIL_BODY" || echo "Failed to send notification" + + - name: Update powerBI URL + if: ${{ github.event.inputs.powerbiURL != 'TBD' }} + run: | + echo "resource grp powerbi: ${{ env.RESOURCE_GROUP_NAME }}" + set -e + az webapp config appsettings set --name ${{ github.event.inputs.ApplicationName }} --resource-group ${{ env.RESOURCE_GROUP_NAME }} --settings VITE_POWERBI_EMBED_URL=${{ github.event.inputs.powerbiURL }} + diff --git a/ClientAdvisor/test.txt b/ClientAdvisor/test2.txt similarity index 100% rename from ClientAdvisor/test.txt rename to ClientAdvisor/test2.txt From 77c3c036adaf129e30ea91b1439feaeb3b221537 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 17:07:34 +0530 Subject: [PATCH 115/163] testing automation flow --- .github/workflows/CAdeploy.yml | 3 ++- ClientAdvisor/{test2.txt => test3.txt} | 0 2 files changed, 2 insertions(+), 1 deletion(-) rename ClientAdvisor/{test2.txt => test3.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 7d45cacd..557198f2 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -13,7 +13,7 @@ on: required: true default: "test.com" ApplicationName: - description: 'The name of the powerbi url' + description: 'The application name' required: true default: "test" @@ -120,6 +120,7 @@ jobs: if: ${{ github.event.inputs.powerbiURL != 'TBD' }} run: | echo "resource grp powerbi: ${{ env.RESOURCE_GROUP_NAME }}" + echo "application name: ${{ github.event.inputs.ApplicationName }}" set -e az webapp config appsettings set --name ${{ github.event.inputs.ApplicationName }} --resource-group ${{ env.RESOURCE_GROUP_NAME }} --settings VITE_POWERBI_EMBED_URL=${{ github.event.inputs.powerbiURL }} diff --git a/ClientAdvisor/test2.txt b/ClientAdvisor/test3.txt similarity index 100% rename from ClientAdvisor/test2.txt rename to ClientAdvisor/test3.txt From 7b4043ecc1e9c3f23823496355939698db729673 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 17:10:55 +0530 Subject: [PATCH 116/163] testing automation flow --- .github/workflows/CAdeploy.yml | 2 +- ClientAdvisor/{test3.txt => test34.txt} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename ClientAdvisor/{test3.txt => test34.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 557198f2..d9f0ad4d 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -122,5 +122,5 @@ jobs: echo "resource grp powerbi: ${{ env.RESOURCE_GROUP_NAME }}" echo "application name: ${{ github.event.inputs.ApplicationName }}" set -e - az webapp config appsettings set --name ${{ github.event.inputs.ApplicationName }} --resource-group ${{ env.RESOURCE_GROUP_NAME }} --settings VITE_POWERBI_EMBED_URL=${{ github.event.inputs.powerbiURL }} + az webapp config appsettings set --name ${{ github.event.inputs.ApplicationName }} --resource-group ${{ env.RESOURCE_GROUP_NAME }} --settings VITE_POWERBI_EMBED_URL=${{ github.event.inputs.powerbiURL }} diff --git a/ClientAdvisor/test3.txt b/ClientAdvisor/test34.txt similarity index 100% rename from ClientAdvisor/test3.txt rename to ClientAdvisor/test34.txt From 64a2d62d7fbc336d25b4936720abe8ffdf0c8830 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 17:12:06 +0530 Subject: [PATCH 117/163] testing automation flow --- .github/workflows/CAdeploy.yml | 18 +++++++++--------- ClientAdvisor/{test34.txt => test3.txt} | 0 2 files changed, 9 insertions(+), 9 deletions(-) rename ClientAdvisor/{test34.txt => test3.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index d9f0ad4d..bbd818e1 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -38,15 +38,15 @@ jobs: - name: Install Bicep CLI run: az bicep install - # - name: Generate Resource Group Name - # id: generate_rg_name - # run: | - # echo "Generating a unique resource group name..." - # TIMESTAMP=$(date +%Y%m%d%H%M%S) - # COMMON_PART="pslautomationCli" - # UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" - # echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV - # echo "Generated RESOURCE_GROUP_PREFIX: ${UNIQUE_RG_NAME}" + - name: Generate Resource Group Name + id: generate_rg_name + run: | + echo "Generating a unique resource group name..." + TIMESTAMP=$(date +%Y%m%d%H%M%S) + COMMON_PART="pslautomationCli" + UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" + echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV + echo "Generated RESOURCE_GROUP_PREFIX: ${UNIQUE_RG_NAME}" # - name: Check and Create Resource Group # id: check_create_rg diff --git a/ClientAdvisor/test34.txt b/ClientAdvisor/test3.txt similarity index 100% rename from ClientAdvisor/test34.txt rename to ClientAdvisor/test3.txt From 2bad73db9e18626361f9d1aba842ca6c9773a9f6 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 17:20:07 +0530 Subject: [PATCH 118/163] testing automation flow --- .github/workflows/CAdeploy.yml | 1 + ClientAdvisor/{test3.txt => test4.txt} | 0 2 files changed, 1 insertion(+) rename ClientAdvisor/{test3.txt => test4.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index bbd818e1..4b02ef55 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -121,6 +121,7 @@ jobs: run: | echo "resource grp powerbi: ${{ env.RESOURCE_GROUP_NAME }}" echo "application name: ${{ github.event.inputs.ApplicationName }}" + echo "powerbi: ${{ github.event.inputs.powerbiURL }}" set -e az webapp config appsettings set --name ${{ github.event.inputs.ApplicationName }} --resource-group ${{ env.RESOURCE_GROUP_NAME }} --settings VITE_POWERBI_EMBED_URL=${{ github.event.inputs.powerbiURL }} diff --git a/ClientAdvisor/test3.txt b/ClientAdvisor/test4.txt similarity index 100% rename from ClientAdvisor/test3.txt rename to ClientAdvisor/test4.txt From 6f9e2a94793502320097e5ff02387ed2d999d59d Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 17:35:24 +0530 Subject: [PATCH 119/163] testing automation flow --- .github/workflows/CAdeploy.yml | 2 +- ClientAdvisor/{test4.txt => test5.txt} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename ClientAdvisor/{test4.txt => test5.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 4b02ef55..168f510a 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -123,5 +123,5 @@ jobs: echo "application name: ${{ github.event.inputs.ApplicationName }}" echo "powerbi: ${{ github.event.inputs.powerbiURL }}" set -e - az webapp config appsettings set --name ${{ github.event.inputs.ApplicationName }} --resource-group ${{ env.RESOURCE_GROUP_NAME }} --settings VITE_POWERBI_EMBED_URL=${{ github.event.inputs.powerbiURL }} + az webapp config appsettings set --name pslc3-app-service --resource-group pslautomationbyoa5 --settings VITE_POWERBI_EMBED_URL=example.com diff --git a/ClientAdvisor/test4.txt b/ClientAdvisor/test5.txt similarity index 100% rename from ClientAdvisor/test4.txt rename to ClientAdvisor/test5.txt From e86b075560423ffae6601eda473321eecf479b1c Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 17:39:09 +0530 Subject: [PATCH 120/163] testing automation flow --- .github/workflows/CAdeploy.yml | 2 +- ClientAdvisor/{test5.txt => test15.txt} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename ClientAdvisor/{test5.txt => test15.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 168f510a..4b02ef55 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -123,5 +123,5 @@ jobs: echo "application name: ${{ github.event.inputs.ApplicationName }}" echo "powerbi: ${{ github.event.inputs.powerbiURL }}" set -e - az webapp config appsettings set --name pslc3-app-service --resource-group pslautomationbyoa5 --settings VITE_POWERBI_EMBED_URL=example.com + az webapp config appsettings set --name ${{ github.event.inputs.ApplicationName }} --resource-group ${{ env.RESOURCE_GROUP_NAME }} --settings VITE_POWERBI_EMBED_URL=${{ github.event.inputs.powerbiURL }} diff --git a/ClientAdvisor/test5.txt b/ClientAdvisor/test15.txt similarity index 100% rename from ClientAdvisor/test5.txt rename to ClientAdvisor/test15.txt From 37fec17c79a1ebfdf2675bbebe45010457a5aa9d Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 18:00:13 +0530 Subject: [PATCH 121/163] testing automation flow --- .github/workflows/CAdeploy.yml | 2 +- ClientAdvisor/{test15.txt => test1.txt} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename ClientAdvisor/{test15.txt => test1.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 4b02ef55..18a2c5b1 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -123,5 +123,5 @@ jobs: echo "application name: ${{ github.event.inputs.ApplicationName }}" echo "powerbi: ${{ github.event.inputs.powerbiURL }}" set -e - az webapp config appsettings set --name ${{ github.event.inputs.ApplicationName }} --resource-group ${{ env.RESOURCE_GROUP_NAME }} --settings VITE_POWERBI_EMBED_URL=${{ github.event.inputs.powerbiURL }} + az webapp config appsettings set --name ${{ github.event.inputs.ApplicationName }} --resource-group pslautomationbyoa5 --settings VITE_POWERBI_EMBED_URL=${{ github.event.inputs.powerbiURL }} diff --git a/ClientAdvisor/test15.txt b/ClientAdvisor/test1.txt similarity index 100% rename from ClientAdvisor/test15.txt rename to ClientAdvisor/test1.txt From f760a1adeeecddfd6a316593e89598c3c81aceda Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 19:10:24 +0530 Subject: [PATCH 122/163] testing automation flow --- .github/workflows/CAdeploy.yml | 63 +++++++++++++++----------- ClientAdvisor/{test1.txt => test2.txt} | 0 2 files changed, 36 insertions(+), 27 deletions(-) rename ClientAdvisor/{test1.txt => test2.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 18a2c5b1..872bf7f3 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -12,7 +12,7 @@ on: description: 'The name of the powerbi url' required: true default: "test.com" - ApplicationName: + applicationName: description: 'The application name' required: true default: "test" @@ -40,11 +40,13 @@ jobs: - name: Generate Resource Group Name id: generate_rg_name + if: ${{ github.event_name == 'workflow_dispatch'}} run: | echo "Generating a unique resource group name..." TIMESTAMP=$(date +%Y%m%d%H%M%S) COMMON_PART="pslautomationCli" - UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" + # UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" + UNIQUE_RG_NAME="pslautomationbyoa5" echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV echo "Generated RESOURCE_GROUP_PREFIX: ${UNIQUE_RG_NAME}" @@ -79,7 +81,23 @@ jobs: # az deployment group create \ # --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ # --template-file ClientAdvisor/Deployment/bicep/main.bicep \ - # --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} cosmosLocation=eastus2 vitePowerBIEmbed_URL=${{ github.event.inputs.powerbiURL }} + # --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} cosmosLocation=eastus2 + + - name: Update PowerBI URL + if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.powerbiURL != 'TBD' }} + run: | + set -e + echo "application name: ${{ github.event.inputs.applicationName }}" + echo "powerBI URL: ${{ github.event.inputs.powerbiURL }}" + az webapp config appsettings set --name ${{ github.event.inputs.applicationName }} --resource-group pslautomationbyoa5 --settings VITE_POWERBI_EMBED_URL=${{ github.event.inputs.powerbiURL }} + # Restart App Service + az webapp restart --resource-group $resourceGroup --name $appServiceName + # Check if the update was successful + if [ $? -eq 0 ]; then + echo "Power BI URL updated successfully." + else + echo "Failed to update Power BI URL." + fi # - name: Delete Bicep Deployment # if: success() @@ -98,30 +116,21 @@ jobs: # echo "Resource group does not exists." # fi - # - name: Send Notification on Failure - # if: failure() - # run: | - # RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + - name: Send Notification on Failure + if: failure() + run: | + RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" - # # Construct the email body - # EMAIL_BODY=$(cat <Dear Team,

We would like to inform you that the Client Advisor Automation process has encountered an issue and has failed to complete successfully.

Build URL: ${RUN_URL}
${OUTPUT}

Please investigate the matter at your earliest convenience.

Best regards,
Your Automation Team

" - # } - # EOF - # ) + # Construct the email body + EMAIL_BODY=$(cat <Dear Team,

We would like to inform you that the Client Advisor Automation process has encountered an issue and has failed to complete successfully.

Build URL: ${RUN_URL}
${OUTPUT}

Please investigate the matter at your earliest convenience.

Best regards,
Your Automation Team

" + } + EOF + ) - # # Send the notification - # curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ - # -H "Content-Type: application/json" \ - # -d "$EMAIL_BODY" || echo "Failed to send notification" - - - name: Update powerBI URL - if: ${{ github.event.inputs.powerbiURL != 'TBD' }} - run: | - echo "resource grp powerbi: ${{ env.RESOURCE_GROUP_NAME }}" - echo "application name: ${{ github.event.inputs.ApplicationName }}" - echo "powerbi: ${{ github.event.inputs.powerbiURL }}" - set -e - az webapp config appsettings set --name ${{ github.event.inputs.ApplicationName }} --resource-group pslautomationbyoa5 --settings VITE_POWERBI_EMBED_URL=${{ github.event.inputs.powerbiURL }} + # Send the notification + curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ + -H "Content-Type: application/json" \ + -d "$EMAIL_BODY" || echo "Failed to send notification" diff --git a/ClientAdvisor/test1.txt b/ClientAdvisor/test2.txt similarity index 100% rename from ClientAdvisor/test1.txt rename to ClientAdvisor/test2.txt From 4e94cedad2a5262831ff87a4611dcc712f2ee733 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 19:13:09 +0530 Subject: [PATCH 123/163] testing automation flow --- .github/workflows/CAdeploy.yml | 4 ++-- ClientAdvisor/{test2.txt => test3.txt} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename ClientAdvisor/{test2.txt => test3.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 872bf7f3..463892fd 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -40,7 +40,7 @@ jobs: - name: Generate Resource Group Name id: generate_rg_name - if: ${{ github.event_name == 'workflow_dispatch'}} + # if: ${{ github.event_name == 'workflow_dispatch'}} run: | echo "Generating a unique resource group name..." TIMESTAMP=$(date +%Y%m%d%H%M%S) @@ -84,7 +84,7 @@ jobs: # --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} cosmosLocation=eastus2 - name: Update PowerBI URL - if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.powerbiURL != 'TBD' }} + if: ${{ github.event.inputs.powerbiURL != 'TBD' }} run: | set -e echo "application name: ${{ github.event.inputs.applicationName }}" diff --git a/ClientAdvisor/test2.txt b/ClientAdvisor/test3.txt similarity index 100% rename from ClientAdvisor/test2.txt rename to ClientAdvisor/test3.txt From 4d54e0a0d25081058c2448eb3494f2387457db3e Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 19:26:56 +0530 Subject: [PATCH 124/163] testing automation flow --- .github/workflows/CAdeploy.yml | 67 ++++++++++++++------------ ClientAdvisor/{test3.txt => test2.txt} | 0 2 files changed, 35 insertions(+), 32 deletions(-) rename ClientAdvisor/{test3.txt => test2.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 463892fd..07b17fe0 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -40,7 +40,7 @@ jobs: - name: Generate Resource Group Name id: generate_rg_name - # if: ${{ github.event_name == 'workflow_dispatch'}} + if: ${{ github.event_name != 'workflow_dispatch'}} run: | echo "Generating a unique resource group name..." TIMESTAMP=$(date +%Y%m%d%H%M%S) @@ -52,6 +52,7 @@ jobs: # - name: Check and Create Resource Group # id: check_create_rg + # if: ${{ github.event_name == 'workflow_dispatch'}} # run: | # set -e # echo "Checking if resource group exists..." @@ -65,6 +66,7 @@ jobs: # - name: Generate Unique Solution Prefix # id: generate_solution_prefix + # if: ${{ github.event_name != 'workflow_dispatch'}} # run: | # set -e # COMMON_PART="pslc" @@ -76,6 +78,7 @@ jobs: # - name: Deploy Bicep Template # id: deploy + # if: ${{ github.event_name != 'workflow_dispatch'}} # run: | # set -e # az deployment group create \ @@ -83,24 +86,24 @@ jobs: # --template-file ClientAdvisor/Deployment/bicep/main.bicep \ # --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} cosmosLocation=eastus2 - - name: Update PowerBI URL - if: ${{ github.event.inputs.powerbiURL != 'TBD' }} - run: | - set -e - echo "application name: ${{ github.event.inputs.applicationName }}" - echo "powerBI URL: ${{ github.event.inputs.powerbiURL }}" - az webapp config appsettings set --name ${{ github.event.inputs.applicationName }} --resource-group pslautomationbyoa5 --settings VITE_POWERBI_EMBED_URL=${{ github.event.inputs.powerbiURL }} - # Restart App Service - az webapp restart --resource-group $resourceGroup --name $appServiceName - # Check if the update was successful - if [ $? -eq 0 ]; then - echo "Power BI URL updated successfully." - else - echo "Failed to update Power BI URL." - fi + # - name: Update PowerBI URL + # if: ${{ github.event_name != 'workflow_dispatch' && github.event.inputs.powerbiURL != 'TBD' }} + # run: | + # set -e + # echo "application name: ${{ github.event.inputs.applicationName }}" + # echo "powerBI URL: ${{ github.event.inputs.powerbiURL }}" + # az webapp config appsettings set --name ${{ github.event.inputs.applicationName }} --resource-group pslautomationbyoa5 --settings VITE_POWERBI_EMBED_URL=${{ github.event.inputs.powerbiURL }} + # # Restart App Service + # az webapp restart --resource-group $resourceGroup --name $appServiceName + # # Check if the update was successful + # if [ $? -eq 0 ]; then + # echo "Power BI URL updated successfully." + # else + # echo "Failed to update Power BI URL." + # fi # - name: Delete Bicep Deployment - # if: success() + # if: success() && ${{ github.event_name != 'workflow_dispatch'}} # run: | # set -e # echo "Checking if resource group exists..." @@ -116,21 +119,21 @@ jobs: # echo "Resource group does not exists." # fi - - name: Send Notification on Failure - if: failure() - run: | - RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + # - name: Send Notification on Failure + # if: failure() + # run: | + # RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" - # Construct the email body - EMAIL_BODY=$(cat <Dear Team,

We would like to inform you that the Client Advisor Automation process has encountered an issue and has failed to complete successfully.

Build URL: ${RUN_URL}
${OUTPUT}

Please investigate the matter at your earliest convenience.

Best regards,
Your Automation Team

" - } - EOF - ) + # # Construct the email body + # EMAIL_BODY=$(cat <Dear Team,

We would like to inform you that the Client Advisor Automation process has encountered an issue and has failed to complete successfully.

Build URL: ${RUN_URL}
${OUTPUT}

Please investigate the matter at your earliest convenience.

Best regards,
Your Automation Team

" + # } + # EOF + # ) - # Send the notification - curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ - -H "Content-Type: application/json" \ - -d "$EMAIL_BODY" || echo "Failed to send notification" + # # Send the notification + # curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ + # -H "Content-Type: application/json" \ + # -d "$EMAIL_BODY" || echo "Failed to send notification" diff --git a/ClientAdvisor/test3.txt b/ClientAdvisor/test2.txt similarity index 100% rename from ClientAdvisor/test3.txt rename to ClientAdvisor/test2.txt From d54e7aec6ef540c9929af85c65d07e9a3a6cf009 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 19:29:09 +0530 Subject: [PATCH 125/163] testing automation flow --- .github/workflows/CAdeploy.yml | 3 ++- ClientAdvisor/{test2.txt => test12.txt} | 0 2 files changed, 2 insertions(+), 1 deletion(-) rename ClientAdvisor/{test2.txt => test12.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 07b17fe0..8093e896 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -40,7 +40,8 @@ jobs: - name: Generate Resource Group Name id: generate_rg_name - if: ${{ github.event_name != 'workflow_dispatch'}} + if: success() && github.event_name != 'workflow_dispatch' + # if: ${{ github.event_name != 'workflow_dispatch'}} run: | echo "Generating a unique resource group name..." TIMESTAMP=$(date +%Y%m%d%H%M%S) diff --git a/ClientAdvisor/test2.txt b/ClientAdvisor/test12.txt similarity index 100% rename from ClientAdvisor/test2.txt rename to ClientAdvisor/test12.txt From 737e300f19c21427312e9a6293fe9c248fd725c1 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 19:30:51 +0530 Subject: [PATCH 126/163] testing automation flow --- .github/workflows/CAdeploy.yml | 2 +- ClientAdvisor/{test12.txt => test1.txt} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename ClientAdvisor/{test12.txt => test1.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 8093e896..fb65af3b 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -40,7 +40,7 @@ jobs: - name: Generate Resource Group Name id: generate_rg_name - if: success() && github.event_name != 'workflow_dispatch' + if: failure() && github.event_name != 'workflow_dispatch' # if: ${{ github.event_name != 'workflow_dispatch'}} run: | echo "Generating a unique resource group name..." diff --git a/ClientAdvisor/test12.txt b/ClientAdvisor/test1.txt similarity index 100% rename from ClientAdvisor/test12.txt rename to ClientAdvisor/test1.txt From 7f106a57054a6e3bd9d291ef58771200ec3d987d Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 19:35:15 +0530 Subject: [PATCH 127/163] testing automation flow --- .github/workflows/CAdeploy.yml | 2 +- ClientAdvisor/{test1.txt => test11.txt} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename ClientAdvisor/{test1.txt => test11.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index fb65af3b..00e9802b 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -40,7 +40,7 @@ jobs: - name: Generate Resource Group Name id: generate_rg_name - if: failure() && github.event_name != 'workflow_dispatch' + if: ${{failure() && github.event_name != 'workflow_dispatch'}} # if: ${{ github.event_name != 'workflow_dispatch'}} run: | echo "Generating a unique resource group name..." diff --git a/ClientAdvisor/test1.txt b/ClientAdvisor/test11.txt similarity index 100% rename from ClientAdvisor/test1.txt rename to ClientAdvisor/test11.txt From 3446f984ce1014ac3fd5cb68cf4c318a6b2d2b25 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 19:37:04 +0530 Subject: [PATCH 128/163] testing automation flow --- .github/workflows/CAdeploy.yml | 2 +- ClientAdvisor/{test11.txt => test1.txt} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename ClientAdvisor/{test11.txt => test1.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 00e9802b..cb56c463 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -40,7 +40,7 @@ jobs: - name: Generate Resource Group Name id: generate_rg_name - if: ${{failure() && github.event_name != 'workflow_dispatch'}} + if: ${{success() && github.event_name != 'workflow_dispatch'}} # if: ${{ github.event_name != 'workflow_dispatch'}} run: | echo "Generating a unique resource group name..." diff --git a/ClientAdvisor/test11.txt b/ClientAdvisor/test1.txt similarity index 100% rename from ClientAdvisor/test11.txt rename to ClientAdvisor/test1.txt From 473d1a410684fdc25b862d66267df47655df4193 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 19:41:42 +0530 Subject: [PATCH 129/163] testing automation flow --- .github/workflows/CAdeploy.yml | 161 ++++++++++++------------- ClientAdvisor/{test1.txt => test2.txt} | 0 2 files changed, 80 insertions(+), 81 deletions(-) rename ClientAdvisor/{test1.txt => test2.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index cb56c463..0f19f7fb 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -40,8 +40,7 @@ jobs: - name: Generate Resource Group Name id: generate_rg_name - if: ${{success() && github.event_name != 'workflow_dispatch'}} - # if: ${{ github.event_name != 'workflow_dispatch'}} + if: ${{ github.event_name != 'workflow_dispatch'}} run: | echo "Generating a unique resource group name..." TIMESTAMP=$(date +%Y%m%d%H%M%S) @@ -51,90 +50,90 @@ jobs: echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV echo "Generated RESOURCE_GROUP_PREFIX: ${UNIQUE_RG_NAME}" - # - name: Check and Create Resource Group - # id: check_create_rg - # if: ${{ github.event_name == 'workflow_dispatch'}} - # run: | - # set -e - # echo "Checking if resource group exists..." - # rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) - # if [ "$rg_exists" = "false" ]; then - # echo "Resource group does not exist. Creating..." - # az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location uksouth || { echo "Error creating resource group"; exit 1; } - # else - # echo "Resource group already exists." - # fi + - name: Check and Create Resource Group + id: check_create_rg + if: ${{ github.event_name == 'workflow_dispatch'}} + run: | + set -e + echo "Checking if resource group exists..." + rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) + if [ "$rg_exists" = "false" ]; then + echo "Resource group does not exist. Creating..." + az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location uksouth || { echo "Error creating resource group"; exit 1; } + else + echo "Resource group already exists." + fi - # - name: Generate Unique Solution Prefix - # id: generate_solution_prefix - # if: ${{ github.event_name != 'workflow_dispatch'}} - # run: | - # set -e - # COMMON_PART="pslc" - # TIMESTAMP=$(date +%s) - # UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3) - # UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" - # echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV - # echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" + - name: Generate Unique Solution Prefix + id: generate_solution_prefix + if: ${{ github.event_name != 'workflow_dispatch'}} + run: | + set -e + COMMON_PART="pslc" + TIMESTAMP=$(date +%s) + UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3) + UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" + echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV + echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" - # - name: Deploy Bicep Template - # id: deploy - # if: ${{ github.event_name != 'workflow_dispatch'}} - # run: | - # set -e - # az deployment group create \ - # --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ - # --template-file ClientAdvisor/Deployment/bicep/main.bicep \ - # --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} cosmosLocation=eastus2 + - name: Deploy Bicep Template + id: deploy + if: ${{ github.event_name != 'workflow_dispatch'}} + run: | + set -e + az deployment group create \ + --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ + --template-file ClientAdvisor/Deployment/bicep/main.bicep \ + --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} cosmosLocation=eastus2 - # - name: Update PowerBI URL - # if: ${{ github.event_name != 'workflow_dispatch' && github.event.inputs.powerbiURL != 'TBD' }} - # run: | - # set -e - # echo "application name: ${{ github.event.inputs.applicationName }}" - # echo "powerBI URL: ${{ github.event.inputs.powerbiURL }}" - # az webapp config appsettings set --name ${{ github.event.inputs.applicationName }} --resource-group pslautomationbyoa5 --settings VITE_POWERBI_EMBED_URL=${{ github.event.inputs.powerbiURL }} - # # Restart App Service - # az webapp restart --resource-group $resourceGroup --name $appServiceName - # # Check if the update was successful - # if [ $? -eq 0 ]; then - # echo "Power BI URL updated successfully." - # else - # echo "Failed to update Power BI URL." - # fi + - name: Update PowerBI URL + if: ${{ github.event_name != 'workflow_dispatch' && github.event.inputs.powerbiURL != 'TBD' }} + run: | + set -e + echo "application name: ${{ github.event.inputs.applicationName }}" + echo "powerBI URL: ${{ github.event.inputs.powerbiURL }}" + az webapp config appsettings set --name ${{ github.event.inputs.applicationName }} --resource-group pslautomationbyoa5 --settings VITE_POWERBI_EMBED_URL=${{ github.event.inputs.powerbiURL }} + # Restart App Service + az webapp restart --resource-group $resourceGroup --name $appServiceName + # Check if the update was successful + if [ $? -eq 0 ]; then + echo "Power BI URL updated successfully." + else + echo "Failed to update Power BI URL." + fi - # - name: Delete Bicep Deployment - # if: success() && ${{ github.event_name != 'workflow_dispatch'}} - # run: | - # set -e - # echo "Checking if resource group exists..." - # rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) - # if [ "$rg_exists" = "true" ]; then - # echo "Resource group exist. Cleaning..." - # az group delete \ - # --name ${{ env.RESOURCE_GROUP_NAME }} \ - # --yes \ - # --no-wait - # echo "Resource group deleted... ${{ env.RESOURCE_GROUP_NAME }}" - # else - # echo "Resource group does not exists." - # fi + - name: Delete Bicep Deployment + if: ${{ success() && github.event_name != 'workflow_dispatch' }} + run: | + set -e + echo "Checking if resource group exists..." + rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) + if [ "$rg_exists" = "true" ]; then + echo "Resource group exist. Cleaning..." + az group delete \ + --name ${{ env.RESOURCE_GROUP_NAME }} \ + --yes \ + --no-wait + echo "Resource group deleted... ${{ env.RESOURCE_GROUP_NAME }}" + else + echo "Resource group does not exists." + fi - # - name: Send Notification on Failure - # if: failure() - # run: | - # RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + - name: Send Notification on Failure + if: failure() + run: | + RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" - # # Construct the email body - # EMAIL_BODY=$(cat <Dear Team,

We would like to inform you that the Client Advisor Automation process has encountered an issue and has failed to complete successfully.

Build URL: ${RUN_URL}
${OUTPUT}

Please investigate the matter at your earliest convenience.

Best regards,
Your Automation Team

" - # } - # EOF - # ) + # Construct the email body + EMAIL_BODY=$(cat <Dear Team,

We would like to inform you that the Client Advisor Automation process has encountered an issue and has failed to complete successfully.

Build URL: ${RUN_URL}
${OUTPUT}

Please investigate the matter at your earliest convenience.

Best regards,
Your Automation Team

" + } + EOF + ) - # # Send the notification - # curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ - # -H "Content-Type: application/json" \ - # -d "$EMAIL_BODY" || echo "Failed to send notification" + # Send the notification + curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ + -H "Content-Type: application/json" \ + -d "$EMAIL_BODY" || echo "Failed to send notification" diff --git a/ClientAdvisor/test1.txt b/ClientAdvisor/test2.txt similarity index 100% rename from ClientAdvisor/test1.txt rename to ClientAdvisor/test2.txt From 5e653f375c4071a8b94387f994b65bb1d9bd706b Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 19:45:37 +0530 Subject: [PATCH 130/163] testing automation flow --- ClientAdvisor/Deployment/bicep/main.bicep | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ClientAdvisor/Deployment/bicep/main.bicep b/ClientAdvisor/Deployment/bicep/main.bicep index c88d9ec5..cb99dc11 100644 --- a/ClientAdvisor/Deployment/bicep/main.bicep +++ b/ClientAdvisor/Deployment/bicep/main.bicep @@ -6,8 +6,6 @@ targetScope = 'resourceGroup' @description('Prefix Name') param solutionPrefix string -param vitePowerBIEmbed_URL string - @description('CosmosDB Location') param cosmosLocation string @@ -241,7 +239,7 @@ module appserviceModule 'deploy_app_service.bicep' = { AZURE_COSMOSDB_CONVERSATIONS_CONTAINER: cosmosDBModule.outputs.cosmosOutput.cosmosContainerName AZURE_COSMOSDB_DATABASE: cosmosDBModule.outputs.cosmosOutput.cosmosDatabaseName AZURE_COSMOSDB_ENABLE_FEEDBACK: 'True' - VITE_POWERBI_EMBED_URL: vitePowerBIEmbed_URL + VITE_POWERBI_EMBED_URL: 'TBD' } scope: resourceGroup(resourceGroup().name) dependsOn:[azOpenAI,azAIMultiServiceAccount,azSearchService,sqlDBModule,azureFunctionURL,cosmosDBModule] From 259546449f8a1a7a3828ccb2105bd9e33447ee09 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 19:48:03 +0530 Subject: [PATCH 131/163] testing automation flow --- .github/workflows/CAdeploy.yml | 3 +-- ClientAdvisor/{test2.txt => test12.txt} | 0 2 files changed, 1 insertion(+), 2 deletions(-) rename ClientAdvisor/{test2.txt => test12.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 0f19f7fb..364710e4 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -52,7 +52,6 @@ jobs: - name: Check and Create Resource Group id: check_create_rg - if: ${{ github.event_name == 'workflow_dispatch'}} run: | set -e echo "Checking if resource group exists..." @@ -87,7 +86,7 @@ jobs: --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} cosmosLocation=eastus2 - name: Update PowerBI URL - if: ${{ github.event_name != 'workflow_dispatch' && github.event.inputs.powerbiURL != 'TBD' }} + if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.powerbiURL != 'TBD' }} run: | set -e echo "application name: ${{ github.event.inputs.applicationName }}" diff --git a/ClientAdvisor/test2.txt b/ClientAdvisor/test12.txt similarity index 100% rename from ClientAdvisor/test2.txt rename to ClientAdvisor/test12.txt From 416d349791a1546145e728ec3d1cd5ebbced82b0 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 30 Sep 2024 19:53:18 +0530 Subject: [PATCH 132/163] testing automation flow --- .github/workflows/CAdeploy.yml | 5 +++-- ClientAdvisor/{test12.txt => test2.txt} | 0 2 files changed, 3 insertions(+), 2 deletions(-) rename ClientAdvisor/{test12.txt => test2.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 364710e4..b334ee20 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -9,11 +9,11 @@ on: workflow_dispatch: inputs: powerbiURL: - description: 'The name of the powerbi url' + description: 'Enter the powerbi url' required: true default: "test.com" applicationName: - description: 'The application name' + description: 'Enter the application name' required: true default: "test" @@ -53,6 +53,7 @@ jobs: - name: Check and Create Resource Group id: check_create_rg run: | + echo "GRESOURCE_GROUP: ${{ env.RESOURCE_GROUP_NAME }}" set -e echo "Checking if resource group exists..." rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) diff --git a/ClientAdvisor/test12.txt b/ClientAdvisor/test2.txt similarity index 100% rename from ClientAdvisor/test12.txt rename to ClientAdvisor/test2.txt From 2b03a19f2f289a6c82cf2253c3e92e89b4a0540e Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Tue, 1 Oct 2024 11:21:28 +0530 Subject: [PATCH 133/163] testing automation flow --- .github/workflows/CAdeploy.yml | 108 +++++++++++-------------- ClientAdvisor/{test2.txt => test3.txt} | 0 2 files changed, 48 insertions(+), 60 deletions(-) rename ClientAdvisor/{test2.txt => test3.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index b334ee20..66495d89 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -5,18 +5,7 @@ on: branches: - main paths: - - 'ClientAdvisor/**' - workflow_dispatch: - inputs: - powerbiURL: - description: 'Enter the powerbi url' - required: true - default: "test.com" - applicationName: - description: 'Enter the application name' - required: true - default: "test" - + - 'ClientAdvisor/**' jobs: deploy: @@ -40,7 +29,6 @@ jobs: - name: Generate Resource Group Name id: generate_rg_name - if: ${{ github.event_name != 'workflow_dispatch'}} run: | echo "Generating a unique resource group name..." TIMESTAMP=$(date +%Y%m%d%H%M%S) @@ -53,7 +41,7 @@ jobs: - name: Check and Create Resource Group id: check_create_rg run: | - echo "GRESOURCE_GROUP: ${{ env.RESOURCE_GROUP_NAME }}" + echo "RESOURCE_GROUP: ${{ env.RESOURCE_GROUP_NAME }}" set -e echo "Checking if resource group exists..." rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) @@ -66,7 +54,6 @@ jobs: - name: Generate Unique Solution Prefix id: generate_solution_prefix - if: ${{ github.event_name != 'workflow_dispatch'}} run: | set -e COMMON_PART="pslc" @@ -76,25 +63,26 @@ jobs: echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" - - name: Deploy Bicep Template - id: deploy - if: ${{ github.event_name != 'workflow_dispatch'}} - run: | - set -e - az deployment group create \ - --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ - --template-file ClientAdvisor/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} cosmosLocation=eastus2 + # - name: Deploy Bicep Template + # id: deploy + # run: | + # set -e + # az deployment group create \ + # --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ + # --template-file ClientAdvisor/Deployment/bicep/main.bicep \ + # --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} cosmosLocation=eastus2 - name: Update PowerBI URL - if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.powerbiURL != 'TBD' }} + if: success() run: | set -e - echo "application name: ${{ github.event.inputs.applicationName }}" - echo "powerBI URL: ${{ github.event.inputs.powerbiURL }}" - az webapp config appsettings set --name ${{ github.event.inputs.applicationName }} --resource-group pslautomationbyoa5 --settings VITE_POWERBI_EMBED_URL=${{ github.event.inputs.powerbiURL }} + COMMON_PART="-app-service" + application_name="$${{ env.SOLUTION_PREFIX }}{COMMON_PART}" + echo "application name: application_name" + echo "powerBI URL: ${{ vars.VITE_POWERBI_EMBED_URL }}" + az webapp config appsettings set --name application_name --resource-group pslautomationbyoa5 --settings VITE_POWERBI_EMBED_URL=${{ vars.VITE_POWERBI_EMBED_URL }} # Restart App Service - az webapp restart --resource-group $resourceGroup --name $appServiceName + az webapp restart --resource-group pslautomationbyoa5 --name application_name # Check if the update was successful if [ $? -eq 0 ]; then echo "Power BI URL updated successfully." @@ -102,38 +90,38 @@ jobs: echo "Failed to update Power BI URL." fi - - name: Delete Bicep Deployment - if: ${{ success() && github.event_name != 'workflow_dispatch' }} - run: | - set -e - echo "Checking if resource group exists..." - rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) - if [ "$rg_exists" = "true" ]; then - echo "Resource group exist. Cleaning..." - az group delete \ - --name ${{ env.RESOURCE_GROUP_NAME }} \ - --yes \ - --no-wait - echo "Resource group deleted... ${{ env.RESOURCE_GROUP_NAME }}" - else - echo "Resource group does not exists." - fi + # - name: Delete Bicep Deployment + # if: success() + # run: | + # set -e + # echo "Checking if resource group exists..." + # rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) + # if [ "$rg_exists" = "true" ]; then + # echo "Resource group exist. Cleaning..." + # az group delete \ + # --name ${{ env.RESOURCE_GROUP_NAME }} \ + # --yes \ + # --no-wait + # echo "Resource group deleted... ${{ env.RESOURCE_GROUP_NAME }}" + # else + # echo "Resource group does not exists." + # fi - - name: Send Notification on Failure - if: failure() - run: | - RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + # - name: Send Notification on Failure + # if: failure() + # run: | + # RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" - # Construct the email body - EMAIL_BODY=$(cat <Dear Team,

We would like to inform you that the Client Advisor Automation process has encountered an issue and has failed to complete successfully.

Build URL: ${RUN_URL}
${OUTPUT}

Please investigate the matter at your earliest convenience.

Best regards,
Your Automation Team

" - } - EOF - ) + # # Construct the email body + # EMAIL_BODY=$(cat <Dear Team,

We would like to inform you that the Client Advisor Automation process has encountered an issue and has failed to complete successfully.

Build URL: ${RUN_URL}
${OUTPUT}

Please investigate the matter at your earliest convenience.

Best regards,
Your Automation Team

" + # } + # EOF + # ) - # Send the notification - curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ - -H "Content-Type: application/json" \ - -d "$EMAIL_BODY" || echo "Failed to send notification" + # # Send the notification + # curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ + # -H "Content-Type: application/json" \ + # -d "$EMAIL_BODY" || echo "Failed to send notification" diff --git a/ClientAdvisor/test2.txt b/ClientAdvisor/test3.txt similarity index 100% rename from ClientAdvisor/test2.txt rename to ClientAdvisor/test3.txt From 0760386a82ed07a5ff6e2c91a93c406bb5aec513 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Tue, 1 Oct 2024 11:24:29 +0530 Subject: [PATCH 134/163] testing automation flow --- .github/workflows/CAdeploy.yml | 2 +- ClientAdvisor/{test3.txt => test2.txt} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename ClientAdvisor/{test3.txt => test2.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 66495d89..85aaeb58 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -80,7 +80,7 @@ jobs: application_name="$${{ env.SOLUTION_PREFIX }}{COMMON_PART}" echo "application name: application_name" echo "powerBI URL: ${{ vars.VITE_POWERBI_EMBED_URL }}" - az webapp config appsettings set --name application_name --resource-group pslautomationbyoa5 --settings VITE_POWERBI_EMBED_URL=${{ vars.VITE_POWERBI_EMBED_URL }} + az webapp config appsettings set --name $application_name --resource-group pslautomationbyoa5 --settings VITE_POWERBI_EMBED_URL=${{ vars.VITE_POWERBI_EMBED_URL }} # Restart App Service az webapp restart --resource-group pslautomationbyoa5 --name application_name # Check if the update was successful diff --git a/ClientAdvisor/test3.txt b/ClientAdvisor/test2.txt similarity index 100% rename from ClientAdvisor/test3.txt rename to ClientAdvisor/test2.txt From 06cefcb6673218a26d0c78b1948519427c0b1041 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Tue, 1 Oct 2024 11:27:47 +0530 Subject: [PATCH 135/163] testing automation flow --- .github/workflows/CAdeploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 85aaeb58..9d283f9b 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -79,6 +79,7 @@ jobs: COMMON_PART="-app-service" application_name="$${{ env.SOLUTION_PREFIX }}{COMMON_PART}" echo "application name: application_name" + echo "application name:: $application_name" echo "powerBI URL: ${{ vars.VITE_POWERBI_EMBED_URL }}" az webapp config appsettings set --name $application_name --resource-group pslautomationbyoa5 --settings VITE_POWERBI_EMBED_URL=${{ vars.VITE_POWERBI_EMBED_URL }} # Restart App Service From 5dd6ad773b0835f517f623690c2357e288441a4a Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Tue, 1 Oct 2024 11:28:02 +0530 Subject: [PATCH 136/163] testing automation flow --- ClientAdvisor/{test2.txt => test3.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ClientAdvisor/{test2.txt => test3.txt} (100%) diff --git a/ClientAdvisor/test2.txt b/ClientAdvisor/test3.txt similarity index 100% rename from ClientAdvisor/test2.txt rename to ClientAdvisor/test3.txt From 064bcf7b5e72425a262c9238ddfe4e1ef849f6d3 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Tue, 1 Oct 2024 11:29:59 +0530 Subject: [PATCH 137/163] testing automation flow --- .github/workflows/CAdeploy.yml | 2 +- ClientAdvisor/{test3.txt => test13.txt} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename ClientAdvisor/{test3.txt => test13.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 9d283f9b..755c9a0d 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -77,7 +77,7 @@ jobs: run: | set -e COMMON_PART="-app-service" - application_name="$${{ env.SOLUTION_PREFIX }}{COMMON_PART}" + application_name="${{ env.SOLUTION_PREFIX }}${COMMON_PART}" echo "application name: application_name" echo "application name:: $application_name" echo "powerBI URL: ${{ vars.VITE_POWERBI_EMBED_URL }}" diff --git a/ClientAdvisor/test3.txt b/ClientAdvisor/test13.txt similarity index 100% rename from ClientAdvisor/test3.txt rename to ClientAdvisor/test13.txt From 12dd649c3e6949cc4ad654bf91ca5bdbe7fb59b0 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 4 Oct 2024 06:50:36 +0530 Subject: [PATCH 138/163] testing automation flow --- .github/workflows/RAdeploy.yml | 123 ++++++++++----------- ResearchAssistant/{test2.txt => test3.txt} | 0 2 files changed, 61 insertions(+), 62 deletions(-) rename ResearchAssistant/{test2.txt => test3.txt} (100%) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 3f4fea59..664b4d48 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -10,7 +10,6 @@ on: jobs: deploy: runs-on: ubuntu-latest - steps: - name: Checkout Code uses: actions/checkout@v3 @@ -20,75 +19,75 @@ jobs: curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash az --version # Verify installation - - name: Login to Azure - run: | - az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }} + # - name: Login to Azure + # run: | + # az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }} - - name: Install Bicep CLI - run: az bicep install + # - name: Install Bicep CLI + # run: az bicep install - - name: Generate Resource Group Name - id: generate_rg_name - run: | - echo "Generating a unique resource group name..." - TIMESTAMP=$(date +%Y%m%d%H%M%S) - COMMON_PART="pslautomationRes" - UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" - echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV - echo "Generated Resource_GROUP_PREFIX: ${UNIQUE_RG_NAME}" + # - name: Generate Resource Group Name + # id: generate_rg_name + # run: | + # echo "Generating a unique resource group name..." + # TIMESTAMP=$(date +%Y%m%d%H%M%S) + # COMMON_PART="pslautomationRes" + # UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" + # echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV + # echo "Generated Resource_GROUP_PREFIX: ${UNIQUE_RG_NAME}" - - name: Check and Create Resource Group - id: check_create_rg - run: | - set -e - echo "Checking if resource group exists..." - rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) - if [ "$rg_exists" = "false" ]; then - echo "Resource group does not exist. Creating..." - az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location eastus || { echo "Error creating resource group"; exit 1; } - else - echo "Resource group already exists." - fi + # - name: Check and Create Resource Group + # id: check_create_rg + # run: | + # set -e + # echo "Checking if resource group exists..." + # rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) + # if [ "$rg_exists" = "false" ]; then + # echo "Resource group does not exist. Creating..." + # az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location eastus || { echo "Error creating resource group"; exit 1; } + # else + # echo "Resource group already exists." + # fi - - name: Generate Unique Solution Prefix - id: generate_solution_prefix - run: | - set -e - COMMON_PART="pslr" - TIMESTAMP=$(date +%s) - UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3) - UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" - echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV - echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" + # - name: Generate Unique Solution Prefix + # id: generate_solution_prefix + # run: | + # set -e + # COMMON_PART="pslr" + # TIMESTAMP=$(date +%s) + # UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3) + # UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" + # echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV + # echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" - - name: Deploy Bicep Template - id: deploy - run: | - set -e - az deployment group create \ - --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ - --template-file ResearchAssistant/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} + # - name: Deploy Bicep Template + # id: deploy + # run: | + # set -e + # az deployment group create \ + # --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ + # --template-file ResearchAssistant/Deployment/bicep/main.bicep \ + # --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} - - name: Delete Bicep Deployment - if: success() - run: | - set -e - echo "Checking if resource group exists..." - rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) - if [ "$rg_exists" = "true" ]; then - echo "Resource group exist. Cleaning..." - az group delete \ - --name ${{ env.RESOURCE_GROUP_NAME }} \ - --yes \ - --no-wait - echo "Resource group deleted... ${{ env.RESOURCE_GROUP_NAME }}" - else - echo "Resource group does not exists." - fi + # - name: Delete Bicep Deployment + # if: success() + # run: | + # set -e + # echo "Checking if resource group exists..." + # rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) + # if [ "$rg_exists" = "true" ]; then + # echo "Resource group exist. Cleaning..." + # az group delete \ + # --name ${{ env.RESOURCE_GROUP_NAME }} \ + # --yes \ + # --no-wait + # echo "Resource group deleted... ${{ env.RESOURCE_GROUP_NAME }}" + # else + # echo "Resource group does not exists." + # fi - name: Send Notification on Failure - if: failure() + if: success() run: | RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" diff --git a/ResearchAssistant/test2.txt b/ResearchAssistant/test3.txt similarity index 100% rename from ResearchAssistant/test2.txt rename to ResearchAssistant/test3.txt From 3cad65b88bd234a561ca06bb641db73e005380af Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 4 Oct 2024 07:13:22 +0530 Subject: [PATCH 139/163] testing automation flow --- ResearchAssistant/{test3.txt => test4.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ResearchAssistant/{test3.txt => test4.txt} (100%) diff --git a/ResearchAssistant/test3.txt b/ResearchAssistant/test4.txt similarity index 100% rename from ResearchAssistant/test3.txt rename to ResearchAssistant/test4.txt From 312c4e1cdb9b41f9d9f20af549ace456352c92de Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 4 Oct 2024 09:57:45 +0530 Subject: [PATCH 140/163] testing automation flow --- .github/workflows/CAdeploy.yml | 40 ++++++++++++------------- ClientAdvisor/{test13.txt => test1.txt} | 0 2 files changed, 20 insertions(+), 20 deletions(-) rename ClientAdvisor/{test13.txt => test1.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 755c9a0d..45bd9b27 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -33,8 +33,8 @@ jobs: echo "Generating a unique resource group name..." TIMESTAMP=$(date +%Y%m%d%H%M%S) COMMON_PART="pslautomationCli" - # UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" - UNIQUE_RG_NAME="pslautomationbyoa5" + UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" + # UNIQUE_RG_NAME="pslautomationbyoa5" echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV echo "Generated RESOURCE_GROUP_PREFIX: ${UNIQUE_RG_NAME}" @@ -72,24 +72,24 @@ jobs: # --template-file ClientAdvisor/Deployment/bicep/main.bicep \ # --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} cosmosLocation=eastus2 - - name: Update PowerBI URL - if: success() - run: | - set -e - COMMON_PART="-app-service" - application_name="${{ env.SOLUTION_PREFIX }}${COMMON_PART}" - echo "application name: application_name" - echo "application name:: $application_name" - echo "powerBI URL: ${{ vars.VITE_POWERBI_EMBED_URL }}" - az webapp config appsettings set --name $application_name --resource-group pslautomationbyoa5 --settings VITE_POWERBI_EMBED_URL=${{ vars.VITE_POWERBI_EMBED_URL }} - # Restart App Service - az webapp restart --resource-group pslautomationbyoa5 --name application_name - # Check if the update was successful - if [ $? -eq 0 ]; then - echo "Power BI URL updated successfully." - else - echo "Failed to update Power BI URL." - fi + # - name: Update PowerBI URL + # if: success() + # run: | + # set -e + # COMMON_PART="-app-service" + # application_name="${{ env.SOLUTION_PREFIX }}${COMMON_PART}" + # echo "application name: application_name" + # echo "application name:: $application_name" + # echo "powerBI URL: ${{ vars.VITE_POWERBI_EMBED_URL }}" + # az webapp config appsettings set --name $application_name --resource-group pslautomationbyoa5 --settings VITE_POWERBI_EMBED_URL=${{ vars.VITE_POWERBI_EMBED_URL }} + # # Restart App Service + # az webapp restart --resource-group pslautomationbyoa5 --name application_name + # # Check if the update was successful + # if [ $? -eq 0 ]; then + # echo "Power BI URL updated successfully." + # else + # echo "Failed to update Power BI URL." + # fi # - name: Delete Bicep Deployment # if: success() diff --git a/ClientAdvisor/test13.txt b/ClientAdvisor/test1.txt similarity index 100% rename from ClientAdvisor/test13.txt rename to ClientAdvisor/test1.txt From fb1c4bb99e040e7ed6c4ec7b6d322dd00bc74591 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 4 Oct 2024 10:23:17 +0530 Subject: [PATCH 141/163] testing automation flow --- .github/workflows/CAdeploy.yml | 18 +++++++++--------- ClientAdvisor/{test1.txt => test13.txt} | 0 2 files changed, 9 insertions(+), 9 deletions(-) rename ClientAdvisor/{test1.txt => test13.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 45bd9b27..50cdaf0b 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -34,7 +34,7 @@ jobs: TIMESTAMP=$(date +%Y%m%d%H%M%S) COMMON_PART="pslautomationCli" UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" - # UNIQUE_RG_NAME="pslautomationbyoa5" + # UNIQUE_RG_NAME="pslautomationCli20241004042844" echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV echo "Generated RESOURCE_GROUP_PREFIX: ${UNIQUE_RG_NAME}" @@ -63,14 +63,14 @@ jobs: echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" - # - name: Deploy Bicep Template - # id: deploy - # run: | - # set -e - # az deployment group create \ - # --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ - # --template-file ClientAdvisor/Deployment/bicep/main.bicep \ - # --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} cosmosLocation=eastus2 + - name: Deploy Bicep Template + id: deploy + run: | + set -e + az deployment group create \ + --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ + --template-file ClientAdvisor/Deployment/bicep/main.bicep \ + --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} cosmosLocation=eastus2 # - name: Update PowerBI URL # if: success() diff --git a/ClientAdvisor/test1.txt b/ClientAdvisor/test13.txt similarity index 100% rename from ClientAdvisor/test1.txt rename to ClientAdvisor/test13.txt From c4310f547392942867d720c1f2e6d02a43740bd3 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 4 Oct 2024 10:58:05 +0530 Subject: [PATCH 142/163] testing automation flow --- .github/workflows/CAdeploy.yml | 74 ++++++++++++------------- ClientAdvisor/{test13.txt => test3.txt} | 0 2 files changed, 37 insertions(+), 37 deletions(-) rename ClientAdvisor/{test13.txt => test3.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 50cdaf0b..8270ba9d 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -33,8 +33,8 @@ jobs: echo "Generating a unique resource group name..." TIMESTAMP=$(date +%Y%m%d%H%M%S) COMMON_PART="pslautomationCli" - UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" - # UNIQUE_RG_NAME="pslautomationCli20241004042844" + # UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" + UNIQUE_RG_NAME="pslautomationCli20241004045433" echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV echo "Generated RESOURCE_GROUP_PREFIX: ${UNIQUE_RG_NAME}" @@ -52,44 +52,44 @@ jobs: echo "Resource group already exists." fi - - name: Generate Unique Solution Prefix - id: generate_solution_prefix - run: | - set -e - COMMON_PART="pslc" - TIMESTAMP=$(date +%s) - UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3) - UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" - echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV - echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" + # - name: Generate Unique Solution Prefix + # id: generate_solution_prefix + # run: | + # set -e + # COMMON_PART="pslc" + # TIMESTAMP=$(date +%s) + # UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3) + # UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" + # echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV + # echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" - - name: Deploy Bicep Template - id: deploy - run: | - set -e - az deployment group create \ - --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ - --template-file ClientAdvisor/Deployment/bicep/main.bicep \ - --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} cosmosLocation=eastus2 - - # - name: Update PowerBI URL - # if: success() + # - name: Deploy Bicep Template + # id: deploy # run: | # set -e - # COMMON_PART="-app-service" - # application_name="${{ env.SOLUTION_PREFIX }}${COMMON_PART}" - # echo "application name: application_name" - # echo "application name:: $application_name" - # echo "powerBI URL: ${{ vars.VITE_POWERBI_EMBED_URL }}" - # az webapp config appsettings set --name $application_name --resource-group pslautomationbyoa5 --settings VITE_POWERBI_EMBED_URL=${{ vars.VITE_POWERBI_EMBED_URL }} - # # Restart App Service - # az webapp restart --resource-group pslautomationbyoa5 --name application_name - # # Check if the update was successful - # if [ $? -eq 0 ]; then - # echo "Power BI URL updated successfully." - # else - # echo "Failed to update Power BI URL." - # fi + # az deployment group create \ + # --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ + # --template-file ClientAdvisor/Deployment/bicep/main.bicep \ + # --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} cosmosLocation=eastus2 + + - name: Update PowerBI URL + if: success() + run: | + set -e + COMMON_PART="-app-service" + application_name="${{ env.SOLUTION_PREFIX }}${COMMON_PART}" + echo "application name: application_name" + echo "application name:: $application_name" + echo "powerBI URL: ${{ vars.VITE_POWERBI_EMBED_URL }}" + az webapp config appsettings set --name $application_name --resource-group pslautomationCli20241004045433 --settings VITE_POWERBI_EMBED_URL=${{ vars.VITE_POWERBI_EMBED_URL }} + # Restart App Service + az webapp restart --resource-group pslautomationCli20241004045433 --name application_name + # Check if the update was successful + if [ $? -eq 0 ]; then + echo "Power BI URL updated successfully." + else + echo "Failed to update Power BI URL." + fi # - name: Delete Bicep Deployment # if: success() diff --git a/ClientAdvisor/test13.txt b/ClientAdvisor/test3.txt similarity index 100% rename from ClientAdvisor/test13.txt rename to ClientAdvisor/test3.txt From 4a3dae9e10e2024ae151a24b64c50dfb249d1fff Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 4 Oct 2024 11:18:00 +0530 Subject: [PATCH 143/163] testing automation flow --- .github/workflows/CAdeploy.yml | 21 +++++++++++---------- ClientAdvisor/{test3.txt => test13.txt} | 0 2 files changed, 11 insertions(+), 10 deletions(-) rename ClientAdvisor/{test3.txt => test13.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 8270ba9d..14a383ac 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -52,16 +52,17 @@ jobs: echo "Resource group already exists." fi - # - name: Generate Unique Solution Prefix - # id: generate_solution_prefix - # run: | - # set -e - # COMMON_PART="pslc" - # TIMESTAMP=$(date +%s) - # UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3) - # UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" - # echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV - # echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" + - name: Generate Unique Solution Prefix + id: generate_solution_prefix + run: | + set -e + COMMON_PART="pslc" + TIMESTAMP=$(date +%s) + UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3) + # UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" + UNIQUE_SOLUTION_PREFIX="pslc75" + echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV + echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" # - name: Deploy Bicep Template # id: deploy diff --git a/ClientAdvisor/test3.txt b/ClientAdvisor/test13.txt similarity index 100% rename from ClientAdvisor/test3.txt rename to ClientAdvisor/test13.txt From f2123be8424f4b1bad870ad34c1c421567c9f950 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 4 Oct 2024 15:57:10 +0530 Subject: [PATCH 144/163] testing automation flow --- .github/workflows/CAdeploy.yml | 59 ++++++++++++------------- ClientAdvisor/{test13.txt => test3.txt} | 0 2 files changed, 29 insertions(+), 30 deletions(-) rename ClientAdvisor/{test13.txt => test3.txt} (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 14a383ac..76cf1546 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -33,8 +33,8 @@ jobs: echo "Generating a unique resource group name..." TIMESTAMP=$(date +%Y%m%d%H%M%S) COMMON_PART="pslautomationCli" - # UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" - UNIQUE_RG_NAME="pslautomationCli20241004045433" + UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" + # UNIQUE_RG_NAME="pslautomationCli20241004045433" echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV echo "Generated RESOURCE_GROUP_PREFIX: ${UNIQUE_RG_NAME}" @@ -59,19 +59,19 @@ jobs: COMMON_PART="pslc" TIMESTAMP=$(date +%s) UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3) - # UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" - UNIQUE_SOLUTION_PREFIX="pslc75" + UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" + # UNIQUE_SOLUTION_PREFIX="pslc75" echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" - # - name: Deploy Bicep Template - # id: deploy - # run: | - # set -e - # az deployment group create \ - # --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ - # --template-file ClientAdvisor/Deployment/bicep/main.bicep \ - # --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} cosmosLocation=eastus2 + - name: Deploy Bicep Template + id: deploy + run: | + set -e + az deployment group create \ + --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ + --template-file ClientAdvisor/Deployment/bicep/main.bicep \ + --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} cosmosLocation=eastus2 - name: Update PowerBI URL if: success() @@ -79,12 +79,11 @@ jobs: set -e COMMON_PART="-app-service" application_name="${{ env.SOLUTION_PREFIX }}${COMMON_PART}" - echo "application name: application_name" echo "application name:: $application_name" echo "powerBI URL: ${{ vars.VITE_POWERBI_EMBED_URL }}" - az webapp config appsettings set --name $application_name --resource-group pslautomationCli20241004045433 --settings VITE_POWERBI_EMBED_URL=${{ vars.VITE_POWERBI_EMBED_URL }} + az webapp config appsettings set --name $application_name --resource-group ${{ env.RESOURCE_GROUP_NAME }} --settings VITE_POWERBI_EMBED_URL=${{ vars.VITE_POWERBI_EMBED_URL }} # Restart App Service - az webapp restart --resource-group pslautomationCli20241004045433 --name application_name + az webapp restart --resource-group ${{ env.RESOURCE_GROUP_NAME }} --name $application_name # Check if the update was successful if [ $? -eq 0 ]; then echo "Power BI URL updated successfully." @@ -109,21 +108,21 @@ jobs: # echo "Resource group does not exists." # fi - # - name: Send Notification on Failure - # if: failure() - # run: | - # RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + - name: Send Notification on Failure + if: failure() + run: | + RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" - # # Construct the email body - # EMAIL_BODY=$(cat <Dear Team,

We would like to inform you that the Client Advisor Automation process has encountered an issue and has failed to complete successfully.

Build URL: ${RUN_URL}
${OUTPUT}

Please investigate the matter at your earliest convenience.

Best regards,
Your Automation Team

" - # } - # EOF - # ) + # Construct the email body + EMAIL_BODY=$(cat <Dear Team,

We would like to inform you that the Client Advisor Automation process has encountered an issue and has failed to complete successfully.

Build URL: ${RUN_URL}
${OUTPUT}

Please investigate the matter at your earliest convenience.

Best regards,
Your Automation Team

" + } + EOF + ) - # # Send the notification - # curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ - # -H "Content-Type: application/json" \ - # -d "$EMAIL_BODY" || echo "Failed to send notification" + # Send the notification + curl -X POST "${{ secrets.LOGIC_APP_URL }}" \ + -H "Content-Type: application/json" \ + -d "$EMAIL_BODY" || echo "Failed to send notification" diff --git a/ClientAdvisor/test13.txt b/ClientAdvisor/test3.txt similarity index 100% rename from ClientAdvisor/test13.txt rename to ClientAdvisor/test3.txt From 84ed78f102b4ad8e9835a69e7a76f65011a6faa9 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 4 Oct 2024 16:32:38 +0530 Subject: [PATCH 145/163] testing automation flow --- .github/workflows/CAdeploy.yml | 56 ++++---- .github/workflows/RAdeploy.yml | 120 +++++++++--------- .../test4.txt | 0 .../test3.txt => ResearchAssistant/test2.txt | 0 4 files changed, 88 insertions(+), 88 deletions(-) rename {ResearchAssistant => ClientAdvisor}/test4.txt (100%) rename ClientAdvisor/test3.txt => ResearchAssistant/test2.txt (100%) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 76cf1546..1c2c57e4 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -34,7 +34,6 @@ jobs: TIMESTAMP=$(date +%Y%m%d%H%M%S) COMMON_PART="pslautomationCli" UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" - # UNIQUE_RG_NAME="pslautomationCli20241004045433" echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV echo "Generated RESOURCE_GROUP_PREFIX: ${UNIQUE_RG_NAME}" @@ -60,7 +59,6 @@ jobs: TIMESTAMP=$(date +%s) UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3) UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" - # UNIQUE_SOLUTION_PREFIX="pslc75" echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" @@ -77,36 +75,38 @@ jobs: if: success() run: | set -e + COMMON_PART="-app-service" application_name="${{ env.SOLUTION_PREFIX }}${COMMON_PART}" - echo "application name:: $application_name" - echo "powerBI URL: ${{ vars.VITE_POWERBI_EMBED_URL }}" - az webapp config appsettings set --name $application_name --resource-group ${{ env.RESOURCE_GROUP_NAME }} --settings VITE_POWERBI_EMBED_URL=${{ vars.VITE_POWERBI_EMBED_URL }} - # Restart App Service - az webapp restart --resource-group ${{ env.RESOURCE_GROUP_NAME }} --name $application_name - # Check if the update was successful - if [ $? -eq 0 ]; then - echo "Power BI URL updated successfully." + echo "Updating application: $application_name" + + # Log the Power BI URL being set + echo "Setting Power BI URL: ${{ vars.VITE_POWERBI_EMBED_URL }}" + + # Update the application settings + az webapp config appsettings set --name "$application_name" --resource-group "${{ env.RESOURCE_GROUP_NAME }}" --settings VITE_POWERBI_EMBED_URL="${{ vars.VITE_POWERBI_EMBED_URL }}" + + # Restart the web app + az webapp restart --resource-group "${{ env.RESOURCE_GROUP_NAME }}" --name "$application_name" + + echo "Power BI URL updated successfully for application: $application_name." + + - name: Delete Bicep Deployment + if: success() + run: | + set -e + echo "Checking if resource group exists..." + rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) + if [ "$rg_exists" = "true" ]; then + echo "Resource group exist. Cleaning..." + az group delete \ + --name ${{ env.RESOURCE_GROUP_NAME }} \ + --yes \ + --no-wait + echo "Resource group deleted... ${{ env.RESOURCE_GROUP_NAME }}" else - echo "Failed to update Power BI URL." + echo "Resource group does not exists." fi - - # - name: Delete Bicep Deployment - # if: success() - # run: | - # set -e - # echo "Checking if resource group exists..." - # rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) - # if [ "$rg_exists" = "true" ]; then - # echo "Resource group exist. Cleaning..." - # az group delete \ - # --name ${{ env.RESOURCE_GROUP_NAME }} \ - # --yes \ - # --no-wait - # echo "Resource group deleted... ${{ env.RESOURCE_GROUP_NAME }}" - # else - # echo "Resource group does not exists." - # fi - name: Send Notification on Failure if: failure() diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 664b4d48..00079d72 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -19,72 +19,72 @@ jobs: curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash az --version # Verify installation - # - name: Login to Azure - # run: | - # az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }} + - name: Login to Azure + run: | + az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }} - # - name: Install Bicep CLI - # run: az bicep install + - name: Install Bicep CLI + run: az bicep install - # - name: Generate Resource Group Name - # id: generate_rg_name - # run: | - # echo "Generating a unique resource group name..." - # TIMESTAMP=$(date +%Y%m%d%H%M%S) - # COMMON_PART="pslautomationRes" - # UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" - # echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV - # echo "Generated Resource_GROUP_PREFIX: ${UNIQUE_RG_NAME}" + - name: Generate Resource Group Name + id: generate_rg_name + run: | + echo "Generating a unique resource group name..." + TIMESTAMP=$(date +%Y%m%d%H%M%S) + COMMON_PART="pslautomationRes" + UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}" + echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV + echo "Generated Resource_GROUP_PREFIX: ${UNIQUE_RG_NAME}" - # - name: Check and Create Resource Group - # id: check_create_rg - # run: | - # set -e - # echo "Checking if resource group exists..." - # rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) - # if [ "$rg_exists" = "false" ]; then - # echo "Resource group does not exist. Creating..." - # az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location eastus || { echo "Error creating resource group"; exit 1; } - # else - # echo "Resource group already exists." - # fi + - name: Check and Create Resource Group + id: check_create_rg + run: | + set -e + echo "Checking if resource group exists..." + rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) + if [ "$rg_exists" = "false" ]; then + echo "Resource group does not exist. Creating..." + az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location eastus || { echo "Error creating resource group"; exit 1; } + else + echo "Resource group already exists." + fi - # - name: Generate Unique Solution Prefix - # id: generate_solution_prefix - # run: | - # set -e - # COMMON_PART="pslr" - # TIMESTAMP=$(date +%s) - # UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3) - # UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" - # echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV - # echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" + - name: Generate Unique Solution Prefix + id: generate_solution_prefix + run: | + set -e + COMMON_PART="pslr" + TIMESTAMP=$(date +%s) + UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3) + UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}" + echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV + echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}" - # - name: Deploy Bicep Template - # id: deploy - # run: | - # set -e - # az deployment group create \ - # --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ - # --template-file ResearchAssistant/Deployment/bicep/main.bicep \ - # --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} + - name: Deploy Bicep Template + id: deploy + run: | + set -e + az deployment group create \ + --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ + --template-file ResearchAssistant/Deployment/bicep/main.bicep \ + --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} - # - name: Delete Bicep Deployment - # if: success() - # run: | - # set -e - # echo "Checking if resource group exists..." - # rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) - # if [ "$rg_exists" = "true" ]; then - # echo "Resource group exist. Cleaning..." - # az group delete \ - # --name ${{ env.RESOURCE_GROUP_NAME }} \ - # --yes \ - # --no-wait - # echo "Resource group deleted... ${{ env.RESOURCE_GROUP_NAME }}" - # else - # echo "Resource group does not exists." - # fi + - name: Delete Bicep Deployment + if: success() + run: | + set -e + echo "Checking if resource group exists..." + rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) + if [ "$rg_exists" = "true" ]; then + echo "Resource group exist. Cleaning..." + az group delete \ + --name ${{ env.RESOURCE_GROUP_NAME }} \ + --yes \ + --no-wait + echo "Resource group deleted... ${{ env.RESOURCE_GROUP_NAME }}" + else + echo "Resource group does not exists." + fi - name: Send Notification on Failure if: success() diff --git a/ResearchAssistant/test4.txt b/ClientAdvisor/test4.txt similarity index 100% rename from ResearchAssistant/test4.txt rename to ClientAdvisor/test4.txt diff --git a/ClientAdvisor/test3.txt b/ResearchAssistant/test2.txt similarity index 100% rename from ClientAdvisor/test3.txt rename to ResearchAssistant/test2.txt From 7e0106cb9a2a1cbd080616f740e3fccc39229db2 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 4 Oct 2024 16:56:54 +0530 Subject: [PATCH 146/163] testing automation flow --- .github/workflows/RAdeploy.yml | 2 +- ResearchAssistant/{test2.txt => test1.txt} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename ResearchAssistant/{test2.txt => test1.txt} (100%) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 00079d72..0e9d2457 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -44,7 +44,7 @@ jobs: rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }}) if [ "$rg_exists" = "false" ]; then echo "Resource group does not exist. Creating..." - az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location eastus || { echo "Error creating resource group"; exit 1; } + az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location eastus2 || { echo "Error creating resource group"; exit 1; } else echo "Resource group already exists." fi diff --git a/ResearchAssistant/test2.txt b/ResearchAssistant/test1.txt similarity index 100% rename from ResearchAssistant/test2.txt rename to ResearchAssistant/test1.txt From cf348b8419b59fbd17b9e76a68d9af1801d99884 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 4 Oct 2024 18:36:54 +0530 Subject: [PATCH 147/163] testing automation flow --- .github/workflows/RAdeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 0e9d2457..a3ee809c 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -87,7 +87,7 @@ jobs: fi - name: Send Notification on Failure - if: success() + if: failure() run: | RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" From 0ac38e7849b5071078c49bceaa4f38f69ed84b34 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Mon, 7 Oct 2024 16:35:32 +0530 Subject: [PATCH 148/163] modify code --- .github/workflows/CAdeploy.yml | 2 +- .github/workflows/RAdeploy.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index 1c2c57e4..9dc156ed 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -1,4 +1,4 @@ -name: Deploy Azure Resources:ClientAdvisior +name: CI-Validate Deployment-Client Advisor on: push: diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index a3ee809c..61bdf0e7 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -1,4 +1,4 @@ -name: Deploy Azure Resources:ResearchAssitent +name: CI-Validate Deployment-Research Assistant on: push: From ef77694ed9d2e6e7b8693096d0708d68db0dc78b Mon Sep 17 00:00:00 2001 From: Rohini-Microsoft Date: Mon, 7 Oct 2024 19:01:35 +0530 Subject: [PATCH 149/163] added accessibility changes --- .../App/frontend/src/components/Cards/Cards.tsx | 7 +++++++ .../ChatHistory/ChatHistoryPanel.module.css | 8 ++++++++ .../src/components/ChatHistory/ChatHistoryPanel.tsx | 2 +- .../src/components/common/Button.module.css | 1 + .../App/frontend/src/pages/chat/Chat.module.css | 2 +- ClientAdvisor/App/frontend/src/pages/chat/Chat.tsx | 2 +- .../App/frontend/src/pages/layout/Layout.tsx | 13 +++++++++---- .../App/frontend/src/state/AppProvider.tsx | 3 ++- ClientAdvisor/App/frontend/src/state/AppReducer.tsx | 2 ++ 9 files changed, 32 insertions(+), 8 deletions(-) diff --git a/ClientAdvisor/App/frontend/src/components/Cards/Cards.tsx b/ClientAdvisor/App/frontend/src/components/Cards/Cards.tsx index 99a95abd..a935363f 100644 --- a/ClientAdvisor/App/frontend/src/components/Cards/Cards.tsx +++ b/ClientAdvisor/App/frontend/src/components/Cards/Cards.tsx @@ -17,6 +17,13 @@ const Cards: React.FC = ({ onCardClick }) => { const [selectedClientId, setSelectedClientId] = useState(null); const [loadingUsers, setLoadingUsers] = useState(true); + + useEffect(() => { + if(selectedClientId != null && appStateContext?.state.clientId == ''){ + setSelectedClientId('') + } + },[appStateContext?.state.clientId]); + useEffect(() => { const fetchUsers = async () => { try { diff --git a/ClientAdvisor/App/frontend/src/components/ChatHistory/ChatHistoryPanel.module.css b/ClientAdvisor/App/frontend/src/components/ChatHistory/ChatHistoryPanel.module.css index 784838fe..abb30159 100644 --- a/ClientAdvisor/App/frontend/src/components/ChatHistory/ChatHistoryPanel.module.css +++ b/ClientAdvisor/App/frontend/src/components/ChatHistory/ChatHistoryPanel.module.css @@ -77,3 +77,11 @@ width: 100%; } } + +@media screen and (-ms-high-contrast: active), (forced-colors: active) { + .container{ + border: 2px solid WindowText; + background-color: Window; + color: WindowText; + } +} \ No newline at end of file diff --git a/ClientAdvisor/App/frontend/src/components/ChatHistory/ChatHistoryPanel.tsx b/ClientAdvisor/App/frontend/src/components/ChatHistory/ChatHistoryPanel.tsx index 7a23f4d5..3232293f 100644 --- a/ClientAdvisor/App/frontend/src/components/ChatHistory/ChatHistoryPanel.tsx +++ b/ClientAdvisor/App/frontend/src/components/ChatHistory/ChatHistoryPanel.tsx @@ -111,7 +111,7 @@ export function ChatHistoryPanel(_props: ChatHistoryPanelProps) { {

{ui?.chat_title}

-

{ui?.chat_description}

+

{ui?.chat_description}

) : (
diff --git a/ClientAdvisor/App/frontend/src/pages/layout/Layout.tsx b/ClientAdvisor/App/frontend/src/pages/layout/Layout.tsx index 272576fe..3c650d07 100644 --- a/ClientAdvisor/App/frontend/src/pages/layout/Layout.tsx +++ b/ClientAdvisor/App/frontend/src/pages/layout/Layout.tsx @@ -52,6 +52,11 @@ const Layout = () => { fetchpbi() }, []) + const resetClientId= ()=>{ + appStateContext?.dispatch({ type: 'RESET_CLIENT_ID' }); + setSelectedUser(null); + setShowWelcomeCard(true); + } const closePopup = () => { setIsVisible(!isVisible); @@ -157,7 +162,7 @@ const Layout = () => { />
-

Upcoming meetings

+

Upcoming meetings

@@ -167,9 +172,9 @@ const Layout = () => { - -

{ui?.title}

- +
(e.key === 'Enter' || e.key === ' ' ? resetClientId() : null)} tabIndex={-1}> +

{ui?.title}

+
{appStateContext?.state.isCosmosDBAvailable?.status !== CosmosDBStatus.NotConfigured && ( diff --git a/ClientAdvisor/App/frontend/src/state/AppProvider.tsx b/ClientAdvisor/App/frontend/src/state/AppProvider.tsx index d0166462..2ae54afe 100644 --- a/ClientAdvisor/App/frontend/src/state/AppProvider.tsx +++ b/ClientAdvisor/App/frontend/src/state/AppProvider.tsx @@ -51,7 +51,8 @@ export type Action = | { type: 'GET_FEEDBACK_STATE'; payload: string } | { type: 'UPDATE_CLIENT_ID'; payload: string } | { type: 'SET_IS_REQUEST_INITIATED'; payload: boolean } - | { type: 'TOGGLE_LOADER' }; + | { type: 'TOGGLE_LOADER' } + | { type: 'RESET_CLIENT_ID'}; const initialState: AppState = { isChatHistoryOpen: false, diff --git a/ClientAdvisor/App/frontend/src/state/AppReducer.tsx b/ClientAdvisor/App/frontend/src/state/AppReducer.tsx index 21a126da..03a778cc 100644 --- a/ClientAdvisor/App/frontend/src/state/AppReducer.tsx +++ b/ClientAdvisor/App/frontend/src/state/AppReducer.tsx @@ -80,6 +80,8 @@ export const appStateReducer = (state: AppState, action: Action): AppState => { return {...state, isRequestInitiated : action.payload} case 'TOGGLE_LOADER': return {...state, isLoader : !state.isLoader} + case 'RESET_CLIENT_ID': + return {...state, clientId: ''} default: return state } From 433da7268efd36bf1d8c9941a4c9ac39dbb56123 Mon Sep 17 00:00:00 2001 From: Roopan-Microsoft <168007406+Roopan-Microsoft@users.noreply.github.com> Date: Mon, 7 Oct 2024 23:51:07 +0530 Subject: [PATCH 150/163] Create codeql.yml --- .github/workflows/codeql.yml | 94 ++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..5f6ba622 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,94 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL Advanced" + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + schedule: + - cron: '22 13 * * 0' + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + # Runner size impacts CodeQL analysis time. To learn more, please see: + # - https://gh.io/recommended-hardware-resources-for-running-codeql + # - https://gh.io/supported-runners-and-hardware-resources + # - https://gh.io/using-larger-runners (GitHub.com only) + # Consider using larger runners or machines with greater resources for possible analysis time improvements. + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + permissions: + # required for all workflows + security-events: write + + # required to fetch internal or private CodeQL packs + packages: read + + # only required for workflows in private repositories + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + include: + - language: javascript-typescript + build-mode: none + - language: python + build-mode: none + # CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' + # Use `c-cpp` to analyze code written in C, C++ or both + # Use 'java-kotlin' to analyze code written in Java, Kotlin or both + # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both + # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, + # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. + # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how + # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + # If the analyze step fails for one of the languages you are analyzing with + # "We were unable to automatically build your code", modify the matrix above + # to set the build mode to "manual" for that language. Then modify this step + # to build your code. + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + - if: matrix.build-mode == 'manual' + shell: bash + run: | + echo 'If you are using a "manual" build mode for one or more of the' \ + 'languages you are analyzing, replace this with the commands to build' \ + 'your code, for example:' + echo ' make bootstrap' + echo ' make release' + exit 1 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" From 16fd5bd98da73373842d36f1bfe34573eee8bb4d Mon Sep 17 00:00:00 2001 From: Roopan-Microsoft <168007406+Roopan-Microsoft@users.noreply.github.com> Date: Mon, 7 Oct 2024 23:54:38 +0530 Subject: [PATCH 151/163] Create label.yml --- .github/workflows/label.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/label.yml diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml new file mode 100644 index 00000000..46135690 --- /dev/null +++ b/.github/workflows/label.yml @@ -0,0 +1,22 @@ +# This workflow will triage pull requests and apply a label based on the +# paths that are modified in the pull request. +# +# To use this workflow, you will need to set up a .github/labeler.yml +# file with configuration. For more information, see: +# https://github.com/actions/labeler + +name: Labeler +on: [pull_request_target] + +jobs: + label: + + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + + steps: + - uses: actions/labeler@v4 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" From 8b0b22a862c7658a6df874c115f1b74b5da0373a Mon Sep 17 00:00:00 2001 From: Roopan P M Date: Tue, 8 Oct 2024 00:12:00 +0530 Subject: [PATCH 152/163] Bicep updated to point dev for client advisor --- ClientAdvisor/Deployment/bicep/main.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ClientAdvisor/Deployment/bicep/main.bicep b/ClientAdvisor/Deployment/bicep/main.bicep index 4a367089..6c0f3a29 100644 --- a/ClientAdvisor/Deployment/bicep/main.bicep +++ b/ClientAdvisor/Deployment/bicep/main.bicep @@ -18,7 +18,7 @@ var resourceGroupName = resourceGroup().name var solutionLocation = resourceGroupLocation var baseUrl = 'https://raw.githubusercontent.com/Roopan-Microsoft/psl-byo-main/main/ClientAdvisor/' -var functionAppversion = 'latest' +var functionAppversion = 'dev' // ========== Managed Identity ========== // module managedIdentityModule 'deploy_managed_identity.bicep' = { From 0ea3a9fc962caa3516a0a6923429fbcbde907de2 Mon Sep 17 00:00:00 2001 From: Roopan P M Date: Tue, 8 Oct 2024 00:14:56 +0530 Subject: [PATCH 153/163] main json updated --- ClientAdvisor/Deployment/bicep/main.json | 6 +++--- ResearchAssistant/Deployment/bicep/main.bicep | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ClientAdvisor/Deployment/bicep/main.json b/ClientAdvisor/Deployment/bicep/main.json index b8f5f5e1..6f50a220 100644 --- a/ClientAdvisor/Deployment/bicep/main.json +++ b/ClientAdvisor/Deployment/bicep/main.json @@ -5,7 +5,7 @@ "_generator": { "name": "bicep", "version": "0.29.47.4906", - "templateHash": "7603870024060537115" + "templateHash": "5062834210065422729" } }, "parameters": { @@ -28,8 +28,8 @@ "resourceGroupLocation": "[resourceGroup().location]", "resourceGroupName": "[resourceGroup().name]", "solutionLocation": "[variables('resourceGroupLocation')]", - "baseUrl": "https://raw.githubusercontent.com/Roopan-Microsoft/rp0907/main/ClientAdvisor/", - "functionAppversion": "latest" + "baseUrl": "https://raw.githubusercontent.com/Roopan-Microsoft/psl-byo-main/main/ClientAdvisor/", + "functionAppversion": "dev" }, "resources": [ { diff --git a/ResearchAssistant/Deployment/bicep/main.bicep b/ResearchAssistant/Deployment/bicep/main.bicep index c81d1962..ea5f564c 100644 --- a/ResearchAssistant/Deployment/bicep/main.bicep +++ b/ResearchAssistant/Deployment/bicep/main.bicep @@ -14,7 +14,7 @@ var resourceGroupName = resourceGroup().name var subscriptionId = subscription().subscriptionId var solutionLocation = resourceGroupLocation -var baseUrl = 'https://raw.githubusercontent.com/microsoft/Build-your-own-copilot-Solution-Accelerator/main/' +var baseUrl = 'https://raw.githubusercontent.com/Roopan-Microsoft/Build-your-own-copilot-Solution-Accelerator/main/' // ========== Managed Identity ========== // module managedIdentityModule 'deploy_managed_identity.bicep' = { From 8f9909add81c293c8bca86f1535ec8901af94f6c Mon Sep 17 00:00:00 2001 From: Roopan P M Date: Tue, 8 Oct 2024 00:40:22 +0530 Subject: [PATCH 154/163] Bicep updated --- .../Deployment/bicep/deploy_app_service.bicep | 2 +- ResearchAssistant/Deployment/bicep/main.json | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ResearchAssistant/Deployment/bicep/deploy_app_service.bicep b/ResearchAssistant/Deployment/bicep/deploy_app_service.bicep index 69bc0c1e..f733d9f0 100644 --- a/ResearchAssistant/Deployment/bicep/deploy_app_service.bicep +++ b/ResearchAssistant/Deployment/bicep/deploy_app_service.bicep @@ -162,7 +162,7 @@ param AIStudioDraftFlowDeploymentName string = '' param AIStudioUse string = 'False' -var WebAppImageName = 'DOCKER|byoaiacontainerreg.azurecr.io/byoaia-app:latest' +var WebAppImageName = 'DOCKER|byoaiacontainerreg.azurecr.io/byoaia-app:dev' resource HostingPlan 'Microsoft.Web/serverfarms@2020-06-01' = { name: HostingPlanName diff --git a/ResearchAssistant/Deployment/bicep/main.json b/ResearchAssistant/Deployment/bicep/main.json index 6d4cacd0..a64e3bfd 100644 --- a/ResearchAssistant/Deployment/bicep/main.json +++ b/ResearchAssistant/Deployment/bicep/main.json @@ -5,7 +5,7 @@ "_generator": { "name": "bicep", "version": "0.29.47.4906", - "templateHash": "7163812400877459703" + "templateHash": "10711406236308727919" } }, "parameters": { @@ -23,7 +23,7 @@ "resourceGroupName": "[resourceGroup().name]", "subscriptionId": "[subscription().subscriptionId]", "solutionLocation": "[variables('resourceGroupLocation')]", - "baseUrl": "https://raw.githubusercontent.com/microsoft/Build-your-own-copilot-Solution-Accelerator/main/" + "baseUrl": "https://raw.githubusercontent.com/Roopan-Microsoft/Build-your-own-copilot-Solution-Accelerator/main/" }, "resources": [ { @@ -1508,7 +1508,7 @@ "_generator": { "name": "bicep", "version": "0.29.47.4906", - "templateHash": "7109834445090495169" + "templateHash": "1558876662595106054" } }, "parameters": { @@ -1878,7 +1878,7 @@ } }, "variables": { - "WebAppImageName": "DOCKER|byoaiacontainerreg.azurecr.io/byoaia-app:latest" + "WebAppImageName": "DOCKER|byoaiacontainerreg.azurecr.io/byoaia-app:dev" }, "resources": [ { From f188e8a37764d6ff7ffd34b8e4005ac5dee70043 Mon Sep 17 00:00:00 2001 From: Roopan P M Date: Tue, 8 Oct 2024 00:43:59 +0530 Subject: [PATCH 155/163] label yml removed --- .github/workflows/label.yml | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 .github/workflows/label.yml diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml deleted file mode 100644 index 46135690..00000000 --- a/.github/workflows/label.yml +++ /dev/null @@ -1,22 +0,0 @@ -# This workflow will triage pull requests and apply a label based on the -# paths that are modified in the pull request. -# -# To use this workflow, you will need to set up a .github/labeler.yml -# file with configuration. For more information, see: -# https://github.com/actions/labeler - -name: Labeler -on: [pull_request_target] - -jobs: - label: - - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: write - - steps: - - uses: actions/labeler@v4 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" From d6126ec02017296dcdd47e56061c217ac73efb0d Mon Sep 17 00:00:00 2001 From: Roopan-Microsoft <168007406+Roopan-Microsoft@users.noreply.github.com> Date: Tue, 8 Oct 2024 00:45:16 +0530 Subject: [PATCH 156/163] Create label.yml --- .github/workflows/label.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/label.yml diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml new file mode 100644 index 00000000..46135690 --- /dev/null +++ b/.github/workflows/label.yml @@ -0,0 +1,22 @@ +# This workflow will triage pull requests and apply a label based on the +# paths that are modified in the pull request. +# +# To use this workflow, you will need to set up a .github/labeler.yml +# file with configuration. For more information, see: +# https://github.com/actions/labeler + +name: Labeler +on: [pull_request_target] + +jobs: + label: + + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + + steps: + - uses: actions/labeler@v4 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" From 94112e8e79302a5d491b832ebb36da2ab8aa5578 Mon Sep 17 00:00:00 2001 From: Roopan P M Date: Tue, 8 Oct 2024 00:48:58 +0530 Subject: [PATCH 157/163] labeler moved --- .github/{workflows/label.yml => labeler.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{workflows/label.yml => labeler.yml} (100%) diff --git a/.github/workflows/label.yml b/.github/labeler.yml similarity index 100% rename from .github/workflows/label.yml rename to .github/labeler.yml From e60f18e6c44260bfcb15b4889535ea8be303dd05 Mon Sep 17 00:00:00 2001 From: Roopan P M Date: Tue, 8 Oct 2024 00:51:00 +0530 Subject: [PATCH 158/163] deleted labeler yml --- .github/labeler.yml | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 .github/labeler.yml diff --git a/.github/labeler.yml b/.github/labeler.yml deleted file mode 100644 index 46135690..00000000 --- a/.github/labeler.yml +++ /dev/null @@ -1,22 +0,0 @@ -# This workflow will triage pull requests and apply a label based on the -# paths that are modified in the pull request. -# -# To use this workflow, you will need to set up a .github/labeler.yml -# file with configuration. For more information, see: -# https://github.com/actions/labeler - -name: Labeler -on: [pull_request_target] - -jobs: - label: - - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: write - - steps: - - uses: actions/labeler@v4 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" From dab0d43b2433d64977c6385c7793e0c28848ba84 Mon Sep 17 00:00:00 2001 From: Roopan-Microsoft <168007406+Roopan-Microsoft@users.noreply.github.com> Date: Tue, 8 Oct 2024 00:52:18 +0530 Subject: [PATCH 159/163] Create pylint.yml --- .github/workflows/pylint.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/pylint.yml diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml new file mode 100644 index 00000000..c73e032c --- /dev/null +++ b/.github/workflows/pylint.yml @@ -0,0 +1,23 @@ +name: Pylint + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10"] + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pylint + - name: Analysing the code with pylint + run: | + pylint $(git ls-files '*.py') From 0cf1f6c4a1be52614b315db32f1bb3062e57a4a5 Mon Sep 17 00:00:00 2001 From: Roopan-Microsoft <168007406+Roopan-Microsoft@users.noreply.github.com> Date: Tue, 8 Oct 2024 00:53:16 +0530 Subject: [PATCH 160/163] Create eslint.yml --- .github/workflows/eslint.yml | 52 ++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/eslint.yml diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml new file mode 100644 index 00000000..c4d6d6b1 --- /dev/null +++ b/.github/workflows/eslint.yml @@ -0,0 +1,52 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# ESLint is a tool for identifying and reporting on patterns +# found in ECMAScript/JavaScript code. +# More details at https://github.com/eslint/eslint +# and https://eslint.org + +name: ESLint + +on: + push: + branches: [ "main" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "main" ] + schedule: + - cron: '43 7 * * 5' + +jobs: + eslint: + name: Run eslint scanning + runs-on: ubuntu-latest + permissions: + contents: read + security-events: write + actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install ESLint + run: | + npm install eslint@8.10.0 + npm install @microsoft/eslint-formatter-sarif@3.1.0 + + - name: Run ESLint + env: + SARIF_ESLINT_IGNORE_SUPPRESSED: "true" + run: npx eslint . + --config .eslintrc.js + --ext .js,.jsx,.ts,.tsx + --format @microsoft/eslint-formatter-sarif + --output-file eslint-results.sarif + continue-on-error: true + + - name: Upload analysis results to GitHub + uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: eslint-results.sarif + wait-for-processing: true From a59fa5afbb8c2ccbe0e09f3fcb3266315e65f18e Mon Sep 17 00:00:00 2001 From: Harmanpreet-Microsoft Date: Wed, 9 Oct 2024 10:19:25 +0530 Subject: [PATCH 161/163] Update function_app.py regarding the system message --- ClientAdvisor/AzureFunction/function_app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ClientAdvisor/AzureFunction/function_app.py b/ClientAdvisor/AzureFunction/function_app.py index aaa3ed95..14a93fdc 100644 --- a/ClientAdvisor/AzureFunction/function_app.py +++ b/ClientAdvisor/AzureFunction/function_app.py @@ -277,7 +277,7 @@ async def stream_openai_text(req: Request) -> StreamingResponse: system_message = '''you are a helpful assistant to a wealth advisor. Do not answer any questions not related to wealth advisors queries. - If the client name and client id do not match, only return - Please only ask questions about the selected client or select another client to inquire about their details. do not return any other information. + **If the client name in the question does not match the selected client's name**, always return: "Please ask questions only about the selected client." Do not provide any other information. Only use the client name returned from database in the response. Always consider to give selected client full name only in response and do not use other example names also consider my client means currently selected client. If you cannot answer the question, always return - I cannot answer this question from the data available. Please rephrase or add more details. From e385d634403a81a2786fc758cd82962d683fbdac Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 11 Oct 2024 11:56:57 +0530 Subject: [PATCH 162/163] deleted test files --- ClientAdvisor/test4.txt | 0 ResearchAssistant/test1.txt | 0 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 ClientAdvisor/test4.txt delete mode 100644 ResearchAssistant/test1.txt diff --git a/ClientAdvisor/test4.txt b/ClientAdvisor/test4.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/ResearchAssistant/test1.txt b/ResearchAssistant/test1.txt deleted file mode 100644 index e69de29b..00000000 From 08de05ae36890d6b6411343f56668f4e8fadb7c7 Mon Sep 17 00:00:00 2001 From: Prashant-Microsoft Date: Fri, 11 Oct 2024 14:29:16 +0530 Subject: [PATCH 163/163] removed eslint file --- .github/workflows/eslint.yml | 52 ------------------------------------ 1 file changed, 52 deletions(-) delete mode 100644 .github/workflows/eslint.yml diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml deleted file mode 100644 index c4d6d6b1..00000000 --- a/.github/workflows/eslint.yml +++ /dev/null @@ -1,52 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# ESLint is a tool for identifying and reporting on patterns -# found in ECMAScript/JavaScript code. -# More details at https://github.com/eslint/eslint -# and https://eslint.org - -name: ESLint - -on: - push: - branches: [ "main" ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ "main" ] - schedule: - - cron: '43 7 * * 5' - -jobs: - eslint: - name: Run eslint scanning - runs-on: ubuntu-latest - permissions: - contents: read - security-events: write - actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install ESLint - run: | - npm install eslint@8.10.0 - npm install @microsoft/eslint-formatter-sarif@3.1.0 - - - name: Run ESLint - env: - SARIF_ESLINT_IGNORE_SUPPRESSED: "true" - run: npx eslint . - --config .eslintrc.js - --ext .js,.jsx,.ts,.tsx - --format @microsoft/eslint-formatter-sarif - --output-file eslint-results.sarif - continue-on-error: true - - - name: Upload analysis results to GitHub - uses: github/codeql-action/upload-sarif@v3 - with: - sarif_file: eslint-results.sarif - wait-for-processing: true