Closed ms-86 closed 2 weeks ago
hi, thanks for reporting this issue. I am investagating and will get back to you ASAP.
hi @ms-86, I cannot reproduce this issue on my side. The error meesage "DeveloperPortalAPIFailedError:Unable to make API call to Developer Portal: AxiosError, Request failed with status code 502" was probably due to a brief service unavailability. Could you retry to see if this still happens? Sorry for the inconvenience.
hi @anchenyi, in my environment, a similar error occurs although the error code is different.
I executed the following provision command using the teamsapp command behind corporate proxy:
npx teamsapp provision --env dev
An error occurs during the execution of teamsApp/create, and the Azure resources are not created successfully. The same situation occurs no matter how many times I try. Are there any solutions?
Costs may apply based on usage. Do you want to provision resources in prod environment using listed accounts? yes
Executing provision
Lifecycle stage: provision(7 step(s) in total). The following actions will be executed:
(1/7) Action teamsApp/create: create a Teams app.
(2/7) Action aadApp/create: Create a Microsoft Entra app to authenticate users
(3/7) Action arm/deploy: Deploy the given ARM templates to Azure.
(4/7) Action teamsApp/validateManifest: validate a Teams app.
(5/7) Action teamsApp/zipAppPackage: build a Teams app package.
(6/7) Action teamsApp/validateAppPackage: validate a Teams app.
(7/7) Action teamsApp/update: update a Teams app.
Executing lifecycle provision
(×) Error: Failed to Execute lifecycle provision due to failed action: teamsApp/create. DeveloperPortalAPIFailedError:Unable to make API call to Developer Portal: AxiosError, Requv output: {}
Execution summary:
Summary:
(×) Error: Lifecycle stage provision failed.
(×) Error: teamsApp/create failed.
(×) Error: Unable to make API call to Developer Portal: AxiosError, Request failed with status code 400, API name: create-app, X-Correlation-ID: undefined. This may be due to
(!) Warning: aadApp/create was not executed.
(!) Warning: arm/deploy was not executed.
(!) Warning: teamsApp/validateManifest was not executed.
(!) Warning: teamsApp/zipAppPackage was not executed.
(!) Warning: teamsApp/validateAppPackage was not executed.
(!) Warning: teamsApp/update was not executed.
hi @hirokika, the APIs look fine on my side. Could you provide your project code for further investigation? Thanks!
@anchenyi Thank you for your reply!!
I am trying to log in to Azure and execute the provisioning commands using a shell script as shown below. The environment variables are defined in a .env file and read by the shell script.
export AZURE_SERVICE_PRINCIPAL_CLIENT_ID=xxx
export AZURE_TENANT_ID=xxx
export AZURE_SERVICE_PRINCIPAL_CLIENT_SECRET=xxx
# install teamsapp-cli
npm install -g @microsoft/teamsapp-cli@3.0.2
# login to Azure
npx teamsapp auth login azure --username $AZURE_SERVICE_PRINCIPAL_CLIENT_ID \
--service-principal true \
--tenant $AZURE_TENANT_ID \
--password $AZURE_SERVICE_PRINCIPAL_CLIENT_SECRET \
--interactive false
# provision
npx teamsapp provision --env dev
The teamsapp.yml file looks like this:
provision:
- uses: teamsApp/create
with:
name: my-project-bot
writeToEnvironmentFile:
teamsAppId: TEAMS_APP_ID
- uses: aadApp/create
with:
name: my-project-bot
generateClientSecret: true
signInAudience: AzureADMultipleOrgs
writeToEnvironmentFile:
clientId: BOT_ID
clientSecret: SECRET_BOT_PASSWORD
objectId: BOT_OBJECT_ID
- uses: arm/deploy
with:
subscriptionId: ${{AZURE_SUBSCRIPTION_ID}}
resourceGroupName: ${{AZURE_RESOURCE_GROUP_NAME}}
templates:
- path: ./infra/azure.bicep
parameters: ./infra/azure.parameters.json
deploymentName: Create-resources-for-bot
bicepCliVersion: v0.9.1
…
I have set the proxy with npm set proxy and http-proxy, and also set the environment variables HTTP_PROXY and HTTPS_PROXY. While the npm library installation and login succeed, the aadApp/create step fails. The commands complete successfully if not behind corporate proxy.
hi @hirokika, so currently, it is the aadApp/create that is failing, not teamsApp/create, right? Since in the previous post, the error was related to teamsApp/create.
@anchenyi Oh, sorry about that. That was a mistake on my part. As I originally mentioned, the error occurs with teamsApp/create.
Got it, @hirokika . Could you provide all related error messages? If the command works fine without your corporate proxy, it may due to the network.
Thanks @anchenyi, here is all the log from running the shell script. It's not a problem if deprecated warnings appear during npm install, right?
$ ./provision.sh
npm WARN deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
changed 422 packages in 33s
42 packages are looking for funding
run npm fund for details
(√) Success: Successfully signed into Azure.
Your Azure account is: xxxxx. Your subscriptions are: [
{
"subscriptionName": "xxxxx",
"subscriptionId": "xxxxx",
"tenantId": "xxxxx"
}
]
? Azure account:
Azure subscription: xxxxx
Microsoft 365 account: [xxxxx](xxxxx)
Costs may apply based on usage. Do you want to provision resources in prod environment using listed accounts? yes
Executing provision
Lifecycle stage: provision(7 step(s) in total). The following actions will be executed:
(1/7) Action teamsApp/create: create a Teams app.
(2/7) Action aadApp/create: Create a Microsoft Entra app to authenticate users
(3/7) Action arm/deploy: Deploy the given ARM templates to Azure.
(4/7) Action teamsApp/validateManifest: validate a Teams app.
(5/7) Action teamsApp/zipAppPackage: build a Teams app package.
(6/7) Action teamsApp/validateAppPackage: validate a Teams app.
(7/7) Action teamsApp/update: update a Teams app.
Executing lifecycle provision
(×) Error: Failed to Execute lifecycle provision due to failed action: teamsApp/create. DeveloperPortalAPIFailedError:Unable to make API call to Developer Portal: AxiosError, Request failed with status code 400, API name: create-app, X-Correlation-ID: undefined. This may be due to a temporary service error. Try again after a few minutes. data: "Bad request". Env output: {}
Execution summary:
Summary:
(×) Error: Lifecycle stage provision failed.
(×) Error: teamsApp/create failed.
(×) Error: Unable to make API call to Developer Portal: AxiosError, Request failed with status code 400, API name: create-app, X-Correlation-ID: undefined. This may be due to a temporary service error. Try again after a few minutes. data: "Bad request"
(!) Warning: aadApp/create was not executed.
(!) Warning: arm/deploy was not executed.
(!) Warning: teamsApp/validateManifest was not executed.
(!) Warning: teamsApp/zipAppPackage was not executed.
(!) Warning: teamsApp/validateAppPackage was not executed.
(!) Warning: teamsApp/update was not executed.
██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 9% | [1/7] Provision: Creating Teams app... (×) Failed.
(×) Error: AppStudioPlugin.DeveloperPortalAPIFailedError: Unable to make API call to Developer Portal: AxiosError, Request failed with status code 400, API name: create-app, X-Correlation-ID: undefined. This may be due to a temporary service error. Try again after a few minutes. data: "Bad request"
I want to run the deploy command after provisioning, but I can't proceed because the provisioning failed. Since npm install succeeded, I thought the network might not be the issue, but I'll check further to confirm if there are any specific URLs being blocked.
Thanks @hirokika for providing these details. "Request failed with status code 400, API name: create-app, X-Correlation-ID: undefined." This is the critical error message. Since the X-Correlation-ID is undefined, and I also checked the server-side logs, it looks like this request did not reach the server. If everything works fine without the corporate proxy, I think you might need to check the network settings.
For your information, the "create-app" API's url is https://dev.teams.microsoft.com/{region}/api/appdefinitions/v2/import
Thank you @anchenyi, for the detailed explanation! If the request isn’t reaching the server, it indeed suggests that the proxy is likely interfering… I will check the network settings further.
@anchenyi
I'm still getting Request failed with status code 502, API name: create-app, X-Correlation-ID: undefined
You wrote something about create-app URL. In a data field of the response I see an HTML in which there's such URL https://dev.teams.microsoft.com/api/appdefinitions/v2/import?overwriteIfAppAlreadyExists=false so it's not matching a pattern with region you wrote about.
For your information, the "create-app" API's url is https://dev.teams.microsoft.com/{region}/api/appdefinitions/v2/import
hi @ms-86 , the API url is account-based, and what you mentioned is a global endpoint, which is also valid. Could you share all the error response data for futher investigation? Thanks!
Hi @anchenyi this is an log from Teams Toolkit Output in VS Code log.txt
Let me know if you need something else.
hi @ms-86, thanks for the details. It seems to be a network-related issue. Can the command succeed without your corporate proxy?
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.
Due to lack of details for further investigation, we will archive the issue for now. In case you still have following-up questions on this issue, please always feel free to reopen the issue by clicking ‘reopen issue’ button below the comment box. We will get back to you as soon as possible.
Describe the bug I've tried to run a simple EchoBot from the Teams AI repo examples the Teams AI repo examples. My first problem was during Start local tunnel task:
As a workaround I started tunnel myself in PowerShell terminal:
and then disabled this task from tasks.json Now when I try to run the app by hitting F5 I'm stuck at provisioning stage
Expected behavior I should be prompted to sideload a bot into teams like described here
VS Code Extension Information (please complete the following information):
Additional context I'm behind corporate proxy. I have following env variables configured: HTTP_PROXY= HTTPS_PROXY= NO_PROXY=localhost