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

how do i deploy a docker image on visual studio code to an app service on azure. I am getting the following errors when i try. Please advice #1702

Closed
tobioge1 opened this issue Mar 3, 2020 · 8 comments · Fixed by microsoft/vscode-azuretools#667 or #1725

Comments

@tobioge1
Copy link

tobioge1 commented Mar 3, 2020

Does this occur consistently?
Repro steps:

Action: vscode-docker.registries.deployImageToAzure
Error type: NoResouceFoundError
Error Message: No matching resources found.

Version: 0.10.0
OS: win32
OS Release: 10.0.18362
Product: Visual Studio Code
Product Version: 1.42.1
Language: en

Call Stack
RegistriesTreeItem.<anonymous> extension.bundle.js:1:706749
o extension.bundle.js:1:700627
@bwateratmsft
Copy link
Contributor

@EricJizbaMSFT The NoResouceFoundError [sic] is in vscode-azureextensionui. Do you know why it would be getting thrown here?

@dbreshears dbreshears added this to the 1.1.0 milestone Mar 3, 2020
@ejizba
Copy link
Member

ejizba commented Mar 3, 2020

It's a generic error thrown when showTreeItemPicker doesn't find a matching item. Ravi did some work related to that here for other Docker scenarios: #1565

@bwateratmsft
Copy link
Contributor

@tobioge1 Due to a bug it is necessary to add the Azure registry provider, so that it appears in the Docker explorer tab. Run command Docker Registries: Connect Registry.... It will prompt to choose a provider for the registry, choose "Azure". Follow through any remaining prompts that occur. After that, it should allow you to go through with the Docker Registries: Deploy Image to Azure App Service... command.

@bwateratmsft
Copy link
Contributor

bwateratmsft commented Mar 5, 2020

@EricJizbaMSFT I found one possible fix, I wanted to run it past you. The bug is occurring because of this line, combined with the temp AzureAccountTreeItem created by the command: https://github.com/microsoft/vscode-azuretools/blob/5cac7faf9bf24b7c911dee4aa49e8e74fbcffd9f/ui/src/treeDataProvider/AzureAccountTreeItemBase.ts#L139

The command creates its own AzureAccountTreeItem, because the Azure provider may have been disconnected, but refers to the RegistriesTreeItem as its parent. The line above tells the RegistriesTreeItem to choose a child Azure SubscriptionTreeItem...but since the temporary AzureAccountTreeItem is not an actual child of RegistriesTreeItem, it fails.

So, one fix would be to call await me.pickChildTreeItem([SubscriptionTreeItemBase.contextValue], context) instead of await me.treeDataProvider.showTreeItemPicker(SubscriptionTreeItemBase.contextValue, context). This keeps the RegistriesTreeItem out of the picture, so to speak. I tried this and was successful.

Another option would be to first walk them through the process of getting that Azure provider connected if it isn't. I haven't looked yet; I assume this would be a bit more complicated but should work. Arguably it's more "correct" since, if you're deploying to Azure App Service, you should probably have the provider connected anyway.

Do you have a preference?

@ejizba
Copy link
Member

ejizba commented Mar 5, 2020

showTreeItemPicker supports passing in a startingTreeItem. If you pass in the account tree item as the startingTreeItem, would that also "keep the RegistriesTreeItem out of the picture"?

@bwateratmsft
Copy link
Contributor

Yes, that works as well. I like your idea better. 😄

@bwateratmsft
Copy link
Contributor

Created microsoft/vscode-azuretools#667.

@bwateratmsft
Copy link
Contributor

Wasn't meant to auto-close yet.

@bwateratmsft bwateratmsft reopened this Mar 5, 2020
@bwateratmsft bwateratmsft removed their assignment Mar 6, 2020
@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.