Skip to content

Commit 8c6deaa

Browse files
authored
{App Service} az functionapp plan create: Add Elastic Premium as supported SKU for Zone Redundency (#32319)
1 parent ad0747a commit 8c6deaa

File tree

5 files changed

+358
-1
lines changed

5 files changed

+358
-1
lines changed

src/azure-cli/azure/cli/command_modules/appservice/_validators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def validate_ase_create(cmd, namespace):
9191

9292

9393
def _validate_asp_sku(sku, app_service_environment, zone_redundant):
94-
supported_skus = ['PREMIUMV2', 'PREMIUMV3', 'PREMIUMMV3', 'PREMIUM0V3', 'PREMIUMV4', 'PREMIUMMV4', 'ISOLATEDV2', 'ISOLATEDMV2'] # pylint: disable=line-too-long
94+
supported_skus = ['PREMIUMV2', 'PREMIUMV3', 'PREMIUMMV3', 'PREMIUM0V3', 'PREMIUMV4', 'PREMIUMMV4', 'ISOLATEDV2', 'ISOLATEDMV2', 'ELASTICPREMIUM'] # pylint: disable=line-too-long
9595
if zone_redundant and get_sku_tier(sku).upper() not in supported_skus:
9696
raise ValidationError("Zone redundancy cannot be enabled for sku {}".format(sku))
9797
# Isolated SKU is supported only for ASE
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
interactions:
2+
- request:
3+
body: null
4+
headers:
5+
Accept:
6+
- application/json
7+
Accept-Encoding:
8+
- gzip, deflate
9+
CommandName:
10+
- functionapp plan create
11+
Connection:
12+
- keep-alive
13+
ParameterSetName:
14+
- -g -n --sku --zone-redundant
15+
User-Agent:
16+
- AZURECLI/2.78.0 azsdk-python-core/1.35.0 Python/3.11.9 (Windows-10-10.0.22631-SP0)
17+
method: GET
18+
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2024-11-01
19+
response:
20+
body:
21+
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","type":"Microsoft.Resources/resourceGroups","location":"francecentral","tags":{"product":"azurecli","cause":"automation","test":"test_functionapp_create_elastic_premium_ep2_zone_redundant_plan","date":"2025-11-07T05:25:22Z","module":"appservice"},"properties":{"provisioningState":"Succeeded"}}'
22+
headers:
23+
cache-control:
24+
- no-cache
25+
content-length:
26+
- '412'
27+
content-type:
28+
- application/json; charset=utf-8
29+
date:
30+
- Fri, 07 Nov 2025 05:25:28 GMT
31+
expires:
32+
- '-1'
33+
pragma:
34+
- no-cache
35+
strict-transport-security:
36+
- max-age=31536000; includeSubDomains
37+
x-cache:
38+
- CONFIG_NOCACHE
39+
x-content-type-options:
40+
- nosniff
41+
x-ms-ratelimit-remaining-subscription-global-reads:
42+
- '16499'
43+
x-msedge-ref:
44+
- 'Ref A: 6312A332DBA64578A8A493DDB458D25A Ref B: MWH011020809052 Ref C: 2025-11-07T05:25:28Z'
45+
status:
46+
code: 200
47+
message: OK
48+
- request:
49+
body: '{"location": "francecentral", "sku": {"name": "EP2", "tier": "ElasticPremium",
50+
"capacity": 3}, "properties": {"perSiteScaling": false, "isXenon": false, "zoneRedundant":
51+
true}}'
52+
headers:
53+
Accept:
54+
- application/json
55+
Accept-Encoding:
56+
- gzip, deflate
57+
CommandName:
58+
- functionapp plan create
59+
Connection:
60+
- keep-alive
61+
Content-Length:
62+
- '176'
63+
Content-Type:
64+
- application/json
65+
ParameterSetName:
66+
- -g -n --sku --zone-redundant
67+
User-Agent:
68+
- AZURECLI/2.78.0 azsdk-python-core/1.35.0 Python/3.11.9 (Windows-10-10.0.22631-SP0)
69+
method: PUT
70+
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/epplan000002?api-version=2024-11-01
71+
response:
72+
body:
73+
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/epplan000002","name":"epplan000002","type":"Microsoft.Web/serverfarms","kind":"elastic","location":"francecentral","properties":{"serverFarmId":22750,"name":"epplan000002","sku":{"name":"EP2","tier":"ElasticPremium","size":"EP2","family":"EP","capacity":3},"workerSize":"D2","workerSizeId":4,"workerTierName":null,"numberOfWorkers":3,"currentWorkerSize":"D2","currentWorkerSizeId":4,"currentNumberOfWorkers":3,"status":"Ready","webSpace":"clitest.rg000001-FranceCentralwebspace","subscription":"2819c8c8-a774-4ac9-bf91-8bb8f1f47ece","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":0,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Dedicated","siteMode":null,"geoRegion":"France
74+
Central","perSiteScaling":false,"elasticScaleEnabled":true,"maximumElasticWorkerCount":3,"numberOfSites":0,"hostingEnvironmentId":null,"isSpot":false,"spotExpirationTime":null,"freeOfferExpirationTime":null,"tags":null,"kind":"elastic","resourceGroup":"clitest.rg000001","reserved":false,"isXenon":false,"hyperV":false,"mdmId":"waws-prod-par-053_22750","targetWorkerCount":0,"targetWorkerSizeId":0,"targetWorkerSku":null,"provisioningState":"Succeeded","webSiteId":null,"existingServerFarmIds":null,"kubeEnvironmentProfile":null,"zoneRedundant":true,"maximumNumberOfZones":3,"currentNumberOfZonesUtilized":3,"migrateToVMSS":null,"vnetConnectionsUsed":null,"vnetConnectionsMax":null,"createdTime":"2025-11-07T05:25:33.54","asyncScalingEnabled":false,"isCustomMode":null,"powerState":null,"eligibleLogCategories":null},"sku":{"name":"EP2","tier":"ElasticPremium","size":"EP2","family":"EP","capacity":3}}'
75+
headers:
76+
cache-control:
77+
- no-cache
78+
content-length:
79+
- '1793'
80+
content-type:
81+
- application/json
82+
date:
83+
- Fri, 07 Nov 2025 05:25:36 GMT
84+
etag:
85+
- '"1DC4FA6F13ACBC0"'
86+
expires:
87+
- '-1'
88+
pragma:
89+
- no-cache
90+
strict-transport-security:
91+
- max-age=31536000; includeSubDomains
92+
x-aspnet-version:
93+
- 4.0.30319
94+
x-cache:
95+
- CONFIG_NOCACHE
96+
x-content-type-options:
97+
- nosniff
98+
x-ms-operation-identifier:
99+
- tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=bd30bf6a-f200-4cfd-bcd6-a339b0d9dbe8/northcentralus/867ac0da-eace-4898-b1c0-55ac836f5539
100+
x-ms-ratelimit-remaining-subscription-global-writes:
101+
- '11999'
102+
x-ms-ratelimit-remaining-subscription-writes:
103+
- '799'
104+
x-msedge-ref:
105+
- 'Ref A: E3FEE3C150B84FD7B5E544AA0AD3E400 Ref B: CO6AA3150217033 Ref C: 2025-11-07T05:25:29Z'
106+
x-powered-by:
107+
- ASP.NET
108+
status:
109+
code: 200
110+
message: OK
111+
version: 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
interactions:
2+
- request:
3+
body: null
4+
headers:
5+
Accept:
6+
- application/json
7+
Accept-Encoding:
8+
- gzip, deflate
9+
CommandName:
10+
- functionapp plan create
11+
Connection:
12+
- keep-alive
13+
ParameterSetName:
14+
- -g -n --sku --zone-redundant
15+
User-Agent:
16+
- AZURECLI/2.78.0 azsdk-python-core/1.35.0 Python/3.11.9 (Windows-10-10.0.22631-SP0)
17+
method: GET
18+
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2024-11-01
19+
response:
20+
body:
21+
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","type":"Microsoft.Resources/resourceGroups","location":"francecentral","tags":{"product":"azurecli","cause":"automation","test":"test_functionapp_create_elastic_premium_ep3_zone_redundant_plan","date":"2025-10-24T20:43:41Z","module":"appservice"},"properties":{"provisioningState":"Succeeded"}}'
22+
headers:
23+
cache-control:
24+
- no-cache
25+
content-length:
26+
- '412'
27+
content-type:
28+
- application/json; charset=utf-8
29+
date:
30+
- Fri, 24 Oct 2025 20:43:45 GMT
31+
expires:
32+
- '-1'
33+
pragma:
34+
- no-cache
35+
strict-transport-security:
36+
- max-age=31536000; includeSubDomains
37+
x-cache:
38+
- CONFIG_NOCACHE
39+
x-content-type-options:
40+
- nosniff
41+
x-ms-ratelimit-remaining-subscription-global-reads:
42+
- '16499'
43+
x-msedge-ref:
44+
- 'Ref A: 75EA64BC39954670B6E4213DF8A4B8BF Ref B: MWH011020808042 Ref C: 2025-10-24T20:43:45Z'
45+
status:
46+
code: 200
47+
message: OK
48+
- request:
49+
body: '{"location": "francecentral", "sku": {"name": "EP3", "tier": "ElasticPremium",
50+
"capacity": 3}, "properties": {"perSiteScaling": false, "isXenon": false, "zoneRedundant":
51+
true}}'
52+
headers:
53+
Accept:
54+
- application/json
55+
Accept-Encoding:
56+
- gzip, deflate
57+
CommandName:
58+
- functionapp plan create
59+
Connection:
60+
- keep-alive
61+
Content-Length:
62+
- '176'
63+
Content-Type:
64+
- application/json
65+
ParameterSetName:
66+
- -g -n --sku --zone-redundant
67+
User-Agent:
68+
- AZURECLI/2.78.0 azsdk-python-core/1.35.0 Python/3.11.9 (Windows-10-10.0.22631-SP0)
69+
method: PUT
70+
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/epplan000002?api-version=2024-11-01
71+
response:
72+
body:
73+
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/epplan000002","name":"epplan000002","type":"Microsoft.Web/serverfarms","kind":"elastic","location":"francecentral","properties":{"serverFarmId":72567,"name":"epplan000002","sku":{"name":"EP3","tier":"ElasticPremium","size":"EP3","family":"EP","capacity":3},"workerSize":"D3","workerSizeId":5,"workerTierName":null,"numberOfWorkers":3,"currentWorkerSize":"D3","currentWorkerSizeId":5,"currentNumberOfWorkers":3,"status":"Ready","webSpace":"clitest.rg000001-FranceCentralwebspace","subscription":"2819c8c8-a774-4ac9-bf91-8bb8f1f47ece","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":0,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Dedicated","siteMode":null,"geoRegion":"France
74+
Central","perSiteScaling":false,"elasticScaleEnabled":true,"maximumElasticWorkerCount":3,"numberOfSites":0,"hostingEnvironmentId":null,"isSpot":false,"spotExpirationTime":null,"freeOfferExpirationTime":null,"tags":null,"kind":"elastic","resourceGroup":"clitest.rg000001","reserved":false,"isXenon":false,"hyperV":false,"mdmId":"waws-prod-par-021_72567","targetWorkerCount":0,"targetWorkerSizeId":0,"targetWorkerSku":null,"provisioningState":"Succeeded","webSiteId":null,"existingServerFarmIds":null,"kubeEnvironmentProfile":null,"zoneRedundant":true,"maximumNumberOfZones":3,"currentNumberOfZonesUtilized":3,"migrateToVMSS":null,"vnetConnectionsUsed":null,"vnetConnectionsMax":null,"createdTime":"2025-10-24T20:43:50.82","asyncScalingEnabled":false,"isCustomMode":null,"powerState":null,"eligibleLogCategories":null},"sku":{"name":"EP3","tier":"ElasticPremium","size":"EP3","family":"EP","capacity":3}}'
75+
headers:
76+
cache-control:
77+
- no-cache
78+
content-length:
79+
- '1793'
80+
content-type:
81+
- application/json
82+
date:
83+
- Fri, 24 Oct 2025 20:43:53 GMT
84+
etag:
85+
- '"1DC4526E7F8784B"'
86+
expires:
87+
- '-1'
88+
pragma:
89+
- no-cache
90+
strict-transport-security:
91+
- max-age=31536000; includeSubDomains
92+
x-aspnet-version:
93+
- 4.0.30319
94+
x-cache:
95+
- CONFIG_NOCACHE
96+
x-content-type-options:
97+
- nosniff
98+
x-ms-operation-identifier:
99+
- tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=bd30bf6a-f200-4cfd-bcd6-a339b0d9dbe8/westus2/47bc07cb-b0fb-45fc-b9f3-93b192a568f5
100+
x-ms-ratelimit-remaining-subscription-global-writes:
101+
- '12000'
102+
x-ms-ratelimit-remaining-subscription-writes:
103+
- '800'
104+
x-msedge-ref:
105+
- 'Ref A: 26FA6A5BCD50434D9E2BCE1F4B0FD909 Ref B: CO6AA3150220039 Ref C: 2025-10-24T20:43:45Z'
106+
x-powered-by:
107+
- ASP.NET
108+
status:
109+
code: 200
110+
message: OK
111+
version: 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
interactions:
2+
- request:
3+
body: null
4+
headers:
5+
Accept:
6+
- application/json
7+
Accept-Encoding:
8+
- gzip, deflate
9+
CommandName:
10+
- functionapp plan create
11+
Connection:
12+
- keep-alive
13+
ParameterSetName:
14+
- -g -n --sku --zone-redundant
15+
User-Agent:
16+
- AZURECLI/2.78.0 azsdk-python-core/1.35.0 Python/3.11.9 (Windows-10-10.0.22631-SP0)
17+
method: GET
18+
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2024-11-01
19+
response:
20+
body:
21+
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","type":"Microsoft.Resources/resourceGroups","location":"francecentral","tags":{"product":"azurecli","cause":"automation","test":"test_functionapp_create_elastic_premium_zone_redundant_plan","date":"2025-10-24T19:29:44Z","module":"appservice"},"properties":{"provisioningState":"Succeeded"}}'
22+
headers:
23+
cache-control:
24+
- no-cache
25+
content-length:
26+
- '408'
27+
content-type:
28+
- application/json; charset=utf-8
29+
date:
30+
- Fri, 24 Oct 2025 19:29:52 GMT
31+
expires:
32+
- '-1'
33+
pragma:
34+
- no-cache
35+
strict-transport-security:
36+
- max-age=31536000; includeSubDomains
37+
x-cache:
38+
- CONFIG_NOCACHE
39+
x-content-type-options:
40+
- nosniff
41+
x-ms-ratelimit-remaining-subscription-global-reads:
42+
- '16499'
43+
x-msedge-ref:
44+
- 'Ref A: E84614F2A52F47DB9F22CF1806B3120A Ref B: MWH011020809040 Ref C: 2025-10-24T19:29:51Z'
45+
status:
46+
code: 200
47+
message: OK
48+
- request:
49+
body: '{"location": "francecentral", "sku": {"name": "EP1", "tier": "ElasticPremium",
50+
"capacity": 3}, "properties": {"perSiteScaling": false, "isXenon": false, "zoneRedundant":
51+
true}}'
52+
headers:
53+
Accept:
54+
- application/json
55+
Accept-Encoding:
56+
- gzip, deflate
57+
CommandName:
58+
- functionapp plan create
59+
Connection:
60+
- keep-alive
61+
Content-Length:
62+
- '176'
63+
Content-Type:
64+
- application/json
65+
ParameterSetName:
66+
- -g -n --sku --zone-redundant
67+
User-Agent:
68+
- AZURECLI/2.78.0 azsdk-python-core/1.35.0 Python/3.11.9 (Windows-10-10.0.22631-SP0)
69+
method: PUT
70+
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/epplan000002?api-version=2024-11-01
71+
response:
72+
body:
73+
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/epplan000002","name":"epplan000002","type":"Microsoft.Web/serverfarms","kind":"elastic","location":"francecentral","properties":{"serverFarmId":49329,"name":"epplan000002","sku":{"name":"EP1","tier":"ElasticPremium","size":"EP1","family":"EP","capacity":3},"workerSize":"D1","workerSizeId":3,"workerTierName":null,"numberOfWorkers":3,"currentWorkerSize":"D1","currentWorkerSizeId":3,"currentNumberOfWorkers":3,"status":"Ready","webSpace":"clitest.rg000001-FranceCentralwebspace","subscription":"2819c8c8-a774-4ac9-bf91-8bb8f1f47ece","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":0,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Dedicated","siteMode":null,"geoRegion":"France
74+
Central","perSiteScaling":false,"elasticScaleEnabled":true,"maximumElasticWorkerCount":3,"numberOfSites":0,"hostingEnvironmentId":null,"isSpot":false,"spotExpirationTime":null,"freeOfferExpirationTime":null,"tags":null,"kind":"elastic","resourceGroup":"clitest.rg000001","reserved":false,"isXenon":false,"hyperV":false,"mdmId":"waws-prod-par-029_49329","targetWorkerCount":0,"targetWorkerSizeId":0,"targetWorkerSku":null,"provisioningState":"Succeeded","webSiteId":null,"existingServerFarmIds":null,"kubeEnvironmentProfile":null,"zoneRedundant":true,"maximumNumberOfZones":3,"currentNumberOfZonesUtilized":3,"migrateToVMSS":null,"vnetConnectionsUsed":null,"vnetConnectionsMax":null,"createdTime":"2025-10-24T19:29:57.7633333","asyncScalingEnabled":false,"isCustomMode":null,"powerState":null,"eligibleLogCategories":null},"sku":{"name":"EP1","tier":"ElasticPremium","size":"EP1","family":"EP","capacity":3}}'
75+
headers:
76+
cache-control:
77+
- no-cache
78+
content-length:
79+
- '1798'
80+
content-type:
81+
- application/json
82+
date:
83+
- Fri, 24 Oct 2025 19:30:00 GMT
84+
etag:
85+
- '"1DC451C95C3A4E0"'
86+
expires:
87+
- '-1'
88+
pragma:
89+
- no-cache
90+
strict-transport-security:
91+
- max-age=31536000; includeSubDomains
92+
x-aspnet-version:
93+
- 4.0.30319
94+
x-cache:
95+
- CONFIG_NOCACHE
96+
x-content-type-options:
97+
- nosniff
98+
x-ms-operation-identifier:
99+
- tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=bd30bf6a-f200-4cfd-bcd6-a339b0d9dbe8/westus2/412c828c-939b-41d5-b009-3825e4a158db
100+
x-ms-ratelimit-remaining-subscription-global-writes:
101+
- '12000'
102+
x-ms-ratelimit-remaining-subscription-writes:
103+
- '800'
104+
x-msedge-ref:
105+
- 'Ref A: 8D5BEF42718E4279B082054561E55B1B Ref B: MWH011020806060 Ref C: 2025-10-24T19:29:52Z'
106+
x-powered-by:
107+
- ASP.NET
108+
status:
109+
code: 200
110+
message: OK
111+
version: 1

src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3389,6 +3389,30 @@ def test_functionapp_elastic_premium_restricted_public_network_access_storage_mu
33893389
with self.assertRaises(ValidationError):
33903390
self.cmd('functionapp create -g {} -n {} -s {} -p {} --functions-version 4 --vnet {} --subnet {} --configure-networking-later'.format(resource_group, functionapp_name, storage_account, ep_plan_name, vnet_name, subnet_name))
33913391

3392+
@ResourceGroupPreparer(location=WINDOWS_ASP_LOCATION_FUNCTIONAPP)
3393+
def test_functionapp_create_elastic_premium_zone_redundant_plan(self, resource_group):
3394+
ep_plan_name = self.create_random_name('epplan', 24)
3395+
3396+
self.cmd('functionapp plan create -g {} -n {} --sku EP1 --zone-redundant'.format(resource_group, ep_plan_name)).assert_with_checks([
3397+
JMESPathCheck('zoneRedundant', True)
3398+
])
3399+
3400+
@ResourceGroupPreparer(location=WINDOWS_ASP_LOCATION_FUNCTIONAPP)
3401+
def test_functionapp_create_elastic_premium_ep2_zone_redundant_plan(self, resource_group):
3402+
ep_plan_name = self.create_random_name('epplan', 24)
3403+
3404+
self.cmd('functionapp plan create -g {} -n {} --sku EP2 --zone-redundant'.format(resource_group, ep_plan_name)).assert_with_checks([
3405+
JMESPathCheck('zoneRedundant', True)
3406+
])
3407+
3408+
@ResourceGroupPreparer(location=WINDOWS_ASP_LOCATION_FUNCTIONAPP)
3409+
def test_functionapp_create_elastic_premium_ep3_zone_redundant_plan(self, resource_group):
3410+
ep_plan_name = self.create_random_name('epplan', 24)
3411+
3412+
self.cmd('functionapp plan create -g {} -n {} --sku EP3 --zone-redundant'.format(resource_group, ep_plan_name)).assert_with_checks([
3413+
JMESPathCheck('zoneRedundant', True)
3414+
])
3415+
33923416
@live_only()
33933417
@ResourceGroupPreparer(location=WINDOWS_ASP_LOCATION_FUNCTIONAPP)
33943418
def test_functionapp_elastic_premium_restricted_public_network_access_storage_vnet(self, resource_group):

0 commit comments

Comments
 (0)