Add new AzureCLI authentication options for GenerateResourcesAndImage and Packer templates #10602
+67
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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