Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove msrestazure dependency #8149

Merged
merged 2 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions src/appservice-kube/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Release History
===============
0.1.11
++++++
* Remove msrestazure dependency

0.1.10
++++++
* Add command `az webapp list-runtimes --is-kube` for arc enabled app service
Expand Down
8 changes: 4 additions & 4 deletions src/appservice-kube/azext_appservice_kube/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ def get_sku_name(tier): # pylint: disable=too-many-return-statements


def validate_subnet_id(cli_ctx, subnet, vnet_name, resource_group_name):
from msrestazure.tools import is_valid_resource_id
from azure.mgmt.core.tools import is_valid_resource_id
subnet_is_id = is_valid_resource_id(subnet)

if subnet_is_id and not vnet_name:
return subnet
if subnet and not subnet_is_id and vnet_name:
from msrestazure.tools import resource_id
from azure.mgmt.core.tools import resource_id
LaylaLiu-gmail marked this conversation as resolved.
Show resolved Hide resolved
from azure.cli.core.commands.client_factory import get_subscription_id
return resource_id(
subscription=get_subscription_id(cli_ctx),
Expand All @@ -90,13 +90,13 @@ def validate_subnet_id(cli_ctx, subnet, vnet_name, resource_group_name):


def validate_aks_id(cli_ctx, aks, resource_group_name):
from msrestazure.tools import is_valid_resource_id
from azure.mgmt.core.tools import is_valid_resource_id
aks_is_id = is_valid_resource_id(aks)

if aks_is_id:
return aks
if aks and not aks_is_id:
from msrestazure.tools import resource_id
from azure.mgmt.core.tools import resource_id
from azure.cli.core.commands.client_factory import get_subscription_id
return resource_id(
subscription=get_subscription_id(cli_ctx),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"azext.isPreview": true,
"azext.minCliCoreVersion": "2.34.1"
"azext.minCliCoreVersion": "2.60.0"
}
8 changes: 4 additions & 4 deletions src/appservice-kube/azext_appservice_kube/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
from azure.cli.core.azclierror import (ResourceNotFoundError, RequiredArgumentMissingError, ValidationError,
ArgumentUsageError, MutuallyExclusiveArgumentError)

from msrestazure.tools import is_valid_resource_id, parse_resource_id
from azure.mgmt.core.tools import is_valid_resource_id, parse_resource_id

from ._constants import (KUBE_DEFAULT_SKU, KUBE_ASP_KIND, KUBE_APP_KIND, KUBE_FUNCTION_APP_KIND,
KUBE_FUNCTION_CONTAINER_APP_KIND, KUBE_CONTAINER_APP_KIND)
Expand Down Expand Up @@ -680,7 +680,7 @@ def _is_webapp_kube(custom_location, plan_info, SkuDescription):


def _get_custom_location_id(cmd, custom_location, resource_group_name):
from msrestazure.tools import resource_id
from azure.mgmt.core.tools import resource_id

if custom_location is None:
return None
Expand Down Expand Up @@ -905,7 +905,7 @@ def create_webapp(cmd, resource_group_name, name, plan=None, runtime=None, custo
if deployment_container_image_name:
update_container_settings(cmd, resource_group_name, name, docker_registry_server_url,
deployment_container_image_name, docker_registry_server_user,
docker_registry_server_password=docker_registry_server_password)
container_registry_password=docker_registry_server_password)

if is_kube:
return webapp
Expand Down Expand Up @@ -1457,7 +1457,7 @@ def _resolve_kube_environment_id(cli_ctx, kube_environment, resource_group_name)
if is_valid_resource_id(kube_environment):
return kube_environment

from msrestazure.tools import resource_id
from azure.mgmt.core.tools import resource_id
return resource_id(
subscription=get_subscription_id(cli_ctx),
resource_group=resource_group_name,
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@

# not lima-specific
class WebappBasicE2EKubeTest(ScenarioTest):
@ResourceGroupPreparer(location='canadacentral')
@ResourceGroupPreparer(location='eastus')
@live_only()
def test_linux_webapp_quick_create_kube(self, resource_group):
location_name = ""
webapp_name = self.create_random_name(
prefix='webapp-quick-linux', length=24)
plan = self.create_random_name(prefix='plan-quick-linux', length=24)
Expand All @@ -26,10 +27,6 @@ def test_linux_webapp_quick_create_kube(self, resource_group):
'appservice plan create -g {} -n {} --is-linux'.format(resource_group, plan))
self.cmd('webapp create -g {} -n {} --plan {} -i patle/ruby-hello'.format(
resource_group, webapp_name, plan))
r = requests.get(
'http://{}.azurewebsites.net'.format(webapp_name), timeout=240)
# verify the web page
self.assertTrue('Ruby on Rails in Web Apps on Linux' in str(r.content))
# verify app settings
self.cmd('webapp config appsettings list -g {} -n {}'.format(resource_group, webapp_name), checks=[
JMESPathCheck('[0].name', 'WEBSITES_ENABLE_APP_SERVICE_STORAGE'),
Expand Down
Loading