You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add experimental feature to AzureCLIV2 which keeps the session running in the background in the case of ARM service connections with workload identity federation scheme (#19989)
Today, any attempts made to get the access token for a different resource than originally will fail with the Entra error AADSTS700024 after the IdToken expires, which is after 10 minutes. The same happens 60 minutes after the issuance date of the original access token, when it expires, and we cannot refresh. This change is a tactical solution to this problem that is to be used until az-cli supports this internally. This is an EXPERIMENTAL feature which means we provide no guarantees and no support for it. That said, it should work well for 99.9% of the cases. Please note that this feature can be removed at any point in time, particularly when az-cli delivers the long-term solution to this problem.
Copy file name to clipboardExpand all lines: Tasks/AzureCLIV2/Strings/resources.resjson/en-US/resources.resjson
+6-1
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,8 @@
31
31
"loc.input.help.powerShellIgnoreLASTEXITCODE": "If this is false, the line `if ((Test-Path -LiteralPath variable:\\LASTEXITCODE)) { exit $LASTEXITCODE }` is appended to the end of your script. This will cause the last exit code from an external command to be propagated as the exit code of powershell. Otherwise the line is not appended to the end of your script.",
32
32
"loc.input.label.visibleAzLogin": "az login output visibility",
33
33
"loc.input.help.visibleAzLogin": "If this is set to true, az login command will output to the task. Setting it to false will suppress the az login output",
"loc.input.help.keepAzSessionActive": "When enabled, this task will continuously sign into Azure to avoid AADSTS700024 errors when requesting access tokens beyond the IdToken expiry date. Note that this feature is EXPERIMENTAL, may not work in all scenarios and you are using it without any guarantees. Valid only for service connections using the Workload Identity Federation authentication scheme.",
34
36
"loc.messages.ScriptReturnCode": "Script exited with return code: %d",
35
37
"loc.messages.ScriptFailed": "Script failed with error: %s",
36
38
"loc.messages.ScriptFailedStdErr": "Script has output to stderr. Failing as failOnStdErr is set to true.",
@@ -49,5 +51,8 @@
49
51
"loc.messages.GlobalCliConfigAgentVersionWarning": "For agent version < 2.115.0, only global Azure CLI configuration can be used",
50
52
"loc.messages.UnacceptedScriptLocationValue": "%s is not a valid value for task input 'Script Location' (scriptLocation in YAML). Value can either be'inlineScript' or 'scriptPath'",
51
53
"loc.messages.ExpiredServicePrincipalMessageWithLink": "Secret expired, update service connection at %s See https://aka.ms/azdo-rm-workload-identity-conversion to learn more about conversion to secret-less service connections.",
52
-
"loc.messages.ProxyConfig": "az tool is configured to use %s as proxy server"
54
+
"loc.messages.ProxyConfig": "az tool is configured to use %s as proxy server",
55
+
"loc.messages.FailedToRefreshAzSession": "The following error occurred while trying to refresh az-cli session: %s",
56
+
"loc.messages.RefreshingAzSession": "Attempting to refresh az-cli session...",
57
+
"loc.messages.KeepingAzSessionActiveUnsupportedScheme": "The 'keepAzSessionActive' input might be used only for workload identity federation ARM service connection. The referenced service endpoint auth scheme was unexpected: %s. Change the scheme or remove 'keepAzSessionActive' input."
"helpMarkDown": "When enabled, this task will continuously sign into Azure to avoid AADSTS700024 errors when requesting access tokens beyond the IdToken expiry date. Note that this feature is EXPERIMENTAL, may not work in all scenarios and you are using it without any guarantees. Valid only for service connections using the Workload Identity Federation authentication scheme.",
191
+
"groupName": "advanced"
192
+
}
184
193
],
185
194
"execution": {
186
195
"Node10": {
@@ -211,6 +220,9 @@
211
220
"GlobalCliConfigAgentVersionWarning": "For agent version < 2.115.0, only global Azure CLI configuration can be used",
212
221
"UnacceptedScriptLocationValue": "%s is not a valid value for task input 'Script Location' (scriptLocation in YAML). Value can either be'inlineScript' or 'scriptPath'",
213
222
"ExpiredServicePrincipalMessageWithLink": "Secret expired, update service connection at %s See https://aka.ms/azdo-rm-workload-identity-conversion to learn more about conversion to secret-less service connections.",
214
-
"ProxyConfig":"az tool is configured to use %s as proxy server"
223
+
"ProxyConfig":"az tool is configured to use %s as proxy server",
224
+
"FailedToRefreshAzSession": "The following error occurred while trying to refresh az-cli session: %s",
225
+
"RefreshingAzSession": "Attempting to refresh az-cli session...",
226
+
"KeepingAzSessionActiveUnsupportedScheme": "The 'keepAzSessionActive' input might be used only for workload identity federation ARM service connection. The referenced service endpoint auth scheme was unexpected: %s. Change the scheme or remove 'keepAzSessionActive' input."
Copy file name to clipboardExpand all lines: _generated/AzureCLIV2/Strings/resources.resjson/en-US/resources.resjson
+6-1
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,8 @@
31
31
"loc.input.help.powerShellIgnoreLASTEXITCODE": "If this is false, the line `if ((Test-Path -LiteralPath variable:\\LASTEXITCODE)) { exit $LASTEXITCODE }` is appended to the end of your script. This will cause the last exit code from an external command to be propagated as the exit code of powershell. Otherwise the line is not appended to the end of your script.",
32
32
"loc.input.label.visibleAzLogin": "az login output visibility",
33
33
"loc.input.help.visibleAzLogin": "If this is set to true, az login command will output to the task. Setting it to false will suppress the az login output",
"loc.input.help.keepAzSessionActive": "When enabled, this task will continuously sign into Azure to avoid AADSTS700024 errors when requesting access tokens beyond the IdToken expiry date. Note that this feature is EXPERIMENTAL, may not work in all scenarios and you are using it without any guarantees. Valid only for service connections using the Workload Identity Federation authentication scheme.",
34
36
"loc.messages.ScriptReturnCode": "Script exited with return code: %d",
35
37
"loc.messages.ScriptFailed": "Script failed with error: %s",
36
38
"loc.messages.ScriptFailedStdErr": "Script has output to stderr. Failing as failOnStdErr is set to true.",
@@ -49,5 +51,8 @@
49
51
"loc.messages.GlobalCliConfigAgentVersionWarning": "For agent version < 2.115.0, only global Azure CLI configuration can be used",
50
52
"loc.messages.UnacceptedScriptLocationValue": "%s is not a valid value for task input 'Script Location' (scriptLocation in YAML). Value can either be'inlineScript' or 'scriptPath'",
51
53
"loc.messages.ExpiredServicePrincipalMessageWithLink": "Secret expired, update service connection at %s See https://aka.ms/azdo-rm-workload-identity-conversion to learn more about conversion to secret-less service connections.",
52
-
"loc.messages.ProxyConfig": "az tool is configured to use %s as proxy server"
54
+
"loc.messages.ProxyConfig": "az tool is configured to use %s as proxy server",
55
+
"loc.messages.FailedToRefreshAzSession": "The following error occurred while trying to refresh az-cli session: %s",
56
+
"loc.messages.RefreshingAzSession": "Attempting to refresh az-cli session...",
57
+
"loc.messages.KeepingAzSessionActiveUnsupportedScheme": "The 'keepAzSessionActive' input might be used only for workload identity federation ARM service connection. The referenced service endpoint auth scheme was unexpected: %s. Change the scheme or remove 'keepAzSessionActive' input."
"helpMarkDown": "When enabled, this task will continuously sign into Azure to avoid AADSTS700024 errors when requesting access tokens beyond the IdToken expiry date. Note that this feature is EXPERIMENTAL, may not work in all scenarios and you are using it without any guarantees. Valid only for service connections using the Workload Identity Federation authentication scheme.",
191
+
"groupName": "advanced"
183
192
}
184
193
],
185
194
"execution": {
@@ -211,10 +220,13 @@
211
220
"GlobalCliConfigAgentVersionWarning": "For agent version < 2.115.0, only global Azure CLI configuration can be used",
212
221
"UnacceptedScriptLocationValue": "%s is not a valid value for task input 'Script Location' (scriptLocation in YAML). Value can either be'inlineScript' or 'scriptPath'",
213
222
"ExpiredServicePrincipalMessageWithLink": "Secret expired, update service connection at\u00A0%s See\u00A0https://aka.ms/azdo-rm-workload-identity-conversion to learn more about conversion to secret-less service connections.",
214
-
"ProxyConfig": "az tool is configured to use %s as proxy server"
223
+
"ProxyConfig": "az tool is configured to use %s as proxy server",
224
+
"FailedToRefreshAzSession": "The following error occurred while trying to refresh az-cli session: %s",
225
+
"RefreshingAzSession": "Attempting to refresh az-cli session...",
226
+
"KeepingAzSessionActiveUnsupportedScheme": "The 'keepAzSessionActive' input might be used only for workload identity federation ARM service connection. The referenced service endpoint auth scheme was unexpected: %s. Change the scheme or remove 'keepAzSessionActive' input."
0 commit comments