Skip to content

Commit dd94498

Browse files
authored
Merge branch 'Azure:dev' into agentcreate
2 parents fabec83 + 71df7d7 commit dd94498

File tree

599 files changed

+424578
-267931
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

599 files changed

+424578
-267931
lines changed

.github/ISSUE_TEMPLATE/what_if.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: "What-If Feature Issue"
2+
description: Report issues or request enhancements for Azure CLI What-If feature
3+
labels: ["what-if"]
4+
body:
5+
- type: markdown
6+
id: intro
7+
attributes:
8+
value: |
9+
Thank you for reporting an issue related to preview of changes (--what-if) or export to Bicep (--export-bicep) with az cli! Please provide as much detail as possible.
10+
11+
- type: dropdown
12+
id: issue-type
13+
attributes:
14+
label: Issue Type
15+
description: What type of issue are you reporting?
16+
options:
17+
- Bug Report
18+
- Feature Request
19+
- Documentation Issue
20+
validations:
21+
required: true
22+
23+
- type: textarea
24+
id: description
25+
attributes:
26+
label: Description
27+
description: Provide a clear description of the issue or feature request
28+
placeholder: Describe what happened or what you'd like to see
29+
validations:
30+
required: true
31+
32+
- type: textarea
33+
id: command
34+
attributes:
35+
label: Command or Script
36+
description: Provide the command or script that helps reproducing or demonstrate the issue
37+
placeholder: |
38+
- az vm create --what-if --export-bicep
39+
- N/A if not applicable
40+
render: shell
41+
validations:
42+
required: true
43+
44+
- type: textarea
45+
id: expected
46+
attributes:
47+
label: Expected Behavior
48+
description: What did you expect to happen?
49+
placeholder: |
50+
- Describe the expected outcome
51+
- N/A if not applicable
52+
validations:
53+
required: true
54+
55+
- type: textarea
56+
id: actual
57+
attributes:
58+
label: Actual Behavior
59+
description: What actually happened?
60+
placeholder: |
61+
- Describe what actually occurred
62+
- N/A if not applicable
63+
validations:
64+
required: true
65+
66+
- type: textarea
67+
id: environment
68+
attributes:
69+
label: Environment
70+
description: Provide environment details
71+
placeholder: |
72+
- OS: Windows 11 / Ubuntu 22.04 / macOS 14
73+
- Tool Version: Azure CLI 2.80.0
74+
- Python Version: 3.12.10
75+
- N/A if not applicable
76+
validations:
77+
required: true
78+
79+
- type: textarea
80+
id: additional
81+
attributes:
82+
label: Additional Context
83+
description: Add any other context, screenshots, or logs
84+
placeholder: Any additional information that might be helpful
85+
validations:
86+
required: false

.github/workflows/RunIssueSentinel.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@ jobs:
1212
- name: Run Issue Sentinel
1313
uses: Azure/issue-sentinel@v1
1414
with:
15-
password: ${{secrets.ISSUE_SENTINEL_PASSWORD}}
1615
enable-similar-issues-scanning: true
1716
enable-security-issues-scanning: true

.vscode/launch.json

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"configurations": [
44
{
55
"name": "Azure CLI Debug (Integrated Console)",
6-
"type": "python",
6+
"type": "debugpy",
77
"request": "launch",
88
"python": "${command:python.interpreterPath}",
99
"program": "${workspaceRoot}/src/azure-cli/azure/cli/__main__.py",
@@ -12,33 +12,24 @@
1212
"--help"
1313
],
1414
"console": "integratedTerminal",
15-
"debugOptions": [
16-
"WaitOnAbnormalExit",
17-
"WaitOnNormalExit",
18-
"RedirectOutput"
19-
],
2015
"justMyCode": false
2116
},
2217
{
2318
"name": "Azure CLI Debug (External Console)",
24-
"type": "python",
19+
"type": "debugpy",
2520
"request": "launch",
2621
"stopOnEntry": true,
2722
"python": "${command:python.interpreterPath}",
2823
"program": "${workspaceRoot}/src/azure-cli/azure/cli/__main__.py",
2924
"cwd": "${workspaceRoot}",
3025
"args": [
31-
"--help"
26+
"--version"
3227
],
3328
"console": "externalTerminal",
34-
"debugOptions": [
35-
"WaitOnAbnormalExit",
36-
"WaitOnNormalExit"
37-
]
3829
},
3930
{
4031
"name": "Azdev Scripts",
41-
"type": "python",
32+
"type": "debugpy",
4233
"request": "launch",
4334
"python": "${command:python.interpreterPath}",
4435
"program": "${workspaceRoot}/tools/automation/__main__.py",
@@ -47,11 +38,6 @@
4738
"--help"
4839
],
4940
"console": "integratedTerminal",
50-
"debugOptions": [
51-
"WaitOnAbnormalExit",
52-
"WaitOnNormalExit",
53-
"RedirectOutput"
54-
]
5541
}
5642
]
57-
}
43+
}

src/azure-cli-core/HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
Release History
44
===============
55

6+
2.81.0
7+
++++++
8+
* Minor fixes
9+
610
2.80.0
711
++++++
812
* Minor fixes

src/azure-cli-core/azure/cli/core/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# --------------------------------------------------------------------------------------------
55
# pylint: disable=line-too-long
66

7-
__version__ = "2.80.0"
7+
__version__ = "2.81.0"
88

99
import os
1010
import sys
@@ -120,6 +120,9 @@ def get_cli_version(self):
120120

121121
def show_version(self):
122122
from azure.cli.core.util import get_az_version_string, show_updates
123+
from azure.cli.core import telemetry
124+
125+
telemetry.set_command_details(command="", parameters=["--version"])
123126

124127
ver_string, updates_available_components = get_az_version_string()
125128
print(ver_string)

src/azure-cli-core/azure/cli/core/tests/test_telemetry.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# --------------------------------------------------------------------------------------------
55

66
import unittest
7+
from unittest import mock
78

89

910
class TestCoreTelemetry(unittest.TestCase):
@@ -57,3 +58,24 @@ def test_cloud_forbid_telemetry(self):
5758
# mock to add current cloud name in CLOUDS_FORBIDDING_TELEMETRY
5859
with mock.patch('azure.cli.core.cloud.CLOUDS_FORBIDDING_TELEMETRY', [az_cli.cloud.name]):
5960
self.assertFalse(telemetry.is_telemetry_enabled())
61+
62+
@mock.patch('azure.cli.core.util.get_az_version_string')
63+
def test_show_version_sets_telemetry_params(self, mock_get_version):
64+
"""Test show_version telemetry state is same regardless of available updates."""
65+
from azure.cli.core.mock import DummyCli
66+
from azure.cli.core import telemetry
67+
from knack.completion import ARGCOMPLETE_ENV_NAME
68+
69+
mock_get_version.return_value = ("azure-cli 2.80.0", ["core", "extension1"])
70+
71+
telemetry.start()
72+
73+
cli = DummyCli()
74+
telemetry.set_application(cli, ARGCOMPLETE_ENV_NAME)
75+
76+
cli.show_version()
77+
78+
session = telemetry._session
79+
self.assertEqual(session.command, "")
80+
self.assertEqual(session.parameters, ["--version"])
81+
self.assertIsNone(session.raw_command)

src/azure-cli-core/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from codecs import open
99
from setuptools import setup, find_packages
1010

11-
VERSION = "2.80.0"
11+
VERSION = "2.81.0"
1212

1313
# If we have source, validate that our version numbers match
1414
# This should prevent uploading releases with mismatched versions.

src/azure-cli/HISTORY.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,27 @@
33
Release History
44
===============
55

6+
2.81.0
7+
++++++
8+
9+
**AKS**
10+
11+
* `az aks safeguards`: Add `--pss-level` parameter to support Pod Security Standards (#32432)
12+
* `az aks safeguards create`: Add validation to prevent duplicate resource creation (#32432)
13+
14+
**ARM**
15+
16+
* Fix #32098: `az bicep install`: Fix a bug where the installation was skipped when `--version` was specified unless `bicep.use_binary_from_path` was explicitly set to `false` (#32337)
17+
18+
**Compute**
19+
20+
* `az vm/vmss application set`: Add new parameter `--enable-automatic-upgrade` to support enabling application automatic upgrade (#32394)
21+
22+
**NetAppFiles**
23+
24+
* `az netappfiles volume-group create`: Add `--network-features` parameter for volume groups (#32423)
25+
* `az netappfiles volume replication list`: Add `--exclude` parameter to exclude deleted replications (#32423)
26+
627
2.80.0
728
++++++
829

src/azure-cli/azure/cli/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from knack.log import get_logger
1818

1919
__author__ = "Microsoft Corporation <[email protected]>"
20-
__version__ = "2.80.0"
20+
__version__ = "2.81.0"
2121

2222

2323
logger = get_logger(__name__)

src/azure-cli/azure/cli/command_modules/acr/_docker_utils.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
from ._constants import get_managed_sku
2929
from ._constants import ACR_AUDIENCE_RESOURCE_NAME
3030
from ._utils import get_registry_by_name, ResourceNotFound
31-
from .policy import acr_config_authentication_as_arm_show
3231
from ._format import add_timestamp
3332
from ._errors import CONNECTIVITY_TOOMANYREQUESTS_ERROR
3433

@@ -135,18 +134,14 @@ def _get_aad_token_after_challenge(cli_ctx,
135134
artifact_repository,
136135
permission,
137136
is_diagnostics_context,
138-
use_acr_audience,
139137
verify_user_permissions):
140138
authurl = urlparse(token_params['realm'])
141139
authhost = urlunparse((authurl[0], authurl[1], '/oauth2/exchange', '', '', ''))
142140

143141
from azure.cli.core._profile import Profile
144142
profile = Profile(cli_ctx=cli_ctx)
145143

146-
scope = None
147-
if use_acr_audience:
148-
logger.debug("Using ACR audience token for authentication")
149-
scope = "https://{}.azure.net".format(ACR_AUDIENCE_RESOURCE_NAME)
144+
scope = "https://{}.azure.net".format(ACR_AUDIENCE_RESOURCE_NAME)
150145

151146
# this might be a cross tenant scenario, so pass subscription to get_raw_token
152147
creds, _, tenant = profile.get_raw_token(subscription=get_subscription_id(cli_ctx),
@@ -267,7 +262,6 @@ def _get_aad_token(cli_ctx,
267262
artifact_repository=None,
268263
permission=None,
269264
is_diagnostics_context=False,
270-
use_acr_audience=False,
271265
verify_user_permissions=False):
272266
"""Obtains refresh and access tokens for an AAD-enabled registry. Will return the allowed actions if
273267
verify_user_permissions is set to True.
@@ -296,7 +290,6 @@ def _get_aad_token(cli_ctx,
296290
artifact_repository,
297291
permission,
298292
is_diagnostics_context,
299-
use_acr_audience,
300293
verify_user_permissions)
301294

302295

@@ -453,19 +446,12 @@ def _get_credentials(cmd, # pylint: disable=too-many-statements
453446
if not registry or registry.sku.name in get_managed_sku(cmd):
454447
logger.info("Attempting to retrieve AAD refresh token...")
455448
try:
456-
use_acr_audience = False
457-
458-
if registry:
459-
aad_auth_policy = acr_config_authentication_as_arm_show(cmd, registry_name, resource_group_name)
460-
use_acr_audience = (aad_auth_policy and aad_auth_policy.status == 'disabled')
461-
462449
return login_server, EMPTY_GUID, _get_aad_token(cli_ctx,
463450
login_server,
464451
only_refresh_token,
465452
repository,
466453
artifact_repository,
467-
permission,
468-
use_acr_audience=use_acr_audience)
454+
permission)
469455
except CLIError as e:
470456
raise_toomanyrequests_error(str(e))
471457
logger.warning("%s: %s", AAD_TOKEN_BASE_ERROR_MESSAGE, str(e))

0 commit comments

Comments
 (0)