Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
9f2ec16
workload changes
khkh-ms Oct 19, 2023
b31bc4f
small fix
khkh-ms Oct 20, 2023
3e5598c
Added tests.
khkh-ms Oct 23, 2023
5471848
Addressing the comments.
khkh-ms Nov 1, 2023
98f8c64
Updates after changes.
khkh-ms Nov 16, 2023
1217182
Updated messages
khkh-ms Nov 16, 2023
1817fa7
test update.
khkh-ms Nov 16, 2023
a8807e3
updated unit tests
khkh-ms Nov 17, 2023
5274f1e
Removed the test SDK version
khkh-ms Dec 11, 2023
32593cb
One more change
khkh-ms Dec 11, 2023
124ecdd
Few more changes in test.
khkh-ms Dec 12, 2023
d917421
pylint fixes.
khkh-ms Dec 12, 2023
8fcb219
Merge branch 'dev' of https://github.com/Azure/azure-cli into khkh/wo…
khkh-ms Dec 12, 2023
df7a6f9
Changes after merge.
khkh-ms Dec 12, 2023
67aedd3
Merge branch 'dev' of https://github.com/Azure/azure-cli into khkh/wo…
khkh-ms Dec 14, 2023
9773941
Changed regions in the tests.
khkh-ms Dec 14, 2023
172afbe
cred-tests
khkh-ms Dec 14, 2023
a5e5622
typo
khkh-ms Dec 14, 2023
d722680
addressed the comments
khkh-ms Dec 14, 2023
935e9fc
Update the recording after some change.
khkh-ms Dec 14, 2023
6faabbf
review changes
khkh-ms Dec 14, 2023
df8e402
Test Update and Moved once condition.
khkh-ms Dec 15, 2023
b5f8817
lint
khkh-ms Dec 15, 2023
8d35cda
pylint again
khkh-ms Dec 15, 2023
880d1c2
Merge branch 'dev' into khkh/workload-profiles
khkh-ms Dec 15, 2023
556d844
Addressed the review comments
khkh-ms Dec 18, 2023
2db671e
Merge branch 'dev' into khkh/workload-profiles
khkh-ms Dec 18, 2023
8ba89ef
Updated the recording.
khkh-ms Dec 18, 2023
0b1d96d
Changed the function name.
khkh-ms Dec 18, 2023
e7ef0bf
Flake8 fix
khkh-ms Dec 18, 2023
9ddc886
Updated the recording.
khkh-ms Dec 18, 2023
5b4686d
Updated the recording.
khkh-ms Dec 18, 2023
02738e1
Update polling logic for PATCH function app
kamperiadis Dec 18, 2023
0127d39
Rerun workload profile unit test
kamperiadis Dec 18, 2023
3b32b79
Consolidate dapr config and workload config updates
kamperiadis Dec 18, 2023
332cdb4
Use fake value in recording
kamperiadis Dec 19, 2023
7a7f376
Fetch cpu and memory only if resource config is not null
kamperiadis Dec 19, 2023
fdbbb6a
Revert resource config null check, add GET for all centauri apps crea…
kamperiadis Dec 19, 2023
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
Prev Previous commit
Next Next commit
Update polling logic for PATCH function app
  • Loading branch information
kamperiadis committed Dec 18, 2023
commit 02738e1409cb7f13e00eb4791b2fe92bea5b457b
57 changes: 45 additions & 12 deletions src/azure-cli/azure/cli/command_modules/appservice/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -3771,19 +3771,52 @@ def should_enable_distributed_tracing(consumption_plan_location, matched_runtime


def update_functionapp_polling(cmd, resource_group_name, name, functionapp):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copied this function from @kamperiadis's PR at #27589. We both are doing a similar change.

try:
_generic_site_operation(cmd.cli_ctx, resource_group_name, name, 'update', None, functionapp)
except Exception as ex: # pylint: disable=broad-except
poll_url = ex.response.headers['Location'] if 'Location' in ex.response.headers else None
if ex.response.status_code == 202 and poll_url:
r = send_raw_request(cmd.cli_ctx, method='get', url=poll_url)
poll_timeout = time.time() + 60 * 2 # 2 minute timeout
from azure.cli.core.commands.client_factory import get_subscription_id
client = web_client_factory(cmd.cli_ctx)
sub_id = get_subscription_id(cmd.cli_ctx)
base_url = '/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Web/sites/{}?api-version={}'.format(
sub_id,
resource_group_name,
name,
client.DEFAULT_API_VERSION
)
url = cmd.cli_ctx.cloud.endpoints.resource_manager + base_url

while r.status_code != 200 and time.time() < poll_timeout:
time.sleep(5)
r = send_raw_request(cmd.cli_ctx, method='get', url=poll_url)
else:
raise CLIError(ex)
updated_functionapp = json.dumps(
{
"properties": {
"daprConfig": {
"enabled": functionapp.dapr_config.enabled,
"appId": functionapp.dapr_config.app_id,
"appPort": functionapp.dapr_config.app_port,
"httpReadBufferSize": functionapp.dapr_config.http_read_buffer_size,
"httpMaxRequestSize": functionapp.dapr_config.http_max_request_size,
"logLevel": functionapp.dapr_config.log_level,
"enableApiLogging": functionapp.dapr_config.enable_api_logging
},
"workloadProfileName": functionapp.workload_profile_name,
"resourceConfig": {
"cpu": functionapp.resource_config.cpu,
"memory": functionapp.resource_config.memory
}
}
}
)
response = send_raw_request(cmd.cli_ctx, method='PATCH', url=url, body=updated_functionapp)
poll_url = response.headers.get('location', "")
if response.status_code == 202 and poll_url:
response = send_raw_request(cmd.cli_ctx, method='get', url=poll_url)
poll_timeout = time.time() + 60 * 2 # 2 minute timeout

while response.status_code != 200 and time.time() < poll_timeout:
time.sleep(5)
response = send_raw_request(cmd.cli_ctx, method='get', url=poll_url)

if response.status_code == 200:
return response

else:
return response


def update_dapr_config(cmd, resource_group_name, name, enabled=None, app_id=None, app_port=None,
Expand Down