-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Add new AzureCLI authentication options for GenerateResourcesAndImage and Packer templates #10602
Conversation
Fixed slight adjustment to suggestion in #10236 to properly handle the error if not logged in, it would not enter the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested UseAzureCliAuth option based on the code above and works as expected.
@mikhailkoliada @shamil-mubarakshin |
We are currently waiting for this as well, since we prefer to use OIDC authentication (federated) instead of client secrets in our devops pipelines. Would be great if this can be released short term. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i got that azufe certific in an milestone oslt. check where its from =) its been an few days bender.
@subir0071 - After nearly 6 months without any review or even a comment from any approvers, maintainers, or code owners, you're just closing this PR? This approach is incredibly ridiculous. Why not remove CONTRIBUTING.md altogether instead of wasting everyone's time? |
@subir0071 What the hell are you doing here?! This PR was verified by several people, and standard Azure CLI was used, for crying out loud! Do you think we're all incompetent or something?! |
My apologies and we really believe all our contributors are much important.
Please let me know if I am missing something here. |
If you know of any other way to check if you're already logged in to the Azure CLI (without making it interactive) and without generating unnecessary exceptions or error outputs, please let me know. If you're not logged in, it always produces output to I can't quite remember why I included
Yes, if you're not providing your own |
I’d also like to point out that if the changes in This also provides the flexibility to use your Packer templates with Azure CLI authentication, rather than being required to use a Service Principal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes:
Adds a new parameter UseAzureCliAuth to the GenerateResourcesAndImage.ps1 script.
Updates Packer templates for various OS versions to include the use_azure_cli_auth variable.
Modifies authentication logic to use Azure CLI credentials if UseAzureCliAuth is enabled.
Benefits:
Simplifies Authentication: No need for privileged Microsoft Entra roles or pre-registered Service Principals.
Reduces Overhead: Eliminates the need to manage and rotate Service Principal secrets.
Integration: Easily integrates with Azure CLI tasks in Azure Pipelines and GitHub Actions.
Flexibility: Provides an option to use existing Azure CLI login credentials for authentication.
These changes enhance the flexibility and ease of use for authenticating with Azure, particularly in automated environments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
This PR introduces new authentication options for the GenerateResourcesAndImage.ps1 helper script and the Packer templates for
ubuntu
andwindows
. By leveraging theuse_azure_cli_auth
optional value in Packerazure-arm
builder (ref) this PR provides new ways to authenticate while building the runner-images.UseAzureCliAuth
is introduced in the helper script.az login
.AzureClientId
parameterfalse
in both the helper-script and packer-templates and does not break the approach of using SPN authenticationWhat advantages does using the new switch give?
Application Developer
orApplication Administrator
to run script / build withoutAzureClientId
andAzureClientSecret
inputs.AzureClientId
andAzureClientSecret
inputs.Azure Pipeline example using new UseAzureCliAuth switch
Service-connection is using Azure managed identity and federated credentials
Azure Pipeline example using old SPN method
Service-connection is using Azure managed identity and federated credentials
Running locally using my az login credentials only
Related issue:
#10236 - I added the suggestion to let active
az login
be used if foundCheck list