Skip to content

Adds FederatedIdentityCredentials (FICS) request builders to Graph Client#1086

Merged
wbreza merged 15 commits into
Azure:mainfrom
wbreza:graph-fics
Nov 8, 2022
Merged

Adds FederatedIdentityCredentials (FICS) request builders to Graph Client#1086
wbreza merged 15 commits into
Azure:mainfrom
wbreza:graph-fics

Conversation

@wbreza

@wbreza wbreza commented Nov 3, 2022

Copy link
Copy Markdown
Contributor

Addresses #408

  • Adds request builders to manage federated identity credentials (fics) to Azure AD Graph applications.
  • Adds new --auth-type flag for azd pipeline config. Valid values: federated, client-credentials
  • Defaults github auth to Federated
  • Updates Github pipeline provider for Federated support

When auth type is Federated in a valid configuration, azd will create a federated identity credential on the new/updated service principal for the following subjects:

  • repo:${REPO}:ref:refs/heads/main
  • repo:${REPO}:pull_request

References

Pipeline providers

Github

Auth Default: Federated
Supported Auth: Federated, ClientCredentials

Github secret configuration is different between Federated and ClientCredentials. The github workflow has been setup to test which secrets have been defined and then use the correct version of the az login command.

Azure DevOps

Auth Default: ClientCredentials
Supported Auth: ClientCredentials

Display error if --auth-type is explicitly set to Federated**(not supported)**

Provision Providers

Bicep

Auth Default: Federated
Supported Auth: Federated, ClientCredentials

Terraform

Auth Default: ClientSecret
Supported Auth: ClientCredentials

Display warning if --auth-type isn't defined (falling back to ClientCredentials)
Display error if --auth-type is explicitly set to Federated**(not supported)**

@ghost ghost assigned wbreza Nov 3, 2022
@wbreza wbreza changed the title Adds FederatedIdentityCredentials request builders to Graph Client Adds FederatedIdentityCredentials (FICS) request builders to Graph Client Nov 3, 2022
Comment thread cli/azd/cmd/pipeline.go
@weikanglim

Copy link
Copy Markdown
Contributor

Do you have a link to the issue that describes the requirements? Are we creating the oidc application or are we using one that is user-provided?

Comment thread cli/azd/pkg/commands/pipeline/github_provider.go Outdated
Comment thread cli/azd/pkg/commands/pipeline/github_provider.go
Comment thread cli/azd/pkg/commands/pipeline/github_provider.go Outdated
Comment thread cli/azd/pkg/commands/pipeline/github_provider.go
Comment thread cli/azd/pkg/commands/pipeline/github_provider.go Outdated
Comment thread cli/azd/pkg/commands/pipeline/github_provider.go Outdated
@wbreza wbreza added cli feature Feature request labels Nov 7, 2022
@wbreza wbreza added this to the Backlog milestone Nov 7, 2022
@wbreza

wbreza commented Nov 7, 2022

Copy link
Copy Markdown
Contributor Author

Do you have a link to the issue that describes the requirements? Are we creating the oidc application or are we using one that is user-provided?

Mentioned issue #408

@wbreza
wbreza marked this pull request as ready for review November 7, 2022 22:23
Comment thread cli/azd/cmd/root.go Outdated
Comment thread cli/azd/pkg/commands/pipeline/azdo_provider.go Outdated
Comment thread cli/azd/pkg/commands/pipeline/github_provider.go Outdated
Comment thread cli/azd/pkg/commands/pipeline/github_provider.go Outdated
Comment thread cli/azd/pkg/commands/pipeline/github_provider.go
Comment thread .vscode/cspell.global.yaml Outdated
Comment thread cli/azd/pkg/commands/pipeline/github_provider.go Outdated

@jongio jongio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on Windows and todo-java-mongo. Works great!

Comment thread cli/azd/pkg/commands/pipeline/github_provider.go Outdated
@azure-sdk

Copy link
Copy Markdown
Collaborator

Repoman Generation Results

Repoman pushed changes to remotes for the following projects:

Project: todo-csharp-cosmos-sql

Remote: azure-samples-staging

Branch: pr/1086

You can initialize this project with:

azd init -t Azure-Samples/todo-csharp-cosmos-sql -b pr/1086

View Changes | Compare Changes


Project: todo-csharp-sql-swa-func

Remote: azure-samples-staging

Branch: pr/1086

You can initialize this project with:

azd init -t Azure-Samples/todo-csharp-sql-swa-func -b pr/1086

View Changes | Compare Changes


Project: todo-csharp-sql

Remote: azure-samples-staging

Branch: pr/1086

You can initialize this project with:

azd init -t Azure-Samples/todo-csharp-sql -b pr/1086

View Changes | Compare Changes


Project: todo-java-mongo-aca

Remote: azure-samples-staging

Branch: pr/1086

You can initialize this project with:

azd init -t Azure-Samples/todo-java-mongo-aca -b pr/1086

View Changes | Compare Changes


Project: todo-java-mongo

Remote: azure-samples-staging

Branch: pr/1086

You can initialize this project with:

azd init -t Azure-Samples/todo-java-mongo -b pr/1086

View Changes | Compare Changes


Project: todo-nodejs-mongo-aca

Remote: azure-samples-staging

Branch: pr/1086

You can initialize this project with:

azd init -t Azure-Samples/todo-nodejs-mongo-aca -b pr/1086

View Changes | Compare Changes


Project: todo-nodejs-mongo-swa-func

Remote: azure-samples-staging

Branch: pr/1086

You can initialize this project with:

azd init -t Azure-Samples/todo-nodejs-mongo-swa-func -b pr/1086

View Changes | Compare Changes


Project: todo-nodejs-mongo

Remote: azure-samples-staging

Branch: pr/1086

You can initialize this project with:

azd init -t Azure-Samples/todo-nodejs-mongo -b pr/1086

View Changes | Compare Changes


Project: todo-python-mongo-aca

Remote: azure-samples-staging

Branch: pr/1086

You can initialize this project with:

azd init -t Azure-Samples/todo-python-mongo-aca -b pr/1086

View Changes | Compare Changes


Project: todo-python-mongo-swa-func

Remote: azure-samples-staging

Branch: pr/1086

You can initialize this project with:

azd init -t Azure-Samples/todo-python-mongo-swa-func -b pr/1086

View Changes | Compare Changes


Project: todo-python-mongo

Remote: azure-samples-staging

Branch: pr/1086

You can initialize this project with:

azd init -t Azure-Samples/todo-python-mongo -b pr/1086

View Changes | Compare Changes


@azure-sdk

Copy link
Copy Markdown
Collaborator

Azure Dev CLI Install Instructions

Install scripts

MacOS/Linux

May elevate using sudo on some platforms and configurations

bash:

curl -fsSL https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/1086/uninstall-azd.sh | bash;
curl -fsSL https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/1086/install-azd.sh | bash -s -- --base-url https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/1086 --version '' --verbose

pwsh:

Invoke-RestMethod 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/1086/uninstall-azd.ps1' -OutFile uninstall-azd.ps1; ./uninstall-azd.ps1
Invoke-RestMethod 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/1086/install-azd.ps1' -OutFile install-azd.ps1; ./install-azd.ps1 -BaseUrl 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/1086' -Version '' -Verbose

Windows

powershell -c "Set-ExecutionPolicy Bypass Process; irm 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/1086/uninstall-azd.ps1' > uninstall-azd.ps1; ./uninstall-azd.ps1;"
powershell -c "Set-ExecutionPolicy Bypass Process; irm 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/1086/install-azd.ps1' > install-azd.ps1; ./install-azd.ps1 -BaseUrl 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/1086' -Version '' -Verbose;"

Standalone Binary

Container

docker run -it azdevcliextacr.azurecr.io/azure-dev:pr-1086

@ellismg ellismg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome to see this coming online! Code changes look great. A small question about the pipeline configuration. Excited for our secret-less future!

Comment thread templates/common/.github/workflows/bicep/azure-dev.yml

@vhvb1989 vhvb1989 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core-cli CLI commands, cmd/, internal/cmd/ feature Feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants