Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't deploy to an existing web app with unique name feature enabled #13320

Open
deividfoggi opened this issue Feb 28, 2025 · 3 comments
Open
Assignees
Labels
investigating TA:Compute Team Area: Compute

Comments

@deividfoggi
Copy link

Describe the bug
If the web app in App Service is created using the unique default domains feature enabled, the toolkit tries to deploy to the name pattern without the uniqueness string.

Unique default name feature: https://techcommunity.microsoft.com/blog/appsonazureblog/deploy-secure-app-service-resources-to-prevent-dangling-dns-entries-and-avoid-su/4303571

To Reproduce
Steps to reproduce the behavior:

  1. Create a new web app in Azure with the following flag enabled: "Secure unique default hostname on"

Image

  1. Get the resource id and set it in your .env file, for instance .env.dev
  2. Try to deploy it to dev environment.

Expected behavior
Successfully getting the right name from the deployment profile and successfully deploying the app to the web app.

Screenshots
If applicable, add screenshots to help explain your problem.

VS Code Extension Information (please complete the following information):

  • OS: MacOS Sequoia 15.3.1
  • Version 5.12.1

CLI Information (please complete the following information):

  • OS: [e.g. iOS8.1]
  • Version [e.g. 22]

Additional context
Error when trying to deploy:

[2025-02-28T14:06:08.373Z] [Verbose] - Upload zip file failed with error: {
"code": "ENOTFOUND",
"message": "getaddrinfo ENOTFOUND test1-dfoggi.scm.azurewebsites.net",
"stack": "Error: getaddrinfo ENOTFOUND test1-dfoggi.scm.azurewebsites.net\n at Function.od.from (/Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:66:15744)\n at GF. (/Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:69:9929)\n at GF.emit (node:events:530:35)\n at GF.emit (node:domain:489:12)\n at ClientRequest.mhr. (/Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:66:928)\n at ClientRequest.emit (node:events:530:35)\n at ClientRequest.emit (node:domain:489:12)\n at emitErrorEvent (node:_http_client:101:11)\n at TLSSocket.socketErrorListener (node:_http_client:504:5)\n at TLSSocket.emit (node:events:518:28)\n at TLSSocket.emit (node:domain:489:12)\n at emitErrorNT (node:internal/streams/destroy:169:8)\n at emitErrorCloseNT (node:internal/streams/destroy:128:3)\n at processTicksAndRejections (node:internal/process/task_queues:82:21)\n at $ke.request (/Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:71:1964)\n at processTicksAndRejections (node:internal/process/task_queues:95:5)\n at Lqt.zipDeployPackage (/Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:856:13352)\n at Lqt. (/Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:14:389828)\n at Lqt.zipDeploy (/Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:856:11139)\n at Lqt.azureDeploy (/Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:856:10428)\n at Lqt.deploy (/Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:856:2257)\n at /Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:855:167164\n at Lqt.wrapErrorHandler (/Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:856:224)\n at Lqt.run (/Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:855:166760)\n at odt.execute (/Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:856:15985)\n at odt. (/Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:647:26429)\n at executeImpl (/Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:681:4660)\n at execute (/Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:681:2382)\n at zne.deploy (/Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:803:16515)\n at zne. (/Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:14:389828)\n at Lf.deployArtifacts (/Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:902:23703)\n at Lf.DOc (/Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:865:17276)\n at Lf.VOc (/Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:865:21543)\n at Lf.$Oc (/Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:865:20597)\n at AOc (/Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:865:17248)\n at Lf. (/Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:865:16413)\n at Lf.FRc (/Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:900:6512)\n at Lf.HOc (/Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:865:21842)\n at Lf. (/Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:14:389828)\n at jE (/Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:1677:18305)\n at Object.xwa [as callback] (/Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:1699:18263)\n at e.runCommand (/Users/deividfoggi/.vscode/extensions/teamsdevapp.ms-teams-vscode-extension-5.12.1/out/src/extension.js:1677:15869)\n at mw.h (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:112:32733)\n at mw.h (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:112:32733)",
"name": "Error",
"config": {}
}

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs attention This issue needs the attention of a contributor. label Feb 28, 2025
Copy link

👋 Hi @deividfoggi,

Thank you for reporting this issue! We want to let you know that:

⏱️ Our team will personally review your issue
🎯 You can expect a response within 2 business days

✨ This is an AI-generated initial response
🤖 AI-Generated Preliminary Analysis:

It seems like you are encountering an issue where the Teams Toolkit is not correctly handling the unique default hostname feature enabled on your Azure App Service. This results in a failure to deploy because the toolkit tries to deploy to the name pattern without the uniqueness string.

Here are some steps and suggestions to help you troubleshoot and resolve this issue:

Steps to Resolve

  1. Verify the Unique Hostname Configuration:
    Ensure that the unique default hostname feature is correctly enabled in your Azure App Service. This typically appends a uniqueness string to your web app's domain name.

  2. Update the Deployment Configuration:
    Make sure that your .env file and any other configuration files correctly reference the unique hostname. The toolkit should be targeting the correct address that includes the uniqueness string.

  3. Modify Deployment Scripts:
    If the toolkit does not automatically handle the uniqueness string, you might need to manually adjust your deployment scripts or configurations to include the full unique hostname.

Example Configuration Adjustment

Assuming your unique hostname is example-unique.azurewebsites.net, ensure that your .env file looks something like this:

AZURE_WEB_APP_NAME=example-unique

And your deployment script or configuration file should use this variable correctly.

Sample Deployment Script Adjustment

If you are using a script to handle the deployment, ensure it is targeting the correct unique URL:

# Example deployment script
WEB_APP_NAME=$(grep AZURE_WEB_APP_NAME .env | cut -d '=' -f2)
AZURE_RESOURCE_GROUP=myResourceGroup
ZIP_FILE_PATH=./path/to/your/zip/file.zip

# Ensure the URL includes the uniqueness string
WEB_APP_URL="https://${WEB_APP_NAME}.scm.azurewebsites.net"

# Deploy the zip file
curl -X POST -u $DEPLOYMENT_USER:$DEPLOYMENT_PASSWORD --data-binary @$ZIP_FILE_PATH $WEB_APP_URL/api/zipdeploy

Additional Steps

  1. Check Connectivity:
    Ensure that there are no network issues and that the hostname is resolvable from your deployment environment.

  2. Update Teams Toolkit:
    Make sure you are using the latest version of the Teams Toolkit, as updates may include fixes for issues related to hostname handling.

  3. Review Documentation and Community Posts:
    Refer to the Teams Toolkit documentation and community discussions for any updates or similar issues reported by other users. You can find relevant information and updates here:

Proposed Solution from Search Results

Based on the information from the search results, it seems that deploying to existing resources with unique names could be a known issue. Future updates to the Teams Toolkit might include better support for this scenario. For now, manually ensuring that your deployment scripts and configurations correctly reference the unique hostname should help mitigate the issue.

If the problem persists, consider filing a bug report or feature request with the Teams Toolkit development team to ensure this scenario is supported in future releases.

For more details and discussions, you can refer to the relevant GitHub issue: GitHub issue #1279.

Feel free to provide any additional context or screenshots if you need further assistance.


Note: This is an automated first response generated by AI. A human team member will review your issue and provide a more detailed response soon. We appreciate your patience!

@Meghana-MSFT
Copy link

Thank you for reporting this, we will check this and get back to you.

@adashen adashen assigned huimiu and unassigned Siglud Mar 5, 2025
@huimiu
Copy link
Member

huimiu commented Mar 5, 2025

@deividfoggi Thanks for reporting this issue to us! We'll fix this problem in the upcoming release.

@huimiu huimiu removed the needs attention This issue needs the attention of a contributor. label Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigating TA:Compute Team Area: Compute
Projects
None yet
Development

No branches or pull requests

5 participants