Azure-Samples / azure-django-postgres-flexible-aca

Web app using Python Django backend, set up for deployment to Azure Container Apps with Azure PostgreSQL Flexible Server.
MIT License
18 stars 31 forks source link

Run `azd pipeline config` requires additional operations on Dev Container #72

Open v-jiaodi opened 1 year ago

v-jiaodi commented 1 year ago

Describe the issue: When run azd pipeline config in Dev Container, get error as follow: image

Repro Steps:

  1. Clone the repo to local and reopen with Dev Container.
  2. Run azd auth login
  3. Run azd pipeline config

Environment:

Expected behavior: Run azd pipeline config can pass on Dev Container.

@pamelafox for notification.

pamelafox commented 1 year ago

Looks like it might be https://github.com/microsoft/vscode-remote-release/issues/8488#issuecomment-1549107575 cc @kjaymiller

Does it happen reliably or sporadically?

v-jiaodi commented 1 year ago

@pamelafox Tried multiple times, it happen reliably.

kjaymiller commented 1 year ago

This does seem to happen for me as well...

Looks like it might be microsoft/vscode-remote-release#8488 (comment) cc @kjaymiller

That issue mentioned that it was supposed to be fixed in an update to DevContainers... can we verify that Codespaces uses that new version of DevContainers or should we just add the git safe configuration to include the directory

v-jiaodi commented 1 year ago

@kjaymiller There is no such issue with CodeSpace and add the git safe configuration to include the directory can reslove it in DevContainer.

pamelafox commented 1 year ago

I've filed this with azd team to see if they have suggestions, since I don't know why this would be specific to our sample: https://github.com/Azure/azure-dev/issues/2934

pamelafox commented 1 year ago

Comment from azd team from another thread:

"azd pipeline config won't work from codespaces if you used device-code for auth.

There's a codespaces limitation, as the container hosting the codespaces is not an enrolled-device to Msft, so it can't access MSGraph to create ServicePrincipals.

There's an ugly workaround in case you really need to run pipeline config on codespaces, but I would suggest running that command from your local computer instead"

v-jiaodi commented 1 year ago

@pamelafox I'm sorry for the misunderstanding caused by my mistake. This issue occurs on Dev Container instead of CodeSpace.

For testing azd pipeline config inside codespaces, azd team provided us with specific documents, refer to: https://microsoft.sharepoint.com/:w:/t/AzureDeveloperCLIazdPartners/Eb8miZZ_b01NsmOI1wPoDxEBC1h6SE8wqDNfgDrP4A-7QQ?e=BmYI2p