Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
8e36b7a
{Site} Add quickstart command and ARM template for Site + Config depl…
akanksha020901 Feb 10, 2026
8c5a364
{Site} Update help text for config-name argument in quickstart command
akanksha020901 Feb 10, 2026
03b58cd
{Site} Add location argument to quickstart command for deployment
akanksha020901 Feb 10, 2026
ca47836
{Site} Add AAZResourceLocationArg import for quickstart command
akanksha020901 Feb 10, 2026
5fa677c
{Site} Fix formatting in quickstart command argument definitions
akanksha020901 Feb 10, 2026
b906a47
{Site} Add argument formatting for site name in quickstart command
akanksha020901 Feb 11, 2026
1f3ca3e
Apply suggestion from @Copilot
akanksha020901 Feb 11, 2026
aac1e8b
Apply suggestion from @Copilot
akanksha020901 Feb 11, 2026
819a00a
Apply suggestion from @Copilot
akanksha020901 Feb 11, 2026
eb08a54
Merge branch 'developer/akanksha/site-config-cli' of https://github.c…
akanksha020901 Feb 11, 2026
1f3e672
{Site} Add resourceGroupName parameter with default value in main.json
akanksha020901 Feb 16, 2026
63d2ba2
{Site} Make resource group argument required in Quickstart command
akanksha020901 Feb 16, 2026
e199fc3
{Site} Enhance quickstart deployment with error suppression and succe…
akanksha020901 Feb 17, 2026
c76d5fe
{Site} Enhance error handling and messaging in quickstart deployment
akanksha020901 Feb 17, 2026
a23a275
{Site} Implement quickstart deployment enhancements with resource gro…
akanksha020901 Feb 19, 2026
ac97fe9
Refactor quickstart command help text and clean up whitespace in _qui…
akanksha020901 Feb 19, 2026
c4cfa7a
{Site} Update quickstart command examples to use correct configuratio…
akanksha020901 Feb 19, 2026
48c4586
{Site} Fix quickstart command example to use correct configuration ar…
akanksha020901 Feb 19, 2026
5e75a10
{Site} Fix quickstart command example to use correct shorthand for re…
akanksha020901 Feb 19, 2026
4513703
Refactor deployment output handling in quickstart command to improve …
akanksha020901 Mar 3, 2026
b6bb095
Fix formatting issues in _pick_failed_ops and _pick_succeeded_ids fun…
akanksha020901 Mar 5, 2026
3525f0c
Refactor quickstart command to enhance error handling and improve dep…
akanksha020901 Mar 6, 2026
4a62196
Add ARM template handling and configuration defaults to quickstart co…
akanksha020901 Mar 9, 2026
eb22336
feat: configuration creation in using 'az site quickstart' will now c…
guneet-xyz Mar 18, 2026
b0eafab
added config-type parameter to quickstart command for resource provis…
akanksha020901 Mar 23, 2026
4c2f6e2
fix: update default location to 'eastus' in quickstart command and AR…
akanksha020901 Apr 14, 2026
55a54bf
feat: add scope to site configuration in quickstart command
akanksha020901 Apr 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/site/azext_site/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,13 @@
# pylint: disable=too-many-lines

from knack.help_files import helps # pylint: disable=unused-import

helps['site quickstart'] = """
type: command
short-summary: Quickstart deploy Site + Config + ConfigRef using an internal ARM template.
examples:
- name: Resource group scope
text: az site quickstart --name MySite01 --defaultconfiguration -g MyRG -l eastus
- name: Subscription scope
text: az site quickstart --name MySite01 --defaultconfiguration -l eastus
Comment thread
akanksha020901 marked this conversation as resolved.
Outdated
"""
1 change: 1 addition & 0 deletions src/site/azext_site/aaz/latest/site/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
from ._list import *
from ._show import *
from ._update import *
from ._quickstart import *
103 changes: 103 additions & 0 deletions src/site/azext_site/aaz/latest/site/_quickstart.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

from pathlib import Path
from azure.cli.core.aaz import ( # type: ignore[import-unresolved]
AAZCommand,
AAZStrArg,
AAZBoolArg,
AAZResourceGroupNameArg,
has_value,
register_command,
)
from azure.cli.core.azclierror import ( # type: ignore[import-unresolved]
InvalidArgumentValueError,
FileOperationError,
CLIInternalError,
)
from azure.cli.core import get_default_cli # type: ignore[import-unresolved]


def _resolve_template_path() -> Path:
# ...\azext_site\aaz\latest\site\_quickstart.py -> ...\azext_site\templates\infra\main.json
azext_root = Path(__file__).resolve().parents[3] # ...\azext_site
return azext_root / "templates" / "infra" / "main.json"


@register_command("site quickstart")
class Quickstart(AAZCommand):
"""Quickstart: deploy internal ARM template to create Site + Config + ConfigRef."""

_args_schema = None
Comment on lines +281 to +285
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

A new user-facing command (site quickstart) and an embedded deployment template are introduced, but there is no scenario test covering it. Since this extension already has ScenarioTest coverage (e.g., test_site.py), add a test that runs az site quickstart ... and asserts the deployment succeeded / expected outputs are returned.

Copilot uses AI. Check for mistakes.

@classmethod
def _build_arguments_schema(cls, *args, **kwargs):
if cls._args_schema is not None:
return cls._args_schema

cls._args_schema = super()._build_arguments_schema(*args, **kwargs)
_args_schema = cls._args_schema

_args_schema.name = AAZStrArg(
options=["-n", "--name"],
required=True,
help="Site name (siteName).",
)
Comment thread
akanksha020901 marked this conversation as resolved.

_args_schema.defaultconfiguration = AAZBoolArg(
options=["--defaultconfiguration", "--default-configuration"],
help="Trigger the internal ARM template flow (Site + Config + ConfigRef).",
)

_args_schema.resource_group = AAZResourceGroupNameArg(
options=["-g", "--resource-group"],
required=True,
help="Resource group for deployment.",
)

_args_schema.config_name = AAZStrArg(
options=["--config-name"],
help="Optional configName override. Default in template: '<siteName>-configuration'.",
)

return cls._args_schema

def _handler(self, command_args):
super()._handler(command_args)

if not self.ctx.args.defaultconfiguration:
raise InvalidArgumentValueError("Specify --defaultconfiguration to run quickstart.")

return self.handle()

def handle(self):
template = _resolve_template_path()
if not template.exists():
raise FileOperationError(f"Internal ARM template not found: {template}")

site_name = self.ctx.args.name.to_serialized_data()
rg = self.ctx.args.resource_group.to_serialized_data()

deployment_name = f"site-quickstart-{site_name}"

invoke_args = [
"deployment", "group", "create",
"--name", deployment_name,
"--resource-group", rg,
"--template-file", str(template),
"--parameters",
f"siteName={site_name}",
]

if has_value(self.ctx.args.config_name):
cfg = self.ctx.args.config_name.to_serialized_data()
invoke_args.append(f"configName={cfg}")

cli = get_default_cli()
rc = cli.invoke(invoke_args)
if rc != 0:
raise CLIInternalError("ARM deployment failed for site quickstart.")
Comment thread
akanksha020901 marked this conversation as resolved.
Outdated

return cli.result.result
181 changes: 181 additions & 0 deletions src/site/azext_site/templates/infra/main.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"siteApiVersion": {
"type": "string",
"defaultValue": "2025-06-01"
},
"configApiVersion": {
"type": "string",
"defaultValue": "2025-06-01"
},
"configChildApiVersion": {
"type": "string",
"defaultValue": "2024-09-01-preview"
},
"configRefApiVersion": {
"type": "string",
"defaultValue": "2025-06-01"
},
"siteName": {
"type": "string"
},
"description": {
"type": "string",
"defaultValue": ""
},
"labels": {
"type": "object",
"defaultValue": {}
},
"siteAddress": {
"type": "object",
"defaultValue": {
"streetAddress1": "",
"streetAddress2": "",
"city": "",
"stateOrProvince": "",
"country": "",
"postalCode": ""
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]"
},
"configName": {
"type": "string",
"defaultValue": "[concat(parameters('siteName'), '-configuration')]"
},
"connectivityConfigName": {
"type": "string",
"defaultValue": "connectivityConfig1"
},
"secretConfigName": {
"type": "string",
"defaultValue": "secretconfig1"
},
"networkConfigName": {
"type": "string",
"defaultValue": "networkConfig1"
},
"networkConfigurationKind": {
"type": "string",
"defaultValue": "LAN"
},
"tsConfigName": {
"type": "string",
"defaultValue": "tsconfig1"
},
"timeServerConfiguration": {
"type": "object",
"defaultValue": {}
},
"connectivityConfiguration": {
"type": "object",
"defaultValue": {}
},
"securityConfiguration": {
"type": "object",
"defaultValue": {}
},
"networkConfiguration": {
"type": "object",
"defaultValue": {
"scenario": "Provisioning",
"ipAssignments": {
"ipAssignmentType": "Manual",
"ipv4": {
"addressRange": {
"startIp": "192.168.100.10",
"endIp": "192.168.100.50"
},
"subnetMask": "255.255.255.0",
"defaultGateway": "192.168.100.1",
"dnsServers": [],
"vLanId": 0
}
}
}
},
"useArcGateway": {
"type": "bool",
"defaultValue": false
},
"arcGatewayConfigName": {
"type": "string",
"defaultValue": "arcConfig1"
},
"arcGatewayConfiguration": {
"type": "object",
"defaultValue": {}
Comment thread
akanksha020901 marked this conversation as resolved.
Outdated
}
},
"variables": {
"siteId": "[resourceId('Microsoft.Edge/sites', parameters('siteName'))]",
"configId": "[resourceId('Microsoft.Edge/Configurations', parameters('configName'))]"
},
"resources": [
{
"type": "Microsoft.Edge/sites",
"apiVersion": "[parameters('siteApiVersion')]",
"name": "[parameters('siteName')]",
"properties": {
"displayName": "[parameters('siteName')]",
"description": "[parameters('description')]",
"siteAddress": {
"streetAddress1": "[parameters('siteAddress').streetAddress1]",
"streetAddress2": "[parameters('siteAddress').streetAddress2]",
"city": "[parameters('siteAddress').city]",
"stateOrProvince": "[parameters('siteAddress').stateOrProvince]",
"country": "[parameters('siteAddress').country]",
"postalCode": "[parameters('siteAddress').postalCode]"
},
"labels": "[parameters('labels')]"
}
},
{
"type": "Microsoft.Edge/Configurations",
"apiVersion": "[parameters('configApiVersion')]",
"name": "[parameters('configName')]",
"location": "[parameters('location')]",
"properties": {},
"resources": [
{
"type": "NetworkConfigurations",
"apiVersion": "[parameters('configChildApiVersion')]",
"name": "[parameters('networkConfigName')]",
"dependsOn": [
"[resourceId('Microsoft.Edge/Configurations', parameters('configName'))]"
],
"kind": "[parameters('networkConfigurationKind')]",
"properties": "[parameters('networkConfiguration')]"
}
]
},
{
"type": "Microsoft.Edge/configurationReferences",
"apiVersion": "[parameters('configRefApiVersion')]",
"name": "default",
"scope": "[variables('siteId')]",
"dependsOn": [
"[variables('siteId')]",
"[variables('configId')]"
],
"properties": {
"configurationResourceId": "[variables('configId')]"
}
}
],
"outputs": {
"siteId": {
"type": "string",
"value": "[variables('siteId')]"
},
"configId": {
"type": "string",
"value": "[variables('configId')]"
}
}
}
6 changes: 5 additions & 1 deletion src/site/setup.cfg
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
#setup.cfg
#setup.cfg

[options.package_data]
azext_site =
templates\**\*.json
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

setup.cfg adds [options.package_data] for the ARM template, but setup.py already passes an explicit package_data={...} to setup(), which will override/ignore this config in practice. As a result, templates/infra/main.json is still unlikely to be packaged into the wheel. Include the templates in setup.py's package_data (and/or include_package_data=True with an appropriate manifest) so the quickstart can find the file at runtime; also prefer forward slashes in globs for cross-platform builds.

Suggested change
templates\**\*.json
templates/**/*.json

Copilot uses AI. Check for mistakes.
Loading