I need your help I’m not expert creating Custom Teams App, this is my first App and I’m creating a Custom Teams App in Microsoft Visual Studio 2022 (Blazor), the App is ready I Already finished and every time I executed Locally the APP works fine if I execute it directly from Visual Studio 2022. I already upload the manifest.json to Teams App and the Teams Administrator already approved and now I can see the Icon in the lists of applications inside Teams but when I press to the App the first Page is empty(I suppose should be first publish the Custom Teams App to Azure according waht I read).
I’m waiting the administrators assign me the missing privileges to publish to Azure directly from Visual Studio 2022 (I received an error that I don’t have privileges).
My question is… after the App is published to Azure what should I modify in the Package to make the Custom Teams App works in Teams? There are some files that I was reading that should be modified but those files have some variables that I don’t understand what it means and where I can get the values.
For example the files manifest.json, .env.local, .env.local, launchSettings.json, etc. by default those files have some values but I don’t know what I should modify in these files to change it from Development to Production environment.
I’m attaching the images of those files and there are variables like TEAMS_APP_ID, TAB_ENDPOINT, TEAMSFX_ENV, APP_NAME_SUFFIX, TAB_DOMAIN, TEAMS_APP_TENANT_ID once the App is published to Azure what value should I change and if can I get those values from Azure?
How to Publish Custom Teams App to Azure from Visual Studio 2022
2
Answers
I already did Project=>Teams Toolkit=>Provision in the cloud and the ".env.dev" was modified automatically with all the information from Azure but the webpage created specified in Azure when I click it says "The service is unavailable." I don't know why but this looks like is for Development option so I think doesn't matter if the development option it not working.
And I tried to Publish in "Azure App Service (Windows)" following the wizard in Visual Studio 2022 and the process was successfully Published from Visual Studio 2022, if I go to Azure account I can see the link created when I click on the webpage says "An error has occurred. This application may no longer respond until reloaded. Reload" and activating the Developer Tools in the web browser I see 2 Errors but when I execute the Teams APP directly in Visual Studio 2022 the application looks fine actually when I execute it in VS2022 the Team App appears in Teams and I can execute it without problem, I mean, the APP doesn't has errors.
Is there something that I missing? For example the files manifest.json, .env.local, .env.local, launchSettings.json, etc. should I need to modify something before publish it?
Why the webpage doesn't work directly from azure after published? But when I execute it from VS2022 the App works fine(When I execute it from VS2022 the link is "https://localhost:44302" because is locally and works fine... But it's not working from Azure.
Is there another configuration or values that I need to change in VS2022 before publish it in Azure?
These are the 2 errors that appears using the Web Developer Tool when I click directly the webpage created in Azure when was published:
ERROR #1: "Error: There was an unhandled exception on the current circuit, so this circuit will be terminated. For more details turn on detailed exceptions by setting 'DetailedErrors: true' in 'appSettings.Development.json' or set 'CircuitOptions.DetailedErrors'. blazor.server.js:1:116297 log h ttps://basicblazortabapp20240821103153.azurewebsites.net/_framework/blazor.server.js:1 tr h ttps://basicblazortabapp20240821103153.azurewebsites.net/_framework/blazor.server.js:1 er h ttps://basicblazortabapp20240821103153.azurewebsites.net/_framework/blazor.server.js:1 _invokeClientMethod h ttps://basicblazortabapp20240821103153.azurewebsites.net/_framework/blazor.server.js:1 _invokeClientMethod h ttps://basicblazortabapp20240821103153.azurewebsites.net/_framework/blazor.server.js:1 _processIncomingData h ttps://basicblazortabapp20240821103153.azurewebsites.net/_framework/blazor.server.js:1 onreceive h ttps://basicblazortabapp20240821103153.azurewebsites.net/_framework/blazor.server.js:1 _poll h ttps://basicblazortabapp20240821103153.azurewebsites.net/_framework/blazor.server.js:1" ERROR #2: "Uncaught (in promise) Error: Cannot send data if the connection is not in the 'Connected' State. send h ttps://basicblazortabapp20240821103153.azurewebsites.net/_framework/blazor.server.js:1 _sendMessage h ttps://basicblazortabapp20240821103153.azurewebsites.net/_framework/blazor.server.js:1 _sendWithProtocol h ttps://basicblazortabapp20240821103153.azurewebsites.net/_framework/blazor.server.js:1 send h ttps://basicblazortabapp20240821103153.azurewebsites.net/_framework/blazor.server.js:1 endInvokeJSFromDotNet h ttps://basicblazortabapp20240821103153.azurewebsites.net/_framework/blazor.server.js:1 beginInvokeJSFromDotNet h ttps://basicblazortabapp20240821103153.azurewebsites.net/_framework/blazor.server.js:1"
Before deploying the Microsoft Teams app to Azure, provision the resources in Visual studio.
Project=>Teams Toolkit=>Provision in the cloud
:This way you can provision the resources required for the deployment:
The values for the settings you mentioned will be added automatically in
.env.dev
:My .env.dev:
Deploy the app using Visual studio:
Deployed the app to Azure:
Portal: