OfficeDev / TeamsFx

Developer tools for building Teams apps
Other
427 stars 165 forks source link

after upgrade to version 5, impossible to deploy updates #8926

Closed christophemacabiau closed 11 months ago

christophemacabiau commented 11 months ago

Describe the bug after upgrade to version 5, impossible to deploy updates

**To Reproduce*** It's very strange, I change my code, I can see the update in local, but when I deploy I am stuck to an old version of the code (the manifest version is updated) Do you have any idea?

ghost commented 11 months ago

Thank you for contacting us! Any issue or feedback from you is quite important to us. We will do our best to fully respond to your issue as soon as possible. Sometimes additional investigations may be needed, we will usually get back to you within 2 days by adding comments to this issue. Please stay tuned.

xzf0587 commented 11 months ago

Hi @christophemacabiau, Thanks for reaching out. From the information above, it seems you had run the provision and deploy commands successfully. However, the code deployed to cloud resource is not up-to-date. Is that right? Please provide the folder structure of project and the deploy section content of "teamsapp.yml" to help our investigation. Thanks for your information again. Looking forward to your reply.

christophemacabiau commented 11 months ago

Thanks @xzf0587 for your support. Yes it's exact provisioned deployed and published apparently correctly.

The folder structure: image

teamsapp.yml:

# yaml-language-server: $schema=https://aka.ms/teams-toolkit/1.0.0/yaml.schema.json
# Visit https://aka.ms/teamsfx-v5.0-guide for details on this file
# Visit https://aka.ms/teamsfx-actions for details on actions
version: 1.0.0

projectId: 986feb4d-c78f-4a22-b027-7b6be5d47f94

environmentFolderPath: ./env

# Triggered when 'teamsfx provision' is executed
provision:
  # Creates a new Azure Active Directory (AAD) app to authenticate users if
  # the environment variable that stores clientId is empty
  - uses: aadApp/create
    with:
      # Note: when you run aadApp/update, the AAD app name will be updated
      # based on the definition in manifest. If you don't want to change the
      # name, make sure the name in AAD manifest is the same with the name
      # defined here.
      name: ${{CONFIG__MANIFEST__APPNAME__SHORT}}-aad
      # If the value is false, the action will not generate client secret for you
      generateClientSecret: true
      # Authenticate users with a Microsoft work or school account in your
      # organization's Azure AD tenant (for example, single tenant).
      signInAudience: "AzureADMyOrg"
    # Write the information of created resources into environment file for the
    # specified environment variable(s).
    writeToEnvironmentFile:
      clientId: AAD_APP_CLIENT_ID
      # Environment variable that starts with `SECRET_` will be stored to the
      # .env.{envName}.user environment file
      clientSecret: SECRET_AAD_APP_CLIENT_SECRET
      objectId: AAD_APP_OBJECT_ID
      tenantId: AAD_APP_TENANT_ID
      authority: AAD_APP_OAUTH_AUTHORITY
      authorityHost: AAD_APP_OAUTH_AUTHORITY_HOST
  # Creates a Teams app
  - uses: teamsApp/create
    with:
      # Teams app name
      name: ${{CONFIG__MANIFEST__APPNAME__SHORT}}
    # Write the information of created resources into environment file for
    # the specified environment variable(s).
    writeToEnvironmentFile:
      teamsAppId: TEAMS_APP_ID
  - uses: arm/deploy  # Deploy given ARM templates parallelly.
    with:
      # AZURE_SUBSCRIPTION_ID is a built-in environment variable,
      # if its value is empty, TeamsFx will prompt you to select a subscription.
      # Referencing other environment variables with empty values
      # will skip the subscription selection prompt.
      subscriptionId: ${{AZURE_SUBSCRIPTION_ID}}
      # AZURE_RESOURCE_GROUP_NAME is a built-in environment variable,
      # if its value is empty, TeamsFx will prompt you to select or create one
      # resource group.
      # Referencing other environment variables with empty values
      # will skip the resource group selection prompt.
      resourceGroupName: ${{AZURE_RESOURCE_GROUP_NAME}}
      templates:
        - path: ./templates/azure/main.bicep  # Relative path to this file
          # Relative path to this yaml file.
          # Placeholders will be replaced with corresponding environment
          # variable before ARM deployment.
          parameters: ./templates/azure/azure.parameters.${{TEAMSFX_ENV}}.json
          # Required when deploying ARM template
          deploymentName: teams_toolkit_deployment
      # Teams Toolkit will download this bicep CLI version from github for you,
      # will use bicep CLI in PATH if you remove this config.
      bicepCliVersion: v0.4.613
  - uses: azureStorage/enableStaticWebsite
    with:
      storageResourceId: ${{PROVISIONOUTPUT__FRONTENDHOSTINGOUTPUT__STORAGERESOURCEID}}
      indexPage: index.html
      errorPage: error.html
  # Apply the AAD manifest to an existing AAD app. Will use the object id in
  # manifest file to determine which AAD app to update.
  - uses: aadApp/update
    with:
      # Relative path to this file. Environment variables in manifest will
      # be replaced before apply to AAD app
      manifestPath: ./aad.manifest.json
      outputFilePath : ./build/aad.manifest.${{TEAMSFX_ENV}}.json
  # Validate using manifest schema
  - uses: teamsApp/validateManifest
    with:
      # Path to manifest template
      manifestPath: ./appPackage/manifest.json
  # Build Teams app package with latest env value
  - uses: teamsApp/zipAppPackage
    with:
      # Path to manifest template
      manifestPath: ./appPackage/manifest.json
      outputZipPath: ./build/appPackage/appPackage.${{TEAMSFX_ENV}}.zip
      outputJsonPath: ./build/appPackage/manifest.${{TEAMSFX_ENV}}.json
  # Validate app package using validation rules
  - uses: teamsApp/validateAppPackage
    with:
      # Relative path to this file. This is the path for built zip file.
      appPackagePath: ./build/appPackage/appPackage.${{TEAMSFX_ENV}}.zip
  # Apply the Teams app manifest to an existing Teams app in
  # Teams Developer Portal.
  # Will use the app id in manifest file to determine which Teams app to update.
  - uses: teamsApp/update
    with:
      # Relative path to this file. This is the path for built zip file.
      appPackagePath: ./build/appPackage/appPackage.${{TEAMSFX_ENV}}.zip

# Triggered when 'teamsfx deploy' is executed
deploy:
  # Run npm command
  - uses: cli/runNpmCommand
    name: install tab dependencies
    with:
      workingDirectory: tabs
      args: install
  # Run npm command
  - uses: cli/runNpmCommand
    name: build tab app
    env:
      REACT_APP_CLIENT_ID: ${{AAD_APP_CLIENT_ID}}
      REACT_APP_START_LOGIN_PAGE_URL: ${{PROVISIONOUTPUT__FRONTENDHOSTINGOUTPUT__ENDPOINT}}/auth-start.html
    with:
      workingDirectory: tabs
      args: run build --if-present
  # Deploy bits to Azure Storage Static Website
  - uses: azureStorage/deploy
    with:
      workingDirectory: tabs
      # Deploy base folder. This folder includes manifest files for AAD app and Teams app that should be ignored using the ignoreFile.
      artifactFolder: build
      # The resource id of the cloud resource to be deployed to. 
      # This key will be generated by arm/deploy action automatically. 
      # You can replace it with your existing Azure Resource id 
      # or add it to your environment variable file.
      resourceId: ${{PROVISIONOUTPUT__FRONTENDHOSTINGOUTPUT__STORAGERESOURCEID}}

# Triggered when 'teamsfx publish' is executed
publish:
  # Validate using manifest schema
  - uses: teamsApp/validateManifest
    with:
      # Path to manifest template
      manifestPath: ./appPackage/manifest.json
  # Build Teams app package with latest env value
  - uses: teamsApp/zipAppPackage
    with:
      # Path to manifest template
      manifestPath: ./appPackage/manifest.json
      outputZipPath: ./build/appPackage/appPackage.${{TEAMSFX_ENV}}.zip
      outputJsonPath: ./build/appPackage/manifest.${{TEAMSFX_ENV}}.json
  # Validate app package using validation rules
  - uses: teamsApp/validateAppPackage
    with:
      # Relative path to this file. This is the path for built zip file.
      appPackagePath: ./build/appPackage/appPackage.${{TEAMSFX_ENV}}.zip
  # Apply the Teams app manifest to an existing Teams app in
  # Teams Developer Portal.
  # Will use the app id in manifest file to determine which Teams app to update.
  - uses: teamsApp/update
    with:
      # Relative path to this file. This is the path for built zip file.
      appPackagePath: ./build/appPackage/appPackage.${{TEAMSFX_ENV}}.zip
  # Publish the app to
  # Teams Admin Center (https://admin.teams.microsoft.com/policies/manage-apps)
  # for review and approval
  - uses: teamsApp/publishAppPackage
    with:
      appPackagePath: ./build/appPackage/appPackage.${{TEAMSFX_ENV}}.zip
    # Write the information of created resources into environment file for
    # the specified environment variable(s).
    writeToEnvironmentFile:
      publishedAppId: TEAMS_APP_PUBLISHED_APP_ID
Siglud commented 11 months ago

@christophemacabiau Please open the $web container in your Azure Storage account. Ensure all file changes have been uploaded to this container. To work around any issues, you can manually clear the container and run deploy again. Lastly, please provide me with the path of the unchanged file so I can identify the bug in our code.

christophemacabiau commented 11 months ago

Hi @Siglud, Thank you for your support. I made a new deployment, the files are correctly updated in the container. But when I open the teams app, it seems that an old version is downloaded: image Not sure what the problem is

Siglud commented 11 months ago

@christophemacabiau Please open this page in your browser (not Teams) to check if the script is correct. This will help determine whether Azure Storage Service or Teams App cached the wrong page.

If it's from Azure, clear all files in your $web container and redeploy. If it's from Teams, follow these instructions to clear the cache and try again.

christophemacabiau commented 11 months ago

Thanks @Siglud

The problem seems to be in azure storage service. in .env.dev I have PROVISIONOUTPUT__FRONTENDHOSTINGOUTPUT__ENDPOINT=https://azureprod-cphta4bjfmexchfm.z01.azurefd.net which loads this old file https://azureprod-cphta4bjfmexchfm.z01.azurefd.net/static/js/main.3c9b90f9.js In azure.parameters.dev.json, I have "resourceBaseName": "teamsdev9f16be" so I assumed the container used by this environment is teamsdev9f16betab. I deleted all the files in this container, redeployed, but no change.

I imagine I am not cleaning the right container?

christophemacabiau commented 11 months ago

It seems that the azure deployment does not use the container created by teams toolkit. Am I right? Do you know how to fix this issue?

Siglud commented 11 months ago

@christophemacabiau You can set your PROVISIONOUTPUTFRONTENDHOSTINGOUTPUTSTORAGERESOURCEID=YOUR_NEW_AZURE_STORAGE_RESOURCE_ID in your .env files. or you can write your Azure Storage Resource id into your teamsapp.yml like this:

  # Deploy bits to Azure Storage Static Website
  - uses: azureStorage/deploy
    with:
      workingDirectory: tabs
      # Deploy base folder. This folder includes manifest files for AAD app and Teams app that should be ignored using the ignoreFile.
      artifactFolder: build
      # The resource id of the cloud resource to be deployed to. 
      # This key will be generated by arm/deploy action automatically. 
      # You can replace it with your existing Azure Resource id 
      # or add it to your environment variable file.
      resourceId: /subscriptions/YOUR_SUBSCRIPTION/resourceGroups/YOUR_RESOURCE_GROUP/providers/Microsoft.Web/sites/YOUR_RESOURCE_NAME

Note: this string can be found in your Azure Portal - Your Azure Storage account - Overview - Json view - Resource ID

christophemacabiau commented 11 months ago

@Siglud Thanks for your answer I already have the right id PROVISIONOUTPUT__FRONTENDHOSTINGOUTPUT__STORAGERESOURCEID=/subscriptions/404c57d8-d7ac-43a7-afac-8681abc7cf63/resourceGroups/Vizygood2/providers/Microsoft.Storage/storageAccounts/teamsdev9f16betab in my .env.dev

This is very problematic, we are stuck on this bug... How can I debug this?

Siglud commented 11 months ago

@christophemacabiau You can debug in the following ways:

christophemacabiau commented 11 months ago

Thanks @Siglud I updated teamsapp.yml with the resource id to be sure, but nothing changed:

deploy:
  # Run npm command
  - uses: cli/runNpmCommand
    name: install tab dependencies
    with:
      workingDirectory: tabs
      args: install
  # Run npm command
  - uses: cli/runNpmCommand
    name: build tab app
    env:
      REACT_APP_CLIENT_ID: ${{AAD_APP_CLIENT_ID}}
      REACT_APP_START_LOGIN_PAGE_URL: ${{PROVISIONOUTPUT__FRONTENDHOSTINGOUTPUT__ENDPOINT}}/auth-start.html
    with:
      workingDirectory: tabs
      args: run build --if-present
  # Deploy bits to Azure Storage Static Website
  - uses: azureStorage/deploy
    with:
      workingDirectory: tabs
      # Deploy base folder. This folder includes manifest files for AAD app and Teams app that should be ignored using the ignoreFile.
      artifactFolder: build
      # The resource id of the cloud resource to be deployed to. 
      # This key will be generated by arm/deploy action automatically. 
      # You can replace it with your existing Azure Resource id 
      # or add it to your environment variable file.
      # resourceId: ${{PROVISIONOUTPUT__FRONTENDHOSTINGOUTPUT__STORAGERESOURCEID}}
      resourceId: /subscriptions/404c57d8-d7ac-43a7-afac-8681abc7cf63/resourceGroups/Vizygood2/providers/Microsoft.Storage/storageAccounts/teamsdev9f16betab

The vscode logs seem to be correct?

[2023-06-12T09:02:09.783Z] [Info] - Executing app registration and provision 

Lifecycle stage: provision(9 step(s) in total). The following actions will be executed: 
(1/9) Action aadApp/create: Create an Azure Active Directory app to authenticate users
(2/9) Action teamsApp/create: create a Teams app.
(3/9) Action arm/deploy: Deploy the given ARM templates to Azure.
(4/9) Action azureStorage/enableStaticWebsite: enable static website setting in Azure Storage.
(5/9) Action aadApp/update: Apply Azure Active Directory app manifest to an existing app
(6/9) Action teamsApp/validateManifest: validate a Teams app.
(7/9) Action teamsApp/zipAppPackage: build a Teams app package.
(8/9) Action teamsApp/validateAppPackage: validate a Teams app.
(9/9) Action teamsApp/update: update a Teams app.

[2023-06-12T09:02:09.787Z] [Info] - Executing lifecycle provision
[2023-06-12T09:02:09.787Z] [Info] - Executing action aadApp/create in lifecycle provision
[2023-06-12T09:02:09.790Z] [Info] - Executing action aadApp/create
[2023-06-12T09:02:09.791Z] [Info] - Environment variable AAD_APP_CLIENT_ID already exist, skipping new Azure Active Directory app creation step.
[2023-06-12T09:02:09.791Z] [Info] - Environment variable SECRET_AAD_APP_CLIENT_SECRET already exist, skipping new Azure Active Directory app creation step.
[2023-06-12T09:02:09.791Z] [Info] - Action aadApp/create executed successfully
[2023-06-12T09:02:09.793Z] [Info] - Action aadApp/create in lifecycle provision succeeded with output {}
[2023-06-12T09:02:09.793Z] [Info] - Executing action teamsApp/create in lifecycle provision
[2023-06-12T09:02:10.032Z] [Info] - Action teamsApp/create in lifecycle provision succeeded with output {"TEAMS_APP_ID":"f615f728-6f78-4b21-b6c1-cd6aff283566","TEAMS_APP_TENANT_ID":"9574af5f-52e6-4fa6-9841-4fbfbd76027d"}
[2023-06-12T09:02:10.032Z] [Info] - Executing action arm/deploy in lifecycle provision
[2023-06-12T09:02:10.035Z] [Info] - Executing action arm/deploy
[2023-06-12T09:02:48.210Z] [Info] - Action arm/deploy executed successfully
[2023-06-12T09:02:48.210Z] [Info] - Action arm/deploy in lifecycle provision succeeded with output {"PROVISIONOUTPUT__FRONTENDHOSTINGOUTPUT__TEAMSFXPLUGINID":"fx-resource-frontend-hosting","PROVISIONOUTPUT__FRONTENDHOSTINGOUTPUT__DOMAIN":"azureprod-cphta4bjfmexchfm.z01.azurefd.net","PROVISIONOUTPUT__FRONTENDHOSTINGOUTPUT__ENDPOINT":"https://azureprod-cphta4bjfmexchfm.z01.azurefd.net","PROVISIONOUTPUT__FRONTENDHOSTINGOUTPUT__INDEXPATH":"/index.html#","PROVISIONOUTPUT__FRONTENDHOSTINGOUTPUT__STORAGERESOURCEID":"/subscriptions/404c57d8-d7ac-43a7-afac-8681abc7cf63/resourceGroups/Vizygood2/providers/Microsoft.Storage/storageAccounts/teamsdev9f16betab","PROVISIONOUTPUT__IDENTITYOUTPUT__TEAMSFXPLUGINID":"fx-resource-identity","PROVISIONOUTPUT__IDENTITYOUTPUT__IDENTITYNAME":"teamsdev9f16be","PROVISIONOUTPUT__IDENTITYOUTPUT__IDENTITYRESOURCEID":"/subscriptions/404c57d8-d7ac-43a7-afac-8681abc7cf63/resourceGroups/Vizygood2/providers/Microsoft.ManagedIdentity/userAssignedIdentities/teamsdev9f16be","PROVISIONOUTPUT__IDENTITYOUTPUT__IDENTITYCLIENTID":"b9c99860-8117-4cec-84f1-554fd514b499"}
[2023-06-12T09:02:48.211Z] [Info] - Executing action azureStorage/enableStaticWebsite in lifecycle provision
[2023-06-12T09:02:48.504Z] [Info] - Action azureStorage/enableStaticWebsite in lifecycle provision succeeded with output {}
[2023-06-12T09:02:48.504Z] [Info] - Executing action aadApp/update in lifecycle provision
[2023-06-12T09:02:48.510Z] [Info] - Executing action aadApp/update
[2023-06-12T09:02:48.517Z] [Info] - Build Azure Active Directory app manifest completed, and app manifest content is written to /home/christophe/code/vizygood/teams/build/aad.manifest.dev.json
[2023-06-12T09:02:49.024Z] [Info] - Applied manifest ./aad.manifest.json to Azure Active Directory application with object id 3fea70a7-f267-468c-88d6-3139287f01a1
[2023-06-12T09:02:49.024Z] [Info] - Action aadApp/update executed successfully
[2023-06-12T09:02:49.033Z] [Info] - Action aadApp/update in lifecycle provision succeeded with output {"AAD_APP_ACCESS_AS_USER_PERMISSION_ID":"76e415e2-ed9e-41f4-97a0-3157fea6399c"}
[2023-06-12T09:02:49.034Z] [Info] - Executing action teamsApp/validateManifest in lifecycle provision
[2023-06-12T09:02:49.210Z] [Info] - 
Teams Toolkit has checked manifest with its schema:

Summary:
All passed.

[2023-06-12T09:02:49.214Z] [Info] - Action teamsApp/validateManifest in lifecycle provision succeeded with output {}
[2023-06-12T09:02:49.214Z] [Info] - Executing action teamsApp/zipAppPackage in lifecycle provision
[2023-06-12T09:02:49.238Z] [Info] - Action teamsApp/zipAppPackage in lifecycle provision succeeded with output {}
[2023-06-12T09:02:49.238Z] [Info] - Executing action teamsApp/validateAppPackage in lifecycle provision
[2023-06-12T09:02:49.598Z] [Info] - 
Teams Toolkit has checked against all validation rules:

Summary:
48 passed.

A complete log of validations can be found in /home/christophe/.config/Code/logs/20230612T102927/window1/exthost/TeamsDevApp.ms-teams-vscode-extension/20230612T082931.log
[2023-06-12T09:02:49.600Z] [Info] - Action teamsApp/validateAppPackage in lifecycle provision succeeded with output {}
[2023-06-12T09:02:49.600Z] [Info] - Executing action teamsApp/update in lifecycle provision
[2023-06-12T09:02:51.316Z] [Info] - Teams app updated f615f728-6f78-4b21-b6c1-cd6aff283566
[2023-06-12T09:02:51.321Z] [Info] - Action teamsApp/update in lifecycle provision succeeded with output {"TEAMS_APP_TENANT_ID":"9574af5f-52e6-4fa6-9841-4fbfbd76027d","TEAMS_APP_UPDATE_TIME":"2023-06-12T09:02:52.4314411+00:00"}
[2023-06-12T09:02:51.321Z] [Info] - Finished Executing lifecycle provision. Result: {"TEAMS_APP_ID":"f615f728-6f78-4b21-b6c1-cd6aff283566","TEAMS_APP_TENANT_ID":"9574af5f-52e6-4fa6-9841-4fbfbd76027d","PROVISIONOUTPUT__FRONTENDHOSTINGOUTPUT__TEAMSFXPLUGINID":"fx-resource-frontend-hosting","PROVISIONOUTPUT__FRONTENDHOSTINGOUTPUT__DOMAIN":"azureprod-cphta4bjfmexchfm.z01.azurefd.net","PROVISIONOUTPUT__FRONTENDHOSTINGOUTPUT__ENDPOINT":"https://azureprod-cphta4bjfmexchfm.z01.azurefd.net","PROVISIONOUTPUT__FRONTENDHOSTINGOUTPUT__INDEXPATH":"/index.html#","PROVISIONOUTPUT__FRONTENDHOSTINGOUTPUT__STORAGERESOURCEID":"/subscriptions/404c57d8-d7ac-43a7-afac-8681abc7cf63/resourceGroups/Vizygood2/providers/Microsoft.Storage/storageAccounts/teamsdev9f16betab","PROVISIONOUTPUT__IDENTITYOUTPUT__TEAMSFXPLUGINID":"fx-resource-identity","PROVISIONOUTPUT__IDENTITYOUTPUT__IDENTITYNAME":"teamsdev9f16be","PROVISIONOUTPUT__IDENTITYOUTPUT__IDENTITYRESOURCEID":"/subscriptions/404c57d8-d7ac-43a7-afac-8681abc7cf63/resourceGroups/Vizygood2/providers/Microsoft.ManagedIdentity/userAssignedIdentities/teamsdev9f16be","PROVISIONOUTPUT__IDENTITYOUTPUT__IDENTITYCLIENTID":"b9c99860-8117-4cec-84f1-554fd514b499","AAD_APP_ACCESS_AS_USER_PERMISSION_ID":"76e415e2-ed9e-41f4-97a0-3157fea6399c","TEAMS_APP_UPDATE_TIME":"2023-06-12T09:02:52.4314411+00:00"}
[2023-06-12T09:02:51.326Z] [Info] - Execution summary:

Summary:
(√) Done: Lifecycle stage provision was executed successfully.
  (√) Done: aadApp/create was executed successfully.
  (√) Done: teamsApp/create was executed successfully.
    (√) Done: Teams app with id f615f728-6f78-4b21-b6c1-cd6aff283566 already exists, skipped creating a new Teams app.
  (√) Done: arm/deploy was executed successfully.
    (√) Done: Successfully deployed ARM templates. Resource group name: Vizygood2. Deployment name: teams_toolkit_deployment
  (√) Done: azureStorage/enableStaticWebsite was executed successfully.
    (√) Done: Azure Storage enable static website successfully.
  (√) Done: aadApp/update was executed successfully.
    (√) Done: Applied manifest ./aad.manifest.json to Azure Active Directory application with object id 3fea70a7-f267-468c-88d6-3139287f01a1
  (√) Done: teamsApp/validateManifest was executed successfully.
  (√) Done: teamsApp/zipAppPackage was executed successfully.
  (√) Done: teamsApp/validateAppPackage was executed successfully.
  (√) Done: teamsApp/update was executed successfully.
    (√) Done: Teams app updated f615f728-6f78-4b21-b6c1-cd6aff283566

[2023-06-12T09:02:51.327Z] [Info] - Successfully executed 9/9 actions in provision stage.
[2023-06-12T09:03:52.431Z] [Info] - Executing deploy 

Lifecycle stage: deploy(3 step(s) in total). The following actions will be executed: 
(1/3) Action cli/runNpmCommand(install tab dependencies): running npm command.
(2/3) Action cli/runNpmCommand(build tab app): running npm command.
(3/3) Action azureStorage/deploy: deploy the project to the Azure Storage.

[2023-06-12T09:03:52.436Z] [Info] - Executing lifecycle deploy
[2023-06-12T09:03:52.436Z] [Info] - Executing action {"name":"install tab dependencies","uses":"cli/runNpmCommand"} in lifecycle deploy
[2023-06-12T09:03:52.438Z] [Info] - Start to run command: "npm install" on path: "/home/christophe/code/vizygood/teams/tabs".
[2023-06-12T09:04:10.522Z] [Info] -  [script action stdout] 
up to date, audited 1816 packages in 18s

[2023-06-12T09:04:10.523Z] [Info] -  [script action stdout] 231 packages are looking for funding
  run `npm fund` for details

[2023-06-12T09:04:10.619Z] [Info] -  [script action stdout] 
48 vulnerabilities (20 moderate, 25 high, 3 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.

[2023-06-12T09:04:10.636Z] [Info] - Action {"name":"install tab dependencies","uses":"cli/runNpmCommand"} in lifecycle deploy succeeded with output {}
[2023-06-12T09:04:10.637Z] [Info] - Executing action {"name":"build tab app","uses":"cli/runNpmCommand"} in lifecycle deploy
[2023-06-12T09:04:10.638Z] [Info] - Start to run command: "npm run build --if-present" on path: "/home/christophe/code/vizygood/teams/tabs".
[2023-06-12T09:04:10.940Z] [Info] -  [script action stdout] 
> teamsfx-template-tab@0.1.0 build
> cross-env GENERATE_SOURCEMAP=false react-scripts build

[2023-06-12T09:04:12.678Z] [Info] -  [script action stdout] Creating an optimized production build...

[2023-06-12T09:04:12.801Z] [Warning] -  [script action stderr] Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme

[2023-06-12T09:04:37.331Z] [Warning] -  [script action stderr] Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme

[2023-06-12T09:04:38.188Z] [Info] -  [script action stdout] Compiled with warnings.

[eslint] 
src/components/App.tsx
  Line 82:6:  React Hook useCallback has a missing dependency: 'graphClient'. Either include it or remove the dependency array   react-hooks/exhaustive-deps
  Line 97:6:  React Hook useEffect has a missing dependency: 'getUsageRights'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

[2023-06-12T09:04:38.188Z] [Info] -  [script action stdout] File sizes after gzip:

[2023-06-12T09:04:38.283Z] [Info] -  [script action stdout]   649.36 kB  build/static/js/main.6d8690b0.js
  17.11 kB   build/static/css/main.334a3b17.css

The bundle size is significantly larger than recommended.

[2023-06-12T09:04:38.284Z] [Info] -  [script action stdout] Consider reducing it with code splitting: https://goo.gl/9VhYWB
You can also analyze the project dependencies: https://goo.gl/LeUzfb

The project was built assuming it is hosted at ./.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.

Find out more about deployment here:

  https://cra.link/deployment

[2023-06-12T09:04:38.568Z] [Info] - Action {"name":"build tab app","uses":"cli/runNpmCommand"} in lifecycle deploy succeeded with output {}
[2023-06-12T09:04:38.568Z] [Info] - Executing action azureStorage/deploy in lifecycle deploy
[2023-06-12T09:05:22.423Z] [Info] - Action azureStorage/deploy in lifecycle deploy succeeded with output {}
[2023-06-12T09:05:22.423Z] [Info] - Finished Executing lifecycle deploy. Result: {}
[2023-06-12T09:05:22.433Z] [Info] - Execution summary:

Summary:
(√) Done: Lifecycle stage deploy was executed successfully.
  (√) Done: cli/runNpmCommand(install tab dependencies) was executed successfully.
    (√) Done: Successful execution of the `npm install` command at `/home/christophe/code/vizygood/teams/tabs`.
  (√) Done: cli/runNpmCommand(build tab app) was executed successfully.
    (√) Done: Successful execution of the `npm run build --if-present` command at `/home/christophe/code/vizygood/teams/tabs`.
  (√) Done: azureStorage/deploy was executed successfully.
    (√) Done: Successfully deployed `/home/christophe/code/vizygood/teams/tabs/build` to Azure Storage.

[2023-06-12T09:08:21.674Z] [Info] - Executing publish 

Lifecycle stage: publish(5 step(s) in total). The following actions will be executed: 
(1/5) Action teamsApp/validateManifest: validate a Teams app.
(2/5) Action teamsApp/zipAppPackage: build a Teams app package.
(3/5) Action teamsApp/validateAppPackage: validate a Teams app.
(4/5) Action teamsApp/update: update a Teams app.
(5/5) Action teamsApp/publishAppPackage: publish a Teams app to tenant app catalog.

[2023-06-12T09:08:21.676Z] [Info] - Executing lifecycle publish
[2023-06-12T09:08:21.677Z] [Info] - Executing action teamsApp/validateManifest in lifecycle publish
[2023-06-12T09:08:21.883Z] [Info] - 
Teams Toolkit has checked manifest with its schema:

Summary:
All passed.

[2023-06-12T09:08:21.885Z] [Info] - Action teamsApp/validateManifest in lifecycle publish succeeded with output {}
[2023-06-12T09:08:21.885Z] [Info] - Executing action teamsApp/zipAppPackage in lifecycle publish
[2023-06-12T09:08:21.940Z] [Info] - Action teamsApp/zipAppPackage in lifecycle publish succeeded with output {}
[2023-06-12T09:08:21.940Z] [Info] - Executing action teamsApp/validateAppPackage in lifecycle publish
[2023-06-12T09:08:22.398Z] [Info] - 
Teams Toolkit has checked against all validation rules:

Summary:
48 passed.

A complete log of validations can be found in /home/christophe/.config/Code/logs/20230612T102927/window1/exthost/TeamsDevApp.ms-teams-vscode-extension/20230612T082931.log
[2023-06-12T09:08:22.403Z] [Info] - Action teamsApp/validateAppPackage in lifecycle publish succeeded with output {}
[2023-06-12T09:08:22.403Z] [Info] - Executing action teamsApp/update in lifecycle publish
[2023-06-12T09:08:24.689Z] [Info] - Teams app updated f615f728-6f78-4b21-b6c1-cd6aff283566
[2023-06-12T09:08:24.693Z] [Info] - Action teamsApp/update in lifecycle publish succeeded with output {"TEAMS_APP_TENANT_ID":"9574af5f-52e6-4fa6-9841-4fbfbd76027d","TEAMS_APP_UPDATE_TIME":"2023-06-12T09:08:25.7171639+00:00"}
[2023-06-12T09:08:24.693Z] [Info] - Executing action teamsApp/publishAppPackage in lifecycle publish
[2023-06-12T09:10:23.122Z] [Info] - Publish success!
[2023-06-12T09:10:23.126Z] [Info] - Action teamsApp/publishAppPackage in lifecycle publish succeeded with output {"TEAMS_APP_PUBLISHED_APP_ID":"86d7f6c2-775b-4ef6-8a12-a95b5b908b98"}
[2023-06-12T09:10:23.126Z] [Info] - Finished Executing lifecycle publish. Result: {"TEAMS_APP_TENANT_ID":"9574af5f-52e6-4fa6-9841-4fbfbd76027d","TEAMS_APP_UPDATE_TIME":"2023-06-12T09:08:25.7171639+00:00","TEAMS_APP_PUBLISHED_APP_ID":"86d7f6c2-775b-4ef6-8a12-a95b5b908b98"}
[2023-06-12T09:10:23.130Z] [Info] - Execution summary:

Summary:
(√) Done: Lifecycle stage publish was executed successfully.
  (√) Done: teamsApp/validateManifest was executed successfully.
  (√) Done: teamsApp/zipAppPackage was executed successfully.
  (√) Done: teamsApp/validateAppPackage was executed successfully.
  (√) Done: teamsApp/update was executed successfully.
    (√) Done: Teams app updated f615f728-6f78-4b21-b6c1-cd6aff283566
  (√) Done: teamsApp/publishAppPackage was executed successfully.
    (√) Done: Checking if the Teams app has already been submitted to tenant App Catalog
    (√) Done: Teams app with id f615f728-6f78-4b21-b6c1-cd6aff283566 already exists in the organization's app store.
    (√) Done: Update published Teams app
    (√) Done: Teams app f615f728-6f78-4b21-b6c1-cd6aff283566 successfully published to the admin portal.

Looking at the storage account, I have seen that the web endpoint is https://teamsdev9f16betab.z28.web.core.windows.net and this one is updated with the last version of the code. I don't understand why in my .env.dev I have PROVISIONOUTPUT__FRONTENDHOSTINGOUTPUT__ENDPOINT=https://azureprod-cphta4bjfmexchfm.z01.azurefd.net, which is not updated. What is the differnce?

Siglud commented 11 months ago

@christophemacabiau I think your current situation is as follows (please correct me if I'm wrong):

  1. The latest code has been uploaded to /subscriptions/404c57d8-d7ac-43a7-afac-8681abc7cf63/resourceGroups/Vizygood2/providers/Microsoft.Storage/storageAccounts/teamsdev9f16betab with domain is https://teamsdev9f16betab.z28.web.core.windows.net, not https://azureprod-cphta4bjfmexchfm.z01.azurefd.net;
  2. Your PROVISIONOUTPUTFRONTENDHOSTINGOUTPUTENDPOINT currently points to an old address of https://azureprod-cphta4bjfmexchfm.z01.azurefd.net

To fix this issue, try the following steps:

  1. Modify the value of PROVISIONOUTPUTFRONTENDHOSTINGOUTPUTENDPOINT in your env file so that it points to the correct address of https://teamsdev9f16betab.z28.web.core.windows.net (you can also hardcode this value in the teamsapp.yaml for debugging purposes);
  2. Rerun deploy without running provision again.
  3. Run publish again.
christophemacabiau commented 11 months ago

Yes this way it works. I think the configuration files generation during the version 5 migration didn't work correctly in my case. Thank you for your help @Siglud