Open ArunEPRO opened 1 year ago
If you just want to update indexes, you can run the script:
.\scripts\prepdocs.ps1
I understand you mean data folder as indexes. Yes ".\scripts\prepdocs.ps1" can be used for updating the data.
I need to make a change to the UI or prompt. azd up is not a very good solution as it incurs me additional cost by reuploading all data.
Is there an option for that ?
You can comment out the hook in the azure.yaml
to stop azd up
from reuploading on every frontend/backend change that you want to deploy.
name: azure-search-openai-demo
metadata:
template: azure-search-openai-demo@0.0.2-beta
services:
backend:
project: ./app/backend
language: py
host: appservice
hooks:
prepackage:
windows:
shell: pwsh
run: cd ../frontend;npm install;npm run build
interactive: true
continueOnError: false
posix:
shell: sh
run: cd ../frontend;npm install;npm run build
interactive: true
continueOnError: false
# hooks:
# postprovision:
# windows:
# shell: pwsh
# run: ./scripts/prepdocs.ps1
# interactive: true
# continueOnError: false
# posix:
# shell: sh
# run: ./scripts/prepdocs.sh
# interactive: true
# continueOnError: false
Another option, if you haven't changed any of the infra/ Bicep files, is to just run azd deploy
. That will first run the prepackage hook, but it wont run the postprovision hook.
Here's what it looks like for me:
vscode ➜ /workspaces/azure-search-openai-demo (main) $ azd deploy
Deploying services (azd deploy)
| | Deploying service backendExecuting prepackage hook => /tmp/azd-prepackage-2644389450.sh
|=== | Deploying service backend(##################) ⠇ reify:@esbuild/android-arm: timing reifyNode:node_modul
|==== | Deploying service backend(##################) ⠇ reify:@esbuild/android-arm: timing reifyNode:node_modul
up to date, audited 124 packages in 586ms
10 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
|===== | Deploying service backend
> frontend@0.0.0 build
> tsc && vite build
|=======| Deploying service backendvite v4.1.1 building for production...
✓ 1250 modules transformed.
../backend/static/index.html 0.47 kB
../backend/static/assets/github-fab00c2d.svg 0.96 kB
../backend/static/assets/index-2fb53ec2.css 7.44 kB │ gzip: 2.19 kB
../backend/static/assets/index-7abdfda7.js 625.74 kB │ gzip: 204.87 kB │ map: 5,054.95 kB
(!) Some chunks are larger than 500 kBs after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
(✓) Done: Deploying service backend
- Endpoint: https://app-backend-randomid.azurewebsites.net/
SUCCESS: Your Azure app has been deployed!
You can view the resources created under the resource group rg-openai-search in Azure Portal:
https://portal.azure.com/#@/resource/subscriptions/32ea8a26-5b40-4838-b6cb-be5c89a57c16/resourceGroups/rg-openai-search/overview
@pamelafox - thanks and it sounds to be promising. More details about azd deploy were not found in the GitHub as well as cli.
Will a new URL be created for accessing the front end or will it overwrite the existing files in AppService?
You can learn more about azd and its various commands here: https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/overview
It will be the same URL, it just re-deploys the files and restarts the App Service.
@pamelafox azd deploy is great for deploying backend code, however does not seem to deploy the UI code - e.g. under the frontend folder.
e.g. When I run AZD deploy if I have made changes to the pages>layout>layout.tsx file, I cannot see that change on the cloud based deployment.
I can see the change locally by using start.sh
Am I not understanding, or is there a way to also deploy the "frontend" changes as well as the "backend" changes with azd deploy?
It should deploy both, due to the prepackage scripts in azure.yaml:
services:
backend:
project: ./app/backend
language: py
host: appservice
hooks:
prepackage:
windows:
shell: pwsh
run: cd ../frontend;npm install;npm run build
interactive: true
continueOnError: false
posix:
shell: sh
run: cd ../frontend;npm install;npm run build
interactive: true
continueOnError: false
npm run build will generate the static folder which is then used by the backend. Do you not see the packaging step running when you deploy?
@pamelafox - yes sorry - silly on my behalf - realised my mistake thanks for helping me.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this issue will be closed.
Anyone tried to deploy only front end ? Does it work? Please share inputs and procedure
This issue is for a: (mark with an
x
)Minimal steps to reproduce
Any log messages given by the failure
Expected/desired behavior
OS and Version?
azd version?