* WIP: Support fetching credentials from an external process
This change sketches out a possible way for `azd` to delegate
authentication to an external process and teaches the VS Code
extension to use this strategy to provide authentication for `azd`
based on the credential associated with the Azure Account extension.
This works by introducing a new "Remote Credential" type in `azd`, is
used when `AZD_AUTH_ENDPOINT` and `AZD_AUTH_KEY` are defined in the
system environment. When these values are set and `azd` needs to
request a token, it makes a request to
`${AZD_AUTH_ENDPOINT/token?api-version=2023-07-12-preview` using
`${AZD_AUTH_KEY}` as an bearer token to secure the request.
The body of the request body contains a serialized version of the
`TokenRequestOptions` struct:
```
{
scopes: []string
tenantId: string?
}
```
The server is expected to respond with 200 OK and a body that
represents the result of trying to fetch a token (either success or
failure). One of the two following shapes is expected for the
response:
```
{
status: "success"
token: string
expiresOn: string // (RFC3339 format)
}
```
or
```
{
status: "error"
code: "GetTokenError" | "NotLoggedInError"
message: string // Suitable for display to a human.
}
```
This behavior is currently controlled by a setting
`azure-dev.auth.useIntegratedAuth` which defaults to false. You need
both the updated extension and a version of `azd` which supports this.
Contributes To: #1741
* Have `azd login` rendezvous with external auth server
* Updating templates to use the devconatiner feature
* Using the latest tag for feature
* Removing apt-install of azd deps in Dockerfile
* update two more from stable to latest
* remove base dockerfile
* add image for devcontainer.json without dockerfile
* add specific azd version in readme
* fix folder for python/nodejs
* fix json not found bug
---------
Co-authored-by: hemarina <hemarina@microsoft.com>
* Adding devcontainer definition - #1095
* Update ext/devcontainer/devcontainer-feature.json
* adding workflow to publish devcontainer image
* Update ext/devcontainer/devcontainer-feature.json
* Update ext/devcontainer/README.md
* adding tests and supporting the expected folder structure
* ensuring curl is available and fixing tests
* Update ext/devcontainer/src/azd/install.sh
Co-authored-by: Daniel Jurek <djurek@microsoft.com>
* combining devcontainer workflows into a single workflow
- test jobs need to pass before deploy passes
- deploy job linked to environment for approval
* Updating based on some feedback
Turns out that the script being run was uninstall not install, whoops
* Apply suggestions from code review
Co-authored-by: hemarina <104857065+hemarina@users.noreply.github.com>
* Apply suggestions from code review
* Update ext/devcontainer/src/azd/README.md
Co-authored-by: Aaron Powell <me@aaron-powell.com>
* Update ext/devcontainer/src/azd/install.sh
Co-authored-by: Aaron Powell <me@aaron-powell.com>
* Update ext/devcontainer/src/azd/install.sh
Co-authored-by: hemarina <104857065+hemarina@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: hemarina <104857065+hemarina@users.noreply.github.com>
* Update ext/devcontainer/src/azd/devcontainer-feature.json
Co-authored-by: Matt Ellis <matt.ellis@microsoft.com>
* Update ext/devcontainer/src/azd/README.md
* add xdg-utils/version due to local test/feedback
* remove since vscode-node-azure-pack contains it
* add auto pr for documentation update
* separate release and test, add permission
* add workflow test yml
* add PAT for release tag
---------
Co-authored-by: Daniel Jurek <djurek@microsoft.com>
Co-authored-by: Victor Vazquez <vhvb1989@gmail.com>
Co-authored-by: hemarina <104857065+hemarina@users.noreply.github.com>
Co-authored-by: Matt Ellis <matt.ellis@microsoft.com>
Co-authored-by: hemarina <hemarina@microsoft.com>
Make `services` not required; clean-up project config.
It's perfectly fine to have an `azure.yaml` that only does provision. A minimal `azure.yaml` and running `azd deploy` and `azd restore` works correctly.
Project config was also littered with unset properties when running `azd init` with "empty template" selected. This change cleans up the `azure.yaml` generated.
Before:
```yaml
name: test3
infra:
provider: ""
path: ""
module: ""
pipeline:
provider: ""
```
After:
```yaml
name: test3
```
Fixes#1162
This gives the user a chance to interact with the command and fixes https://github.com/Azure/azure-dev/issues/2045
Also refactors the code that runs VS Code unit tests, and upgrades `test-electron` library to fix tests failing with `Error: spawn UNKNOWN` message on Windows
* update uvicorn to 0.19 to match Starlette 0.25.0
* match org.springframework:spring-core to 5.3.26
* Upgrade to version org.apache.tomcat 9.0.73
* revert springframework back to 4.0.0
* reflect xml2js to 0.5.0
* reflect starlette 0.25.0
* upgrade xml2js
* upgrade System.Drawing.Common
* Update pom.xml
---------
Co-authored-by: Victor Vazquez <victor.vazquez@microsoft.com>