From 613590fddfd6a497938a708cafc229c6fba992f9 Mon Sep 17 00:00:00 2001 From: Silas Strawn Date: Wed, 31 Aug 2022 13:41:09 -0700 Subject: [PATCH 01/27] start SWA hawaii commands --- .github/CODEOWNERS | 1 + src/staticwebapp/HISTORY.rst | 8 ++ src/staticwebapp/README.rst | 5 + .../azext_staticwebapp/__init__.py | 31 ++++++ .../azext_staticwebapp/_client_factory.py | 5 + .../azext_staticwebapp/_clients.py | 97 +++++++++++++++++++ src/staticwebapp/azext_staticwebapp/_help.py | 28 ++++++ .../azext_staticwebapp/_models.py | 14 +++ .../azext_staticwebapp/_params.py | 26 +++++ src/staticwebapp/azext_staticwebapp/_utils.py | 61 ++++++++++++ .../azext_staticwebapp/_validators.py | 5 + .../azext_staticwebapp/azext_metadata.json | 4 + .../azext_staticwebapp/commands.py | 13 +++ src/staticwebapp/azext_staticwebapp/custom.py | 34 +++++++ .../azext_staticwebapp/tests/__init__.py | 5 + .../tests/latest/__init__.py | 5 + .../latest/test_staticwebapp_scenario.py | 19 ++++ src/staticwebapp/setup.cfg | 0 src/staticwebapp/setup.py | 58 +++++++++++ 19 files changed, 419 insertions(+) create mode 100644 src/staticwebapp/HISTORY.rst create mode 100644 src/staticwebapp/README.rst create mode 100644 src/staticwebapp/azext_staticwebapp/__init__.py create mode 100644 src/staticwebapp/azext_staticwebapp/_client_factory.py create mode 100644 src/staticwebapp/azext_staticwebapp/_clients.py create mode 100644 src/staticwebapp/azext_staticwebapp/_help.py create mode 100644 src/staticwebapp/azext_staticwebapp/_models.py create mode 100644 src/staticwebapp/azext_staticwebapp/_params.py create mode 100644 src/staticwebapp/azext_staticwebapp/_utils.py create mode 100644 src/staticwebapp/azext_staticwebapp/_validators.py create mode 100644 src/staticwebapp/azext_staticwebapp/azext_metadata.json create mode 100644 src/staticwebapp/azext_staticwebapp/commands.py create mode 100644 src/staticwebapp/azext_staticwebapp/custom.py create mode 100644 src/staticwebapp/azext_staticwebapp/tests/__init__.py create mode 100644 src/staticwebapp/azext_staticwebapp/tests/latest/__init__.py create mode 100644 src/staticwebapp/azext_staticwebapp/tests/latest/test_staticwebapp_scenario.py create mode 100644 src/staticwebapp/setup.cfg create mode 100644 src/staticwebapp/setup.py diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ec1a296eafc..38b3a2d4d3e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -245,3 +245,4 @@ /src/fluid-relay/ @kairu-ms @necusjz @ZengTaoxu /src/fleet/ @pdaru +/src/azext_staticwebapp/ @strawnsc diff --git a/src/staticwebapp/HISTORY.rst b/src/staticwebapp/HISTORY.rst new file mode 100644 index 00000000000..f655acc6297 --- /dev/null +++ b/src/staticwebapp/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Add commands to manage Static Web App database connections: 'az staticwebapp dbconnection create/show/delete' diff --git a/src/staticwebapp/README.rst b/src/staticwebapp/README.rst new file mode 100644 index 00000000000..167e9f0af2b --- /dev/null +++ b/src/staticwebapp/README.rst @@ -0,0 +1,5 @@ +Microsoft Azure CLI 'staticwebapp' Extension +========================================== + +This package is for the 'staticwebapp' extension. +i.e. 'az staticwebapp' \ No newline at end of file diff --git a/src/staticwebapp/azext_staticwebapp/__init__.py b/src/staticwebapp/azext_staticwebapp/__init__.py new file mode 100644 index 00000000000..5f361c0b953 --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/__init__.py @@ -0,0 +1,31 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azure.cli.core import AzCommandsLoader + +from azext_staticwebapp._help import helps # pylint: disable=unused-import + + +class StaticwebappCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + staticwebapp_custom = CliCommandType( + operations_tmpl='azext_staticwebapp.custom#{}', + client_factory=None) + super(StaticwebappCommandsLoader, self).__init__(cli_ctx=cli_ctx, + custom_command_type=staticwebapp_custom) + + def load_command_table(self, args): + from azext_staticwebapp.commands import load_command_table + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + from azext_staticwebapp._params import load_arguments + load_arguments(self, command) + + +COMMAND_LOADER_CLS = StaticwebappCommandsLoader diff --git a/src/staticwebapp/azext_staticwebapp/_client_factory.py b/src/staticwebapp/azext_staticwebapp/_client_factory.py new file mode 100644 index 00000000000..8dd7ea066b4 --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/_client_factory.py @@ -0,0 +1,5 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + diff --git a/src/staticwebapp/azext_staticwebapp/_clients.py b/src/staticwebapp/azext_staticwebapp/_clients.py new file mode 100644 index 00000000000..4b45026a874 --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/_clients.py @@ -0,0 +1,97 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import json + +from azure.cli.core.util import send_raw_request +from azure.cli.core.commands.client_factory import get_subscription_id + + +API_VERSION = "2022-03-01" + + +# TODO handle polling +class DbConnectionClient(): + @classmethod + def create_or_update(cls, cmd, resource_group_name, name, environment, connection_name="default", + db_connection=None): + management_hostname = cmd.cli_ctx.cloud.endpoints.resource_manager + api_version = API_VERSION + sub_id = get_subscription_id(cmd.cli_ctx) + url_fmt = ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Web/staticsites/{}/builds/{}" + "/databaseConnections/{}?api-version={}") + request_url = url_fmt.format( + management_hostname.strip('/'), + sub_id, + resource_group_name, + name, + environment, + connection_name, + api_version) + + r = send_raw_request(cmd.cli_ctx, "PUT", request_url, body=json.dumps(db_connection)) + return r.json() + + @classmethod + def show(cls, cmd, resource_group_name, name, environment, connection_name="default", detailed=False): + management_hostname = cmd.cli_ctx.cloud.endpoints.resource_manager + api_version = API_VERSION + sub_id = get_subscription_id(cmd.cli_ctx) + url_fmt = ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Web/staticsites/{}/builds/{}" + "/databaseConnections/{}?api-version={}") + request_url = url_fmt.format( + management_hostname.strip('/'), + sub_id, + resource_group_name, + name, + environment, + connection_name, + api_version) + + verb = "GET" if not detailed else "POST" + + r = send_raw_request(cmd.cli_ctx, verb, request_url) + return r.json() + + @classmethod + def list(cls, cmd, resource_group_name, name, environment, connection_name="default", detailed=False): + management_hostname = cmd.cli_ctx.cloud.endpoints.resource_manager + api_version = API_VERSION + sub_id = get_subscription_id(cmd.cli_ctx) + url_fmt = ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Web/staticsites/{}/builds/{}" + "/databaseConnections/{}?api-version={}") + request_url = url_fmt.format( + management_hostname.strip('/'), + sub_id, + resource_group_name, + name, + environment, + connection_name, + api_version) + + verb = "GET" if not detailed else "POST" + + r = send_raw_request(cmd.cli_ctx, verb, request_url) + return r.json() + + + @classmethod + def delete(cls, cmd, resource_group_name, name, environment, connection_name="default"): + management_hostname = cmd.cli_ctx.cloud.endpoints.resource_manager + api_version = API_VERSION + sub_id = get_subscription_id(cmd.cli_ctx) + url_fmt = ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Web/staticsites/{}/builds/{}" + "/databaseConnections/{}?api-version={}") + request_url = url_fmt.format( + management_hostname.strip('/'), + sub_id, + resource_group_name, + name, + environment, + connection_name, + api_version) + + r = send_raw_request(cmd.cli_ctx, "DELETE", request_url) + return r.json() diff --git a/src/staticwebapp/azext_staticwebapp/_help.py b/src/staticwebapp/azext_staticwebapp/_help.py new file mode 100644 index 00000000000..4ec191d512c --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/_help.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from knack.help_files import helps # pylint: disable=unused-import + + +helps['staticwebapp dbconnection'] = """ + type: group + short-summary: Manage Static Web App database connections +""" + +helps['staticwebapp dbconnection create'] = """ + type: command + short-summary: Create a Static Web App database connection. +""" + +helps['staticwebapp dbconnection show'] = """ + type: command + short-summary: Get details for a Static Web App database connection. +""" + +helps['staticwebapp dbconnection delete'] = """ + type: command + short-summary: Delete a Static Web App database connection. +""" diff --git a/src/staticwebapp/azext_staticwebapp/_models.py b/src/staticwebapp/azext_staticwebapp/_models.py new file mode 100644 index 00000000000..a79be47ac6d --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/_models.py @@ -0,0 +1,14 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +DbConnection = { + "properties": { + "resourceId": None, + "connectionIdentity": None, + "region": None, + "connectionString": None, + } +} diff --git a/src/staticwebapp/azext_staticwebapp/_params.py b/src/staticwebapp/azext_staticwebapp/_params.py new file mode 100644 index 00000000000..45e3d6316d9 --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/_params.py @@ -0,0 +1,26 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +def load_arguments(self, _): + + from azure.cli.core.commands.parameters import resource_group_name_type + + with self.argument_context('staticwebapp dbconnection') as c: + c.argument('name', options_list=['--name', '-n'], help="Name of the Static Web App") + c.argument('resource_group_name', resource_group_name_type) + c.argument('environment', help="Name of the environment of Static Web App.", default="default", + options_list=["--environment", "-e"]) + + with self.argument_context('staticwebapp dbconnection create') as c: + c.argument('db_resource_id', options_list=['--db-resource-id', '-d'], + help="Get detailed information on database connections") + c.argument('use_connection_string', options_list=['--use-connection-string', '-c'], action='store_true', + default=False, help="Force the usage of connection string") + + with self.argument_context('staticwebapp dbconnection show') as c: + c.argument('detailed', options_list=['--detailed', '-d'],action='store_true', + default=False, help="Get detailed information on database connections") + diff --git a/src/staticwebapp/azext_staticwebapp/_utils.py b/src/staticwebapp/azext_staticwebapp/_utils.py new file mode 100644 index 00000000000..1c80f6bf6a6 --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/_utils.py @@ -0,0 +1,61 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +from enum import Enum, auto +import re + +from azure.cli.core.azclierror import InvalidArgumentValueError +from azure.cli.core.util import send_raw_request + + +class DbType(Enum): + COSMOS_DB = auto() + AZURE_SQL = auto() + MYSQL_SINGLE = auto() + MYSQL_FLEX = auto() + PGSQL_SINGLE = auto() + PGSQL_FLEX = auto() + + +rid_to_db_type = { + r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DocumentDB/databaseAccounts\/.*$": DbType.COSMOS_DB, + r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers/Microsoft.Sql/servers\/.*\/databases\/.*$": DbType.AZURE_SQL, + r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DBforMySQL\/servers\/.*$": DbType.MYSQL_SINGLE, + r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DBforMySQL/flexibleServers\/.*$": DbType.MYSQL_FLEX, + r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DBforPostgreSQL\/servers\/.*$": DbType.PGSQL_SINGLE, + r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DBforPostgreSQL\/flexibleServers\/.*$": DbType.PGSQL_FLEX, +} + + +db_type_to_api_version = { + DbType.COSMOS_DB: "2021-10-15", + DbType.AZURE_SQL: "2021-11-01", + DbType.MYSQL_SINGLE: "2017-12-01", + DbType.MYSQL_FLEX: "2021-05-01", + DbType.PGSQL_SINGLE: "2017-12-01", + DbType.PGSQL_FLEX: "2021-06-01", +} + + +def get_database_type(resource_id: str) -> 'DbType': + for pattern, db_type in rid_to_db_type.items(): + if re.fullmatch(pattern, resource_id, flags=re.IGNORECASE): + return db_type + raise InvalidArgumentValueError("Database resource ID is invalid or of an unsupported DB") + + +def get_location(cmd, resource_id: str, db_type: 'DbType') -> str: + management_hostname = cmd.cli_ctx.cloud.endpoints.resource_manager + api_version = db_type_to_api_version[db_type] + request_url = f"{management_hostname.strip('/')}{resource_id}?api-version={api_version}" + + r = send_raw_request(cmd.cli_ctx, "GET", request_url) + return r.json()["location"] + + +# TODO +def get_connection_string(cmd, resource_id: str, db_type: 'DbType', username: str, password: str) -> str: + pass diff --git a/src/staticwebapp/azext_staticwebapp/_validators.py b/src/staticwebapp/azext_staticwebapp/_validators.py new file mode 100644 index 00000000000..8dd7ea066b4 --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/_validators.py @@ -0,0 +1,5 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + diff --git a/src/staticwebapp/azext_staticwebapp/azext_metadata.json b/src/staticwebapp/azext_staticwebapp/azext_metadata.json new file mode 100644 index 00000000000..b9632de1b4f --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.39" +} \ No newline at end of file diff --git a/src/staticwebapp/azext_staticwebapp/commands.py b/src/staticwebapp/azext_staticwebapp/commands.py new file mode 100644 index 00000000000..178a8ee5df0 --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/commands.py @@ -0,0 +1,13 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long + + +def load_command_table(self, _): + with self.command_group('staticwebapp dbconnection') as g: + g.custom_command('create', 'create_dbconnection') + g.custom_command('show', 'show_dbconnection') + g.custom_command('delete', 'delete_dbconnection') diff --git a/src/staticwebapp/azext_staticwebapp/custom.py b/src/staticwebapp/azext_staticwebapp/custom.py new file mode 100644 index 00000000000..5a9579cfe42 --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/custom.py @@ -0,0 +1,34 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +from ._clients import DbConnectionClient +from ._models import DbConnection +from ._utils import get_database_type, get_location + + +# TODO remove or use "use_connection_string" +# TODO add MSI arguments +# TODO add database username/password arguments +def create_dbconnection(cmd, resource_group_name, name, db_resource_id, environment=None, use_connection_string=None, connection_string=None): + db_type = get_database_type(db_resource_id) + region = get_location(cmd, db_resource_id, db_type) + # TODO special logic for getting connection string from the resource id if not provided + + connection = DbConnection + connection["properties"]["resourceId"] = db_resource_id + connection["properties"]["connectionIdentity"] = None # TODO ? + connection["properties"]["connectionString"] = connection_string + connection["properties"]["region"] = region + + return DbConnectionClient.create_or_update(cmd, resource_group_name, name, environment, db_connection=connection) + + +def show_dbconnection(cmd, resource_group_name, name, environment=None, detailed=None): + return DbConnectionClient.list(cmd, resource_group_name, name, environment, detailed=detailed) + + +def delete_dbconnection(cmd, resource_group_name, name, environment): + return DbConnectionClient.delete(cmd, resource_group_name, name, environment) diff --git a/src/staticwebapp/azext_staticwebapp/tests/__init__.py b/src/staticwebapp/azext_staticwebapp/tests/__init__.py new file mode 100644 index 00000000000..2dcf9bb68b3 --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/tests/__init__.py @@ -0,0 +1,5 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# ----------------------------------------------------------------------------- \ No newline at end of file diff --git a/src/staticwebapp/azext_staticwebapp/tests/latest/__init__.py b/src/staticwebapp/azext_staticwebapp/tests/latest/__init__.py new file mode 100644 index 00000000000..2dcf9bb68b3 --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/tests/latest/__init__.py @@ -0,0 +1,5 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# ----------------------------------------------------------------------------- \ No newline at end of file diff --git a/src/staticwebapp/azext_staticwebapp/tests/latest/test_staticwebapp_scenario.py b/src/staticwebapp/azext_staticwebapp/tests/latest/test_staticwebapp_scenario.py new file mode 100644 index 00000000000..2bf1628a78d --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/tests/latest/test_staticwebapp_scenario.py @@ -0,0 +1,19 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import os + +from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer) + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +class StaticwebappScenarioTest(ScenarioTest): + + # TODO + @ResourceGroupPreparer(name_prefix='cli_test_staticwebapp') + def test_staticwebapp(self, resource_group): + pass \ No newline at end of file diff --git a/src/staticwebapp/setup.cfg b/src/staticwebapp/setup.cfg new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/staticwebapp/setup.py b/src/staticwebapp/setup.py new file mode 100644 index 00000000000..4da096c6a88 --- /dev/null +++ b/src/staticwebapp/setup.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python + +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +from codecs import open +from setuptools import setup, find_packages +try: + from azure_bdist_wheel import cmdclass +except ImportError: + from distutils import log as logger + logger.warn("Wheel is not available, disabling bdist_wheel hook") + +# TODO: Confirm this is the right version number you want and it matches your +# HISTORY.rst entry. +VERSION = '0.1.0' + +# The full list of classifiers is available at +# https://pypi.python.org/pypi?%3Aaction=list_classifiers +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'License :: OSI Approved :: MIT License', +] + +# TODO: Add any additional SDK dependencies here +DEPENDENCIES = [] + +with open('README.rst', 'r', encoding='utf-8') as f: + README = f.read() +with open('HISTORY.rst', 'r', encoding='utf-8') as f: + HISTORY = f.read() + +setup( + name='staticwebapp', + version=VERSION, + description='Microsoft Azure Command-Line Tools Staticwebapp Extension', + # TODO: Update author and email, if applicable + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + # TODO: change to your extension source code repo if the code will not be put in azure-cli-extensions repo + url='https://github.com/Azure/azure-cli-extensions/tree/master/src/staticwebapp', + long_description=README + '\n\n' + HISTORY, + license='MIT', + classifiers=CLASSIFIERS, + packages=find_packages(), + install_requires=DEPENDENCIES, + package_data={'azext_staticwebapp': ['azext_metadata.json']}, +) \ No newline at end of file From 8bfad382a1cdea0f97c64904166d5bdecf99c25c Mon Sep 17 00:00:00 2001 From: Silas Strawn Date: Wed, 30 Nov 2022 16:04:19 -0600 Subject: [PATCH 02/27] TODO --- src/staticwebapp/azext_staticwebapp/_utils.py | 33 ++++++++++++++++--- src/staticwebapp/azext_staticwebapp/custom.py | 11 +++++-- 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/src/staticwebapp/azext_staticwebapp/_utils.py b/src/staticwebapp/azext_staticwebapp/_utils.py index 1c80f6bf6a6..51d837f1254 100644 --- a/src/staticwebapp/azext_staticwebapp/_utils.py +++ b/src/staticwebapp/azext_staticwebapp/_utils.py @@ -7,9 +7,10 @@ from enum import Enum, auto import re -from azure.cli.core.azclierror import InvalidArgumentValueError +from azure.cli.core.azclierror import InvalidArgumentValueError, RequiredArgumentMissingError, ValidationError from azure.cli.core.util import send_raw_request - +from azure.cli.command_modules.cosmosdb._client_factory import cf_db_accounts +from msrestazure.tools import parse_resource_id class DbType(Enum): COSMOS_DB = auto() @@ -57,5 +58,29 @@ def get_location(cmd, resource_id: str, db_type: 'DbType') -> str: # TODO -def get_connection_string(cmd, resource_id: str, db_type: 'DbType', username: str, password: str) -> str: - pass +def get_connection_string(cmd, resource_id: str, db_type: 'DbType', username=None, password=None): + parsed_rid = parse_resource_id(resource_id) + resource_group = parsed_rid["resource_group"] + name = parsed_rid["name"] + if db_type == DbType.COSMOS_DB: + client = cf_db_accounts(cmd.cli_ctx, None) + return client.list_connection_strings(resource_group, name).connection_strings[0].connection_string + if db_type == DbType.AZURE_SQL: + if not username or not password: + raise RequiredArgumentMissingError("Must include database username and password for Azure SQL databases") + return (f"Server=tcp:{name}.database.windows.net,1433;Database={parsed_rid['child_name_1']};" + f"User ID={username};Password={password};Encrypt=true;Connection Timeout=30;") + # TODO verify + if db_type == DbType.MYSQL_SINGLE: + pass # TODO not supported? confirm with Thomas + # TODO verify + if db_type == DbType.MYSQL_FLEX: + return (f'Server="{your_server}.mysql.database.azure.com";UserID = "{your_username}";Password="{your_password}";Database="{your_database}";SslMode=MySqlSslMode.Required;SslCa="{{path_to_CA_cert}}"') + # TODO verify + if db_type == DbType.PGSQL_SINGLE: + return + # TODO verify + if db_type == DbType.PGSQL_FLEX: + return + raise InvalidArgumentValueError("Database resource ID is invalid or of an unsupported DB") + diff --git a/src/staticwebapp/azext_staticwebapp/custom.py b/src/staticwebapp/azext_staticwebapp/custom.py index 5a9579cfe42..9c2d3477fe6 100644 --- a/src/staticwebapp/azext_staticwebapp/custom.py +++ b/src/staticwebapp/azext_staticwebapp/custom.py @@ -6,16 +6,21 @@ from ._clients import DbConnectionClient from ._models import DbConnection -from ._utils import get_database_type, get_location +from ._utils import get_database_type, get_location, get_connection_string # TODO remove or use "use_connection_string" # TODO add MSI arguments # TODO add database username/password arguments -def create_dbconnection(cmd, resource_group_name, name, db_resource_id, environment=None, use_connection_string=None, connection_string=None): +def create_dbconnection(cmd, resource_group_name, name, db_resource_id, environment=None, use_connection_string=None, + connection_string=None, username=None, password=None): db_type = get_database_type(db_resource_id) region = get_location(cmd, db_resource_id, db_type) - # TODO special logic for getting connection string from the resource id if not provided + + if not connection_string: + connection_string = get_connection_string(cmd, db_resource_id, db_type, username, password) + # TODO add MSI logic + # print(connection_string) connection = DbConnection connection["properties"]["resourceId"] = db_resource_id From 8568d1737863c70f7b98152a1dd01fe3d0c2d039 Mon Sep 17 00:00:00 2001 From: Silas Strawn Date: Thu, 1 Dec 2022 12:03:01 -0600 Subject: [PATCH 03/27] refactor DB-dependent logic --- src/staticwebapp/azext_staticwebapp/_utils.py | 258 +++++++++++++----- src/staticwebapp/azext_staticwebapp/custom.py | 15 +- 2 files changed, 204 insertions(+), 69 deletions(-) diff --git a/src/staticwebapp/azext_staticwebapp/_utils.py b/src/staticwebapp/azext_staticwebapp/_utils.py index 51d837f1254..b4947a49e68 100644 --- a/src/staticwebapp/azext_staticwebapp/_utils.py +++ b/src/staticwebapp/azext_staticwebapp/_utils.py @@ -12,75 +12,209 @@ from azure.cli.command_modules.cosmosdb._client_factory import cf_db_accounts from msrestazure.tools import parse_resource_id -class DbType(Enum): - COSMOS_DB = auto() - AZURE_SQL = auto() - MYSQL_SINGLE = auto() - MYSQL_FLEX = auto() - PGSQL_SINGLE = auto() - PGSQL_FLEX = auto() - - -rid_to_db_type = { - r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DocumentDB/databaseAccounts\/.*$": DbType.COSMOS_DB, - r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers/Microsoft.Sql/servers\/.*\/databases\/.*$": DbType.AZURE_SQL, - r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DBforMySQL\/servers\/.*$": DbType.MYSQL_SINGLE, - r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DBforMySQL/flexibleServers\/.*$": DbType.MYSQL_FLEX, - r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DBforPostgreSQL\/servers\/.*$": DbType.PGSQL_SINGLE, - r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DBforPostgreSQL\/flexibleServers\/.*$": DbType.PGSQL_FLEX, -} +class ConnectionType(Enum): + CONNECTION_STRING = auto() + MANAGED_IDENTITY_USER_ASSIGNED = auto() + MANAGED_IDENTITY_SYTEM_ASSIGNED= auto() + + +class Sku(Enum): + FREE = auto() + STANDARD = auto() + + +class AbstractDbHandler: + DB_TYPE_NAME = "" # used for emitting user-friendly error messages + API_VERSION = "" # the API version for performing GET on RID + + @classmethod + def _requires_username(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: + raise NotImplementedError() + + @classmethod + def _requires_password(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: + raise NotImplementedError() + + @classmethod + def _is_supported(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: + raise NotImplementedError() + + @classmethod + def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id: str, + username=None, password=None) -> str: + raise NotImplementedError() + + @classmethod + def _validate(cls, sku: 'Sku', connection_type: 'ConnectionType', username=None, password=None): + if not cls._is_supported(sku, connection_type): + raise ValidationError(f"Authentication type '{connection_type}' is not supported for " + f"sku '{sku}' and database type '{cls.DB_TYPE_NAME}'") + + missing_username = not username and cls._requires_username(sku, connection_type) + missing_password = not password and cls._requires_password(sku, connection_type) + if missing_password and missing_username: + raise RequiredArgumentMissingError("Missing database username and password") + if missing_password: + raise RequiredArgumentMissingError("Missing database password") + if missing_username: + raise RequiredArgumentMissingError("Missing database username") + + @classmethod + def get_location(cls, cmd, resource_id: str) -> str: + management_hostname = cmd.cli_ctx.cloud.endpoints.resource_manager + request_url = f"{management_hostname.strip('/')}{resource_id}?api-version={cls.API_VERSION}" + + r = send_raw_request(cmd.cli_ctx, "GET", request_url) + return r.json()["location"] + + @classmethod + def get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id: str, + username=None, password=None) -> str: + cls._validate(sku, connection_type, username, password) + return cls._get_connection_string(cmd, sku, connection_type, resource_id, username, password) + + +class CosmosDbHandler(AbstractDbHandler): + DB_TYPE_NAME = "CosmosDB" + API_VERSION = "2021-10-15" + + @classmethod + def _requires_username(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: + return False + + @classmethod + def _requires_password(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: + return False + + @classmethod + def _is_supported(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: + return not (sku == sku.FREE and connection_type != ConnectionType.CONNECTION_STRING) + + @classmethod + def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id: str, + username=None, password=None) -> str: + parsed_rid = parse_resource_id(resource_id) + resource_group = parsed_rid["resource_group"] + name = parsed_rid["name"] + client = cf_db_accounts(cmd.cli_ctx, None) -db_type_to_api_version = { - DbType.COSMOS_DB: "2021-10-15", - DbType.AZURE_SQL: "2021-11-01", - DbType.MYSQL_SINGLE: "2017-12-01", - DbType.MYSQL_FLEX: "2021-05-01", - DbType.PGSQL_SINGLE: "2017-12-01", - DbType.PGSQL_FLEX: "2021-06-01", -} + if connection_type == ConnectionType.CONNECTION_STRING: + return client.list_connection_strings(resource_group, name).connection_strings[0].connection_string + else: + raise NotImplementedError() # TODO -- MSI connection string -def get_database_type(resource_id: str) -> 'DbType': - for pattern, db_type in rid_to_db_type.items(): - if re.fullmatch(pattern, resource_id, flags=re.IGNORECASE): - return db_type - raise InvalidArgumentValueError("Database resource ID is invalid or of an unsupported DB") +class AzureSqlHandler(AbstractDbHandler): + DB_TYPE_NAME = "Azure SQL" + API_VERSION = "2021-11-01" + @classmethod + def _requires_username(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: + return sku == Sku.FREE or connection_type == connection_type.CONNECTION_STRING -def get_location(cmd, resource_id: str, db_type: 'DbType') -> str: - management_hostname = cmd.cli_ctx.cloud.endpoints.resource_manager - api_version = db_type_to_api_version[db_type] - request_url = f"{management_hostname.strip('/')}{resource_id}?api-version={api_version}" + @classmethod + def _requires_password(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: + return sku == Sku.FREE or connection_type == connection_type.CONNECTION_STRING - r = send_raw_request(cmd.cli_ctx, "GET", request_url) - return r.json()["location"] + @classmethod + def _is_supported(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: + return not (sku == sku.FREE and connection_type != ConnectionType.CONNECTION_STRING) + @classmethod + def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id: str, + username=None, password=None) -> str: + parsed_rid = parse_resource_id(resource_id) + name = parsed_rid["name"] -# TODO -def get_connection_string(cmd, resource_id: str, db_type: 'DbType', username=None, password=None): - parsed_rid = parse_resource_id(resource_id) - resource_group = parsed_rid["resource_group"] - name = parsed_rid["name"] - if db_type == DbType.COSMOS_DB: - client = cf_db_accounts(cmd.cli_ctx, None) - return client.list_connection_strings(resource_group, name).connection_strings[0].connection_string - if db_type == DbType.AZURE_SQL: - if not username or not password: - raise RequiredArgumentMissingError("Must include database username and password for Azure SQL databases") - return (f"Server=tcp:{name}.database.windows.net,1433;Database={parsed_rid['child_name_1']};" - f"User ID={username};Password={password};Encrypt=true;Connection Timeout=30;") - # TODO verify - if db_type == DbType.MYSQL_SINGLE: - pass # TODO not supported? confirm with Thomas - # TODO verify - if db_type == DbType.MYSQL_FLEX: - return (f'Server="{your_server}.mysql.database.azure.com";UserID = "{your_username}";Password="{your_password}";Database="{your_database}";SslMode=MySqlSslMode.Required;SslCa="{{path_to_CA_cert}}"') - # TODO verify - if db_type == DbType.PGSQL_SINGLE: - return - # TODO verify - if db_type == DbType.PGSQL_FLEX: - return - raise InvalidArgumentValueError("Database resource ID is invalid or of an unsupported DB") + if connection_type == ConnectionType.CONNECTION_STRING: + return (f"Server=tcp:{name}.database.windows.net,1433;Database={parsed_rid['child_name_1']};" + f"User ID={username};Password={password};Encrypt=true;Connection Timeout=30;") + else: + raise NotImplementedError() # TODO -- MSI connection string + + +class MySqlFlexHandler(AbstractDbHandler): + DB_TYPE_NAME = "MySQL Flex" + API_VERSION = "2021-05-01" + + @classmethod + def _requires_username(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: + raise True + + @classmethod + def _requires_password(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: + raise True + + @classmethod + def _is_supported(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: + return connection_type == ConnectionType.CONNECTION_STRING + + @classmethod + def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id: str, + username=None, password=None) -> str: + # TODO fix + # only connection string auth supported + return (f'Server="{your_server}.mysql.database.azure.com";UserID = "{your_username}";' + f'Password="{your_password}";Database="{your_database}";SslMode=MySqlSslMode.Required;' + 'SslCa="{path_to_CA_cert}"') + + +class PgSqlSingleHandler(AbstractDbHandler): + DB_TYPE_NAME = "PostgreSQL Single" + API_VERSION = "2017-12-01" + + @classmethod + def _requires_username(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: + raise True + @classmethod + def _requires_password(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: + return connection_type == connection_type.CONNECTION_STRING + + @classmethod + def _is_supported(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: + raise NotImplementedError() + + @classmethod + def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id: str, + username=None, password=None) -> str: + raise NotImplementedError() # TODO connection string / MSI auth + + +class PgSqlFlexHandler(AbstractDbHandler): + DB_TYPE_NAME = "PostgreSQL Flex" + API_VERSION = "2021-06-01" + + @classmethod + def _requires_username(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: + return True + + @classmethod + def _requires_password(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: + return True + + @classmethod + def _is_supported(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: + return connection_type == ConnectionType.CONNECTION_STRING + + @classmethod + def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id: str, + username=None, password=None) -> str: + raise NotImplementedError() # TODO connection string (MSI not supported) + + +RESOURCE_ID_TO_DB_HANDLER = { + r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DocumentDB/databaseAccounts\/.*$": CosmosDbHandler, + r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers/Microsoft.Sql/servers\/.*\/databases\/.*$": AzureSqlHandler, + r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DBforMySQL/flexibleServers\/.*$": MySqlFlexHandler, + r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DBforPostgreSQL\/servers\/.*$": PgSqlSingleHandler, + r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DBforPostgreSQL\/flexibleServers\/.*$": PgSqlFlexHandler, +} + + +def get_database_type(resource_id: str) -> 'AbstractDbHandler': + for pattern, db_type in RESOURCE_ID_TO_DB_HANDLER.items(): + if re.fullmatch(pattern, resource_id, flags=re.IGNORECASE): + return db_type + raise InvalidArgumentValueError("Database resource ID is invalid or of an unsupported DB") diff --git a/src/staticwebapp/azext_staticwebapp/custom.py b/src/staticwebapp/azext_staticwebapp/custom.py index 9c2d3477fe6..bd6b04c9461 100644 --- a/src/staticwebapp/azext_staticwebapp/custom.py +++ b/src/staticwebapp/azext_staticwebapp/custom.py @@ -6,25 +6,26 @@ from ._clients import DbConnectionClient from ._models import DbConnection -from ._utils import get_database_type, get_location, get_connection_string +from ._utils import get_database_type, Sku, ConnectionType +from azure.cli.command_modules.appservice.static_sites import show_staticsite # TODO remove or use "use_connection_string" # TODO add MSI arguments -# TODO add database username/password arguments def create_dbconnection(cmd, resource_group_name, name, db_resource_id, environment=None, use_connection_string=None, connection_string=None, username=None, password=None): + app = show_staticsite(cmd, name, resource_group_name) + sku = Sku.FREE if app.sku.name.lower() == "free" else Sku.STANDARD + connection_type = ConnectionType.CONNECTION_STRING # TODO make this conditional on MSI args db_type = get_database_type(db_resource_id) - region = get_location(cmd, db_resource_id, db_type) + region = db_type.get_location(cmd, db_resource_id) if not connection_string: - connection_string = get_connection_string(cmd, db_resource_id, db_type, username, password) - # TODO add MSI logic - # print(connection_string) + connection_string = db_type.get_connection_string(cmd, sku, connection_type, db_resource_id, username, password) connection = DbConnection connection["properties"]["resourceId"] = db_resource_id - connection["properties"]["connectionIdentity"] = None # TODO ? + connection["properties"]["connectionIdentity"] = None # TODO take this from MSI args connection["properties"]["connectionString"] = connection_string connection["properties"]["region"] = region From 845b6b4366ab99ed8c28396738322479aded9d34 Mon Sep 17 00:00:00 2001 From: Silas Strawn Date: Thu, 1 Dec 2022 17:16:14 -0600 Subject: [PATCH 04/27] add connection string logic for non-pgsql databases --- src/staticwebapp/azext_staticwebapp/_utils.py | 34 +++++++++++++------ src/staticwebapp/azext_staticwebapp/custom.py | 29 +++++++++++++--- 2 files changed, 49 insertions(+), 14 deletions(-) diff --git a/src/staticwebapp/azext_staticwebapp/_utils.py b/src/staticwebapp/azext_staticwebapp/_utils.py index b4947a49e68..8a26007f8fa 100644 --- a/src/staticwebapp/azext_staticwebapp/_utils.py +++ b/src/staticwebapp/azext_staticwebapp/_utils.py @@ -102,7 +102,7 @@ def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionTyp if connection_type == ConnectionType.CONNECTION_STRING: return client.list_connection_strings(resource_group, name).connection_strings[0].connection_string else: - raise NotImplementedError() # TODO -- MSI connection string + return client.get(resource_group, name).document_endpoint class AzureSqlHandler(AbstractDbHandler): @@ -131,7 +131,8 @@ def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionTyp return (f"Server=tcp:{name}.database.windows.net,1433;Database={parsed_rid['child_name_1']};" f"User ID={username};Password={password};Encrypt=true;Connection Timeout=30;") else: - raise NotImplementedError() # TODO -- MSI connection string + return (f"Server=tcp:{name}.database.windows.net,1433;Database={parsed_rid['child_name_1']};" + f"Encrypt=true;Connection Timeout=30;") class MySqlFlexHandler(AbstractDbHandler): @@ -140,11 +141,11 @@ class MySqlFlexHandler(AbstractDbHandler): @classmethod def _requires_username(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: - raise True + return True @classmethod def _requires_password(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: - raise True + return True @classmethod def _is_supported(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: @@ -153,12 +154,25 @@ def _is_supported(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: @classmethod def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id: str, username=None, password=None) -> str: - # TODO fix + parsed_rid = parse_resource_id(resource_id) + server = parsed_rid["name"] + db = parsed_rid["child_name_1"] # only connection string auth supported - return (f'Server="{your_server}.mysql.database.azure.com";UserID = "{your_username}";' - f'Password="{your_password}";Database="{your_database}";SslMode=MySqlSslMode.Required;' + return (f'Server="{server}.mysql.database.azure.com";UserID = "{username}";' + f'Password="{password}";Database="{db}";SslMode=MySqlSslMode.Required;' 'SslCa="{path_to_CA_cert}"') + @classmethod + def get_location(cls, cmd, resource_id: str) -> str: + from msrestazure.tools import resource_id as rid + + parsed_rid = parse_resource_id(resource_id) + unneeded_props = ["child_name_1", "child_type_1", "children", "last_child_num", "child_parent_1"] + for k in unneeded_props: + if k in parsed_rid: + del parsed_rid[k] + return super(MySqlFlexHandler, cls).get_location(cmd, rid(**parsed_rid)) + class PgSqlSingleHandler(AbstractDbHandler): DB_TYPE_NAME = "PostgreSQL Single" @@ -166,7 +180,7 @@ class PgSqlSingleHandler(AbstractDbHandler): @classmethod def _requires_username(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: - raise True + return True @classmethod def _requires_password(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: @@ -206,8 +220,8 @@ def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionTyp RESOURCE_ID_TO_DB_HANDLER = { r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DocumentDB/databaseAccounts\/.*$": CosmosDbHandler, - r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers/Microsoft.Sql/servers\/.*\/databases\/.*$": AzureSqlHandler, - r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DBforMySQL/flexibleServers\/.*$": MySqlFlexHandler, + r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.Sql\/servers\/.*\/databases\/.*$": AzureSqlHandler, + r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DBforMySQL\/flexibleServers\/.*\/databases\/.*$": MySqlFlexHandler, r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DBforPostgreSQL\/servers\/.*$": PgSqlSingleHandler, r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DBforPostgreSQL\/flexibleServers\/.*$": PgSqlFlexHandler, } diff --git a/src/staticwebapp/azext_staticwebapp/custom.py b/src/staticwebapp/azext_staticwebapp/custom.py index bd6b04c9461..6dfd03434a1 100644 --- a/src/staticwebapp/azext_staticwebapp/custom.py +++ b/src/staticwebapp/azext_staticwebapp/custom.py @@ -7,25 +7,46 @@ from ._clients import DbConnectionClient from ._models import DbConnection from ._utils import get_database_type, Sku, ConnectionType + +from azure.cli.core.azclierror import MutuallyExclusiveArgumentError, InvalidArgumentValueError from azure.cli.command_modules.appservice.static_sites import show_staticsite +from msrestazure.tools import is_valid_resource_id + # TODO remove or use "use_connection_string" -# TODO add MSI arguments +# TODO check these args against Thomas's spec def create_dbconnection(cmd, resource_group_name, name, db_resource_id, environment=None, use_connection_string=None, - connection_string=None, username=None, password=None): + connection_string=None, username=None, password=None, + mi_user_assigned=None, mi_system_assigned=False): + if mi_system_assigned and mi_user_assigned: + raise MutuallyExclusiveArgumentError("Cannot use both system and user assigned identities") + + connection_type = ConnectionType.CONNECTION_STRING + if mi_user_assigned: + if not is_valid_resource_id(mi_user_assigned): + raise InvalidArgumentValueError("User-assigned identity must be a valid resource ID") + connection_type = ConnectionType.MANAGED_IDENTITY_USER_ASSIGNED + elif mi_system_assigned: + connection_type = ConnectionType.MANAGED_IDENTITY_SYTEM_ASSIGNED + app = show_staticsite(cmd, name, resource_group_name) sku = Sku.FREE if app.sku.name.lower() == "free" else Sku.STANDARD - connection_type = ConnectionType.CONNECTION_STRING # TODO make this conditional on MSI args db_type = get_database_type(db_resource_id) region = db_type.get_location(cmd, db_resource_id) if not connection_string: connection_string = db_type.get_connection_string(cmd, sku, connection_type, db_resource_id, username, password) + identity = None + if mi_user_assigned: + identity = mi_user_assigned + elif mi_system_assigned: + identity = "SystemAssigned" + connection = DbConnection connection["properties"]["resourceId"] = db_resource_id - connection["properties"]["connectionIdentity"] = None # TODO take this from MSI args + connection["properties"]["connectionIdentity"] = identity connection["properties"]["connectionString"] = connection_string connection["properties"]["region"] = region From 72fd1dd640517c94b16da573ddab8bb3c8a1c76a Mon Sep 17 00:00:00 2001 From: Silas Strawn Date: Fri, 2 Dec 2022 09:57:24 -0600 Subject: [PATCH 05/27] add params and pgsql flex connection string logic --- .../azext_staticwebapp/_params.py | 10 +++++--- src/staticwebapp/azext_staticwebapp/_utils.py | 25 +++++++++++++++---- src/staticwebapp/azext_staticwebapp/custom.py | 3 +-- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/src/staticwebapp/azext_staticwebapp/_params.py b/src/staticwebapp/azext_staticwebapp/_params.py index 45e3d6316d9..040c5dd9153 100644 --- a/src/staticwebapp/azext_staticwebapp/_params.py +++ b/src/staticwebapp/azext_staticwebapp/_params.py @@ -16,11 +16,13 @@ def load_arguments(self, _): with self.argument_context('staticwebapp dbconnection create') as c: c.argument('db_resource_id', options_list=['--db-resource-id', '-d'], - help="Get detailed information on database connections") - c.argument('use_connection_string', options_list=['--use-connection-string', '-c'], action='store_true', - default=False, help="Force the usage of connection string") + help="The resource ID for the database to connect to.") + c.argument('connection_string', options_list=["--connection-string", "-c"], help="The database connection string. A connection string will be generated automatically if this argument is not present.") + c.argument('username', options_list=["--username", "-u"], help="The username to use for authentication with the database. Not required for all databases.") + c.argument('password', options_list=["--password", "-p"], help="The password to use for authentication with the database. Not required for all databases.") + c.argument('mi_user_assigned', options_list=["--mi-user-assigned", "-i"], help="A resource ID for a user-assigned managed identity to use for auth with the database. Must be assigned to the Static Web App and have the right permissions on the database.") + c.argument('mi_system_assigned', options_list=["--mi-system-assigned", "-s"], help="Use the Static Web App's system-assigned identity for auth with the database. Must be assigned to the Static Web App and have the right permissions on the database.") with self.argument_context('staticwebapp dbconnection show') as c: c.argument('detailed', options_list=['--detailed', '-d'],action='store_true', default=False, help="Get detailed information on database connections") - diff --git a/src/staticwebapp/azext_staticwebapp/_utils.py b/src/staticwebapp/azext_staticwebapp/_utils.py index 8a26007f8fa..bb45e97784a 100644 --- a/src/staticwebapp/azext_staticwebapp/_utils.py +++ b/src/staticwebapp/azext_staticwebapp/_utils.py @@ -42,7 +42,7 @@ def _is_supported(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: @classmethod def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id: str, - username=None, password=None) -> str: + username=None, password=None, **kwargs) -> str: raise NotImplementedError() @classmethod @@ -70,9 +70,9 @@ def get_location(cls, cmd, resource_id: str) -> str: @classmethod def get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id: str, - username=None, password=None) -> str: + username=None, password=None, **kwargs) -> str: cls._validate(sku, connection_type, username, password) - return cls._get_connection_string(cmd, sku, connection_type, resource_id, username, password) + return cls._get_connection_string(cmd, sku, connection_type, resource_id, username, password, **kwargs) class CosmosDbHandler(AbstractDbHandler): @@ -212,10 +212,25 @@ def _requires_password(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bo def _is_supported(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: return connection_type == ConnectionType.CONNECTION_STRING + @classmethod + def get_location(cls, cmd, resource_id: str) -> str: + from msrestazure.tools import resource_id as rid + + parsed_rid = parse_resource_id(resource_id) + unneeded_props = ["child_name_1", "child_type_1", "children", "last_child_num", "child_parent_1"] + for k in unneeded_props: + if k in parsed_rid: + del parsed_rid[k] + return super(PgSqlFlexHandler, cls).get_location(cmd, rid(**parsed_rid)) + @classmethod def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id: str, username=None, password=None) -> str: - raise NotImplementedError() # TODO connection string (MSI not supported) + parsed_rid = parse_resource_id(resource_id) + server = parsed_rid["name"] + db = parsed_rid["child_name_1"] + return (f"Server={server}.postgres.database.azure.com;Database={db};Port=5432;" + f"User Id={username};Password={password};Ssl Mode=Require;") RESOURCE_ID_TO_DB_HANDLER = { @@ -223,7 +238,7 @@ def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionTyp r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.Sql\/servers\/.*\/databases\/.*$": AzureSqlHandler, r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DBforMySQL\/flexibleServers\/.*\/databases\/.*$": MySqlFlexHandler, r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DBforPostgreSQL\/servers\/.*$": PgSqlSingleHandler, - r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DBforPostgreSQL\/flexibleServers\/.*$": PgSqlFlexHandler, + r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DBforPostgreSQL\/flexibleServers\/.*\/databases\/.*$": PgSqlFlexHandler, } diff --git a/src/staticwebapp/azext_staticwebapp/custom.py b/src/staticwebapp/azext_staticwebapp/custom.py index 6dfd03434a1..e2e1c458dc1 100644 --- a/src/staticwebapp/azext_staticwebapp/custom.py +++ b/src/staticwebapp/azext_staticwebapp/custom.py @@ -14,9 +14,8 @@ from msrestazure.tools import is_valid_resource_id -# TODO remove or use "use_connection_string" # TODO check these args against Thomas's spec -def create_dbconnection(cmd, resource_group_name, name, db_resource_id, environment=None, use_connection_string=None, +def create_dbconnection(cmd, resource_group_name, name, db_resource_id, environment=None, connection_string=None, username=None, password=None, mi_user_assigned=None, mi_system_assigned=False): if mi_system_assigned and mi_user_assigned: From 1e4b2c798597087e8fc27a95dbc6dea6ebd00c7d Mon Sep 17 00:00:00 2001 From: Silas Strawn Date: Fri, 2 Dec 2022 10:44:21 -0600 Subject: [PATCH 06/27] add connection string logic for pgsql single; minor refactor --- src/staticwebapp/azext_staticwebapp/_utils.py | 73 ++++++++++++------- src/staticwebapp/azext_staticwebapp/custom.py | 2 +- 2 files changed, 49 insertions(+), 26 deletions(-) diff --git a/src/staticwebapp/azext_staticwebapp/_utils.py b/src/staticwebapp/azext_staticwebapp/_utils.py index bb45e97784a..37d372ad4b6 100644 --- a/src/staticwebapp/azext_staticwebapp/_utils.py +++ b/src/staticwebapp/azext_staticwebapp/_utils.py @@ -6,17 +6,19 @@ from enum import Enum, auto import re +from functools import lru_cache +from msrestazure.tools import parse_resource_id from azure.cli.core.azclierror import InvalidArgumentValueError, RequiredArgumentMissingError, ValidationError from azure.cli.core.util import send_raw_request from azure.cli.command_modules.cosmosdb._client_factory import cf_db_accounts -from msrestazure.tools import parse_resource_id + class ConnectionType(Enum): CONNECTION_STRING = auto() MANAGED_IDENTITY_USER_ASSIGNED = auto() - MANAGED_IDENTITY_SYTEM_ASSIGNED= auto() + MANAGED_IDENTITY_SYSTEM_ASSIGNED= auto() class Sku(Enum): @@ -45,6 +47,12 @@ def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionTyp username=None, password=None, **kwargs) -> str: raise NotImplementedError() + # saves some time by prevent reparsing of RIDs + @classmethod + @lru_cache(maxsize=100) + def _parse_resource_id(resource_id: str) -> dict: + return parse_resource_id(resource_id) + @classmethod def _validate(cls, sku: 'Sku', connection_type: 'ConnectionType', username=None, password=None): if not cls._is_supported(sku, connection_type): @@ -61,13 +69,31 @@ def _validate(cls, sku: 'Sku', connection_type: 'ConnectionType', username=None, raise RequiredArgumentMissingError("Missing database username") @classmethod - def get_location(cls, cmd, resource_id: str) -> str: + def _get_location(cls, cmd, resource_id: str) -> str: management_hostname = cmd.cli_ctx.cloud.endpoints.resource_manager request_url = f"{management_hostname.strip('/')}{resource_id}?api-version={cls.API_VERSION}" r = send_raw_request(cmd.cli_ctx, "GET", request_url) return r.json()["location"] + @classmethod + def get_location(cls, cmd, resource_id: str) -> str: + return cls._get_location(cmd, resource_id) + + # Needed when doing a GET on the DB doesn't give the location + @classmethod + def _get_location_from_server(cls, cmd, resource_id: str) -> str: + from msrestazure.tools import resource_id as rid + + parsed_rid = cls._parse_resource_id(resource_id) + unneeded_props = {"child_name_1", "child_type_1", "children", "last_child_num", "child_parent_1"} + server_rid_parts = dict() + for k in parsed_rid: + if k not in unneeded_props: + server_rid_parts[k] = parsed_rid[k] + + return cls._get_location(cmd, rid(**server_rid_parts)) + @classmethod def get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id: str, username=None, password=None, **kwargs) -> str: @@ -94,7 +120,7 @@ def _is_supported(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: @classmethod def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id: str, username=None, password=None) -> str: - parsed_rid = parse_resource_id(resource_id) + parsed_rid = cls._parse_resource_id(resource_id) resource_group = parsed_rid["resource_group"] name = parsed_rid["name"] client = cf_db_accounts(cmd.cli_ctx, None) @@ -124,7 +150,7 @@ def _is_supported(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: @classmethod def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id: str, username=None, password=None) -> str: - parsed_rid = parse_resource_id(resource_id) + parsed_rid = cls._parse_resource_id(resource_id) name = parsed_rid["name"] if connection_type == ConnectionType.CONNECTION_STRING: @@ -154,7 +180,7 @@ def _is_supported(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: @classmethod def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id: str, username=None, password=None) -> str: - parsed_rid = parse_resource_id(resource_id) + parsed_rid = cls._parse_resource_id(resource_id) server = parsed_rid["name"] db = parsed_rid["child_name_1"] # only connection string auth supported @@ -164,14 +190,7 @@ def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionTyp @classmethod def get_location(cls, cmd, resource_id: str) -> str: - from msrestazure.tools import resource_id as rid - - parsed_rid = parse_resource_id(resource_id) - unneeded_props = ["child_name_1", "child_type_1", "children", "last_child_num", "child_parent_1"] - for k in unneeded_props: - if k in parsed_rid: - del parsed_rid[k] - return super(MySqlFlexHandler, cls).get_location(cmd, rid(**parsed_rid)) + return cls._get_location_from_server(cmd, resource_id) class PgSqlSingleHandler(AbstractDbHandler): @@ -188,12 +207,23 @@ def _requires_password(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bo @classmethod def _is_supported(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: - raise NotImplementedError() + return not (sku == sku.FREE and connection_type != ConnectionType.CONNECTION_STRING) + + @classmethod + def get_location(cls, cmd, resource_id: str) -> str: + return cls._get_location_from_server(cmd, resource_id) @classmethod def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id: str, username=None, password=None) -> str: - raise NotImplementedError() # TODO connection string / MSI auth + parsed_rid = cls._parse_resource_id(resource_id) + server = parsed_rid["name"] + db = parsed_rid["child_name_1"] + if connection_type == ConnectionType.CONNECTION_STRING: + return (f"Server={server}.postgres.database.azure.com;Database={db};Port=5432;" + f"User Id={username}@{server};Password={password};Ssl Mode=Require;") + else: + raise NotImplementedError() class PgSqlFlexHandler(AbstractDbHandler): @@ -214,19 +244,12 @@ def _is_supported(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: @classmethod def get_location(cls, cmd, resource_id: str) -> str: - from msrestazure.tools import resource_id as rid - - parsed_rid = parse_resource_id(resource_id) - unneeded_props = ["child_name_1", "child_type_1", "children", "last_child_num", "child_parent_1"] - for k in unneeded_props: - if k in parsed_rid: - del parsed_rid[k] - return super(PgSqlFlexHandler, cls).get_location(cmd, rid(**parsed_rid)) + return cls._get_location_from_server(cmd, resource_id) @classmethod def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id: str, username=None, password=None) -> str: - parsed_rid = parse_resource_id(resource_id) + parsed_rid = cls._parse_resource_id(resource_id) server = parsed_rid["name"] db = parsed_rid["child_name_1"] return (f"Server={server}.postgres.database.azure.com;Database={db};Port=5432;" diff --git a/src/staticwebapp/azext_staticwebapp/custom.py b/src/staticwebapp/azext_staticwebapp/custom.py index e2e1c458dc1..a947ed51355 100644 --- a/src/staticwebapp/azext_staticwebapp/custom.py +++ b/src/staticwebapp/azext_staticwebapp/custom.py @@ -27,7 +27,7 @@ def create_dbconnection(cmd, resource_group_name, name, db_resource_id, environm raise InvalidArgumentValueError("User-assigned identity must be a valid resource ID") connection_type = ConnectionType.MANAGED_IDENTITY_USER_ASSIGNED elif mi_system_assigned: - connection_type = ConnectionType.MANAGED_IDENTITY_SYTEM_ASSIGNED + connection_type = ConnectionType.MANAGED_IDENTITY_SYSTEM_ASSIGNED app = show_staticsite(cmd, name, resource_group_name) sku = Sku.FREE if app.sku.name.lower() == "free" else Sku.STANDARD From b3bcaae3f9ac66426c295b4256b3df9dffedce60 Mon Sep 17 00:00:00 2001 From: Silas Strawn Date: Fri, 2 Dec 2022 12:22:13 -0600 Subject: [PATCH 07/27] finish DB connection string logic; add warning text for providing unneeded creds --- src/staticwebapp/azext_staticwebapp/_utils.py | 51 ++++++++++++++++--- src/staticwebapp/azext_staticwebapp/custom.py | 3 +- src/staticwebapp/setup.py | 2 +- 3 files changed, 46 insertions(+), 10 deletions(-) diff --git a/src/staticwebapp/azext_staticwebapp/_utils.py b/src/staticwebapp/azext_staticwebapp/_utils.py index 37d372ad4b6..a81e8da53d5 100644 --- a/src/staticwebapp/azext_staticwebapp/_utils.py +++ b/src/staticwebapp/azext_staticwebapp/_utils.py @@ -9,11 +9,17 @@ from functools import lru_cache from msrestazure.tools import parse_resource_id +from knack.log import get_logger from azure.cli.core.azclierror import InvalidArgumentValueError, RequiredArgumentMissingError, ValidationError from azure.cli.core.util import send_raw_request +from azure.cli.core.profiles import ResourceType +from azure.cli.core.commands.client_factory import get_mgmt_service_client from azure.cli.command_modules.cosmosdb._client_factory import cf_db_accounts +from azure.cli.command_modules.role import graph_client_factory +logger = get_logger(__name__) + class ConnectionType(Enum): CONNECTION_STRING = auto() @@ -50,7 +56,7 @@ def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionTyp # saves some time by prevent reparsing of RIDs @classmethod @lru_cache(maxsize=100) - def _parse_resource_id(resource_id: str) -> dict: + def _parse_resource_id(cls, resource_id: str) -> dict: return parse_resource_id(resource_id) @classmethod @@ -68,6 +74,16 @@ def _validate(cls, sku: 'Sku', connection_type: 'ConnectionType', username=None, if missing_username: raise RequiredArgumentMissingError("Missing database username") + + unnecessary_username = username and not cls._requires_username(sku, connection_type) + unnecessary_password = password and not cls._requires_password(sku, connection_type) + if unnecessary_username and unnecessary_password: + logger.warning("Username and password not required. Ignoring the provided username and password.") + elif unnecessary_username: + logger.warning("Username not required. Ignoring the provided username.") + elif unnecessary_password: + logger.warning("Password not required. Ignoring the provided password.") + @classmethod def _get_location(cls, cmd, resource_id: str) -> str: management_hostname = cmd.cli_ctx.cloud.endpoints.resource_manager @@ -119,7 +135,7 @@ def _is_supported(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: @classmethod def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id: str, - username=None, password=None) -> str: + username=None, password=None, **kwargs) -> str: parsed_rid = cls._parse_resource_id(resource_id) resource_group = parsed_rid["resource_group"] name = parsed_rid["name"] @@ -149,7 +165,7 @@ def _is_supported(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: @classmethod def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id: str, - username=None, password=None) -> str: + username=None, password=None, **kwargs) -> str: parsed_rid = cls._parse_resource_id(resource_id) name = parsed_rid["name"] @@ -179,7 +195,7 @@ def _is_supported(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: @classmethod def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id: str, - username=None, password=None) -> str: + username=None, password=None, **kwargs) -> str: parsed_rid = cls._parse_resource_id(resource_id) server = parsed_rid["name"] db = parsed_rid["child_name_1"] @@ -213,9 +229,25 @@ def _is_supported(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: def get_location(cls, cmd, resource_id: str) -> str: return cls._get_location_from_server(cmd, resource_id) + @classmethod + def _get_client_id(cls, cmd, connection_type: 'ConnectionType', app=None, identity_rid=None) -> str: + # TODO does this need to handle managed identities outside the user's sub? + # It will almost surely fail in this case ^ + if connection_type == ConnectionType.MANAGED_IDENTITY_USER_ASSIGNED: + parsed_rid = cls._parse_resource_id(identity_rid) + resource_group_name = parsed_rid["resource_group"] + name = parsed_rid["name"] + client = get_mgmt_service_client(cmd.cli_ctx, ResourceType.MGMT_MSI).user_assigned_identities + identity = client.get(resource_group_name, name) + return identity.client_id + else: + client = graph_client_factory(cmd.cli_ctx) + sp = client.service_principal_get(app.identity.principal_id) + return sp["appId"] + @classmethod def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id: str, - username=None, password=None) -> str: + username=None, password=None, **kwargs) -> str: parsed_rid = cls._parse_resource_id(resource_id) server = parsed_rid["name"] db = parsed_rid["child_name_1"] @@ -223,7 +255,10 @@ def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionTyp return (f"Server={server}.postgres.database.azure.com;Database={db};Port=5432;" f"User Id={username}@{server};Password={password};Ssl Mode=Require;") else: - raise NotImplementedError() + client_id = cls._get_client_id(cmd, connection_type, kwargs["app"], kwargs["identity_rid"]) + return (f"Server={server}.postgres.database.azure.com;Database={db};Port=5432;" + f"User Id={client_id};Ssl Mode=Require;") + class PgSqlFlexHandler(AbstractDbHandler): @@ -248,7 +283,7 @@ def get_location(cls, cmd, resource_id: str) -> str: @classmethod def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id: str, - username=None, password=None) -> str: + username=None, password=None, **kwargs) -> str: parsed_rid = cls._parse_resource_id(resource_id) server = parsed_rid["name"] db = parsed_rid["child_name_1"] @@ -260,7 +295,7 @@ def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionTyp r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DocumentDB/databaseAccounts\/.*$": CosmosDbHandler, r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.Sql\/servers\/.*\/databases\/.*$": AzureSqlHandler, r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DBforMySQL\/flexibleServers\/.*\/databases\/.*$": MySqlFlexHandler, - r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DBforPostgreSQL\/servers\/.*$": PgSqlSingleHandler, + r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DBforPostgreSQL\/servers\/.*\/databases\/.*$": PgSqlSingleHandler, r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DBforPostgreSQL\/flexibleServers\/.*\/databases\/.*$": PgSqlFlexHandler, } diff --git a/src/staticwebapp/azext_staticwebapp/custom.py b/src/staticwebapp/azext_staticwebapp/custom.py index a947ed51355..ab51e1428a2 100644 --- a/src/staticwebapp/azext_staticwebapp/custom.py +++ b/src/staticwebapp/azext_staticwebapp/custom.py @@ -35,7 +35,8 @@ def create_dbconnection(cmd, resource_group_name, name, db_resource_id, environm region = db_type.get_location(cmd, db_resource_id) if not connection_string: - connection_string = db_type.get_connection_string(cmd, sku, connection_type, db_resource_id, username, password) + connection_string = db_type.get_connection_string(cmd, sku, connection_type, db_resource_id, username, password, + app=app, identity_rid=mi_user_assigned) identity = None if mi_user_assigned: diff --git a/src/staticwebapp/setup.py b/src/staticwebapp/setup.py index 4da096c6a88..654683893c1 100644 --- a/src/staticwebapp/setup.py +++ b/src/staticwebapp/setup.py @@ -16,7 +16,7 @@ # TODO: Confirm this is the right version number you want and it matches your # HISTORY.rst entry. -VERSION = '0.1.0' +VERSION = 'private-test-0.0.0' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers From 8ba5377fc43c5db143d65a93b285253870b8cb57 Mon Sep 17 00:00:00 2001 From: Silas Strawn Date: Tue, 13 Dec 2022 09:32:01 -0800 Subject: [PATCH 08/27] start style fixes --- src/staticwebapp/azext_staticwebapp/_utils.py | 3 ++- src/staticwebapp/azext_staticwebapp/commands.py | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/staticwebapp/azext_staticwebapp/_utils.py b/src/staticwebapp/azext_staticwebapp/_utils.py index a81e8da53d5..e5eb3b53378 100644 --- a/src/staticwebapp/azext_staticwebapp/_utils.py +++ b/src/staticwebapp/azext_staticwebapp/_utils.py @@ -103,7 +103,7 @@ def _get_location_from_server(cls, cmd, resource_id: str) -> str: parsed_rid = cls._parse_resource_id(resource_id) unneeded_props = {"child_name_1", "child_type_1", "children", "last_child_num", "child_parent_1"} - server_rid_parts = dict() + server_rid_parts = {} for k in parsed_rid: if k not in unneeded_props: server_rid_parts[k] = parsed_rid[k] @@ -291,6 +291,7 @@ def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionTyp f"User Id={username};Password={password};Ssl Mode=Require;") +# pylint: disable=line-too-long RESOURCE_ID_TO_DB_HANDLER = { r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DocumentDB/databaseAccounts\/.*$": CosmosDbHandler, r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.Sql\/servers\/.*\/databases\/.*$": AzureSqlHandler, diff --git a/src/staticwebapp/azext_staticwebapp/commands.py b/src/staticwebapp/azext_staticwebapp/commands.py index 178a8ee5df0..0cbd6831754 100644 --- a/src/staticwebapp/azext_staticwebapp/commands.py +++ b/src/staticwebapp/azext_staticwebapp/commands.py @@ -3,8 +3,6 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -# pylint: disable=line-too-long - def load_command_table(self, _): with self.command_group('staticwebapp dbconnection') as g: From ebe018e620b7d8e77e52151081b9e3733a9a103c Mon Sep 17 00:00:00 2001 From: Silas Strawn Date: Wed, 14 Dec 2022 16:11:36 -0800 Subject: [PATCH 09/27] remove connection string overriding; use DB server RIDs instead of DB RIDs --- .../azext_staticwebapp/_params.py | 4 +- src/staticwebapp/azext_staticwebapp/_utils.py | 86 ++++++++++++------- src/staticwebapp/azext_staticwebapp/custom.py | 11 +-- 3 files changed, 63 insertions(+), 38 deletions(-) diff --git a/src/staticwebapp/azext_staticwebapp/_params.py b/src/staticwebapp/azext_staticwebapp/_params.py index 040c5dd9153..4e21cec2714 100644 --- a/src/staticwebapp/azext_staticwebapp/_params.py +++ b/src/staticwebapp/azext_staticwebapp/_params.py @@ -16,8 +16,8 @@ def load_arguments(self, _): with self.argument_context('staticwebapp dbconnection create') as c: c.argument('db_resource_id', options_list=['--db-resource-id', '-d'], - help="The resource ID for the database to connect to.") - c.argument('connection_string', options_list=["--connection-string", "-c"], help="The database connection string. A connection string will be generated automatically if this argument is not present.") + help="The azure resource ID for the database server/account to connect to e.g. '/subscriptions/MySubId/resourceGroups/MyResourceGroup/providers/Microsoft.Sql/servers/MyServer' for an Azure SQL database") + c.argument('db_name', options_list=['--db-name', '-b'], help="The name of the database to connect to. Not required for CosmosDB.") c.argument('username', options_list=["--username", "-u"], help="The username to use for authentication with the database. Not required for all databases.") c.argument('password', options_list=["--password", "-p"], help="The password to use for authentication with the database. Not required for all databases.") c.argument('mi_user_assigned', options_list=["--mi-user-assigned", "-i"], help="A resource ID for a user-assigned managed identity to use for auth with the database. Must be assigned to the Static Web App and have the right permissions on the database.") diff --git a/src/staticwebapp/azext_staticwebapp/_utils.py b/src/staticwebapp/azext_staticwebapp/_utils.py index e5eb3b53378..503cee503b7 100644 --- a/src/staticwebapp/azext_staticwebapp/_utils.py +++ b/src/staticwebapp/azext_staticwebapp/_utils.py @@ -49,8 +49,12 @@ def _is_supported(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: raise NotImplementedError() @classmethod - def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id: str, - username=None, password=None, **kwargs) -> str: + def _requires_database_name(cls) -> bool: + raise NotImplementedError() + + @classmethod + def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id, database_name, + username=None, password=None, **kwargs): raise NotImplementedError() # saves some time by prevent reparsing of RIDs @@ -60,7 +64,7 @@ def _parse_resource_id(cls, resource_id: str) -> dict: return parse_resource_id(resource_id) @classmethod - def _validate(cls, sku: 'Sku', connection_type: 'ConnectionType', username=None, password=None): + def _validate(cls, sku: 'Sku', connection_type: 'ConnectionType', database_name, username, password): if not cls._is_supported(sku, connection_type): raise ValidationError(f"Authentication type '{connection_type}' is not supported for " f"sku '{sku}' and database type '{cls.DB_TYPE_NAME}'") @@ -74,7 +78,6 @@ def _validate(cls, sku: 'Sku', connection_type: 'ConnectionType', username=None, if missing_username: raise RequiredArgumentMissingError("Missing database username") - unnecessary_username = username and not cls._requires_username(sku, connection_type) unnecessary_password = password and not cls._requires_password(sku, connection_type) if unnecessary_username and unnecessary_password: @@ -84,6 +87,13 @@ def _validate(cls, sku: 'Sku', connection_type: 'ConnectionType', username=None, elif unnecessary_password: logger.warning("Password not required. Ignoring the provided password.") + requires_db_name = cls._requires_database_name() + if not database_name and requires_db_name: + raise RequiredArgumentMissingError("Database name (--db-name/-b) required for database type " + f"'{cls.DB_TYPE_NAME}'.") + if database_name and not requires_db_name: + logger.warning("Database name not required. Ignoring the provided database name.") + @classmethod def _get_location(cls, cmd, resource_id: str) -> str: management_hostname = cmd.cli_ctx.cloud.endpoints.resource_manager @@ -111,10 +121,11 @@ def _get_location_from_server(cls, cmd, resource_id: str) -> str: return cls._get_location(cmd, rid(**server_rid_parts)) @classmethod - def get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id: str, + def get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id, database_name, username=None, password=None, **kwargs) -> str: - cls._validate(sku, connection_type, username, password) - return cls._get_connection_string(cmd, sku, connection_type, resource_id, username, password, **kwargs) + cls._validate(sku, connection_type, database_name, username, password) + return cls._get_connection_string(cmd, sku, connection_type, resource_id, database_name, + username, password, **kwargs) class CosmosDbHandler(AbstractDbHandler): @@ -134,7 +145,11 @@ def _is_supported(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: return not (sku == sku.FREE and connection_type != ConnectionType.CONNECTION_STRING) @classmethod - def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id: str, + def _requires_database_name(cls) -> bool: + return False + + @classmethod + def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id, database_name, username=None, password=None, **kwargs) -> str: parsed_rid = cls._parse_resource_id(resource_id) resource_group = parsed_rid["resource_group"] @@ -164,16 +179,20 @@ def _is_supported(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: return not (sku == sku.FREE and connection_type != ConnectionType.CONNECTION_STRING) @classmethod - def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id: str, + def _requires_database_name(cls) -> bool: + return True + + @classmethod + def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id, database_name, username=None, password=None, **kwargs) -> str: parsed_rid = cls._parse_resource_id(resource_id) name = parsed_rid["name"] if connection_type == ConnectionType.CONNECTION_STRING: - return (f"Server=tcp:{name}.database.windows.net,1433;Database={parsed_rid['child_name_1']};" + return (f"Server=tcp:{name}.database.windows.net,1433;Database={database_name};" f"User ID={username};Password={password};Encrypt=true;Connection Timeout=30;") else: - return (f"Server=tcp:{name}.database.windows.net,1433;Database={parsed_rid['child_name_1']};" + return (f"Server=tcp:{name}.database.windows.net,1433;Database={database_name};" f"Encrypt=true;Connection Timeout=30;") @@ -194,14 +213,17 @@ def _is_supported(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: return connection_type == ConnectionType.CONNECTION_STRING @classmethod - def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id: str, - username=None, password=None, **kwargs) -> str: + def _requires_database_name(cls) -> bool: + return True + + @classmethod + def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id, database_name, + username=None, password=None, **kwargs) -> str: parsed_rid = cls._parse_resource_id(resource_id) server = parsed_rid["name"] - db = parsed_rid["child_name_1"] # only connection string auth supported return (f'Server="{server}.mysql.database.azure.com";UserID = "{username}";' - f'Password="{password}";Database="{db}";SslMode=MySqlSslMode.Required;' + f'Password="{password}";Database="{database_name}";SslMode=MySqlSslMode.Required;' 'SslCa="{path_to_CA_cert}"') @classmethod @@ -225,6 +247,10 @@ def _requires_password(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bo def _is_supported(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: return not (sku == sku.FREE and connection_type != ConnectionType.CONNECTION_STRING) + @classmethod + def _requires_database_name(cls) -> bool: + return True + @classmethod def get_location(cls, cmd, resource_id: str) -> str: return cls._get_location_from_server(cmd, resource_id) @@ -246,17 +272,16 @@ def _get_client_id(cls, cmd, connection_type: 'ConnectionType', app=None, identi return sp["appId"] @classmethod - def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id: str, - username=None, password=None, **kwargs) -> str: + def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id, database_name, + username=None, password=None, **kwargs) -> str: parsed_rid = cls._parse_resource_id(resource_id) server = parsed_rid["name"] - db = parsed_rid["child_name_1"] if connection_type == ConnectionType.CONNECTION_STRING: - return (f"Server={server}.postgres.database.azure.com;Database={db};Port=5432;" + return (f"Server={server}.postgres.database.azure.com;Database={database_name};Port=5432;" f"User Id={username}@{server};Password={password};Ssl Mode=Require;") else: client_id = cls._get_client_id(cmd, connection_type, kwargs["app"], kwargs["identity_rid"]) - return (f"Server={server}.postgres.database.azure.com;Database={db};Port=5432;" + return (f"Server={server}.postgres.database.azure.com;Database={database_name};Port=5432;" f"User Id={client_id};Ssl Mode=Require;") @@ -277,27 +302,30 @@ def _requires_password(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bo def _is_supported(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: return connection_type == ConnectionType.CONNECTION_STRING + @classmethod + def _requires_database_name(cls) -> bool: + return True + @classmethod def get_location(cls, cmd, resource_id: str) -> str: return cls._get_location_from_server(cmd, resource_id) @classmethod - def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id: str, - username=None, password=None, **kwargs) -> str: + def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id, database_name, + username=None, password=None, **kwargs) -> str: parsed_rid = cls._parse_resource_id(resource_id) server = parsed_rid["name"] - db = parsed_rid["child_name_1"] - return (f"Server={server}.postgres.database.azure.com;Database={db};Port=5432;" + return (f"Server={server}.postgres.database.azure.com;Database={database_name};Port=5432;" f"User Id={username};Password={password};Ssl Mode=Require;") # pylint: disable=line-too-long RESOURCE_ID_TO_DB_HANDLER = { - r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DocumentDB/databaseAccounts\/.*$": CosmosDbHandler, - r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.Sql\/servers\/.*\/databases\/.*$": AzureSqlHandler, - r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DBforMySQL\/flexibleServers\/.*\/databases\/.*$": MySqlFlexHandler, - r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DBforPostgreSQL\/servers\/.*\/databases\/.*$": PgSqlSingleHandler, - r"^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft.DBforPostgreSQL\/flexibleServers\/.*\/databases\/.*$": PgSqlFlexHandler, + r"^/subscriptions/.+/resourceGroups/.+/providers/Microsoft\.DocumentDB/databaseAccounts/[^/]+$": CosmosDbHandler, + r"^/subscriptions/.+/resourceGroups/.+/providers/Microsoft\.Sql/servers/[^/]+$": AzureSqlHandler, + r"^/subscriptions/.+/resourceGroups/.+/providers/Microsoft\.DBforMySQL/flexibleServers/[^/]+$": MySqlFlexHandler, + r"^/subscriptions/.+/resourceGroups/.+/providers/Microsoft\.DBforPostgreSQL/servers/[^/]+$": PgSqlSingleHandler, + r"^/subscriptions/.+/resourceGroups/.+/providers/Microsoft\.DBforPostgreSQL/flexibleServers/[^/]+$": PgSqlFlexHandler, } diff --git a/src/staticwebapp/azext_staticwebapp/custom.py b/src/staticwebapp/azext_staticwebapp/custom.py index ab51e1428a2..73c1ba8fa4f 100644 --- a/src/staticwebapp/azext_staticwebapp/custom.py +++ b/src/staticwebapp/azext_staticwebapp/custom.py @@ -14,10 +14,8 @@ from msrestazure.tools import is_valid_resource_id -# TODO check these args against Thomas's spec -def create_dbconnection(cmd, resource_group_name, name, db_resource_id, environment=None, - connection_string=None, username=None, password=None, - mi_user_assigned=None, mi_system_assigned=False): +def create_dbconnection(cmd, resource_group_name, name, db_resource_id, db_name=None, environment=None, + username=None, password=None, mi_user_assigned=None, mi_system_assigned=False): if mi_system_assigned and mi_user_assigned: raise MutuallyExclusiveArgumentError("Cannot use both system and user assigned identities") @@ -34,9 +32,8 @@ def create_dbconnection(cmd, resource_group_name, name, db_resource_id, environm db_type = get_database_type(db_resource_id) region = db_type.get_location(cmd, db_resource_id) - if not connection_string: - connection_string = db_type.get_connection_string(cmd, sku, connection_type, db_resource_id, username, password, - app=app, identity_rid=mi_user_assigned) + connection_string = db_type.get_connection_string(cmd, sku, connection_type, db_resource_id, db_name, + username, password, app=app, identity_rid=mi_user_assigned) identity = None if mi_user_assigned: From 86fd99046949d21814ef31163565bfc08f476a85 Mon Sep 17 00:00:00 2001 From: Silas Strawn Date: Wed, 14 Dec 2022 16:36:21 -0800 Subject: [PATCH 10/27] update for change in detailed show API --- src/staticwebapp/azext_staticwebapp/_clients.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/staticwebapp/azext_staticwebapp/_clients.py b/src/staticwebapp/azext_staticwebapp/_clients.py index 4b45026a874..e9031a24a3b 100644 --- a/src/staticwebapp/azext_staticwebapp/_clients.py +++ b/src/staticwebapp/azext_staticwebapp/_clients.py @@ -68,7 +68,7 @@ def list(cls, cmd, resource_group_name, name, environment, connection_name="defa resource_group_name, name, environment, - connection_name, + connection_name if not detailed else f"{connection_name}/show", api_version) verb = "GET" if not detailed else "POST" From ed5ea024f4b96c7317454e3f71dc95a93e4ae03b Mon Sep 17 00:00:00 2001 From: Silas Strawn Date: Wed, 14 Dec 2022 16:36:50 -0800 Subject: [PATCH 11/27] bump version for test --- src/staticwebapp/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/staticwebapp/setup.py b/src/staticwebapp/setup.py index 654683893c1..89001387f13 100644 --- a/src/staticwebapp/setup.py +++ b/src/staticwebapp/setup.py @@ -16,7 +16,7 @@ # TODO: Confirm this is the right version number you want and it matches your # HISTORY.rst entry. -VERSION = 'private-test-0.0.0' +VERSION = 'private-test-0.0.1' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers From 845ef3dda0d62fcae6fde893349dea31778cd153 Mon Sep 17 00:00:00 2001 From: Silas Strawn Date: Thu, 15 Dec 2022 09:45:28 -0800 Subject: [PATCH 12/27] allow creating db connection on the site and not just the build --- .../azext_staticwebapp/_clients.py | 126 ++++++++++++------ .../azext_staticwebapp/_params.py | 2 +- 2 files changed, 86 insertions(+), 42 deletions(-) diff --git a/src/staticwebapp/azext_staticwebapp/_clients.py b/src/staticwebapp/azext_staticwebapp/_clients.py index e9031a24a3b..6cd93337e3c 100644 --- a/src/staticwebapp/azext_staticwebapp/_clients.py +++ b/src/staticwebapp/azext_staticwebapp/_clients.py @@ -12,7 +12,6 @@ API_VERSION = "2022-03-01" -# TODO handle polling class DbConnectionClient(): @classmethod def create_or_update(cls, cmd, resource_group_name, name, environment, connection_name="default", @@ -20,16 +19,28 @@ def create_or_update(cls, cmd, resource_group_name, name, environment, connectio management_hostname = cmd.cli_ctx.cloud.endpoints.resource_manager api_version = API_VERSION sub_id = get_subscription_id(cmd.cli_ctx) - url_fmt = ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Web/staticsites/{}/builds/{}" - "/databaseConnections/{}?api-version={}") - request_url = url_fmt.format( - management_hostname.strip('/'), - sub_id, - resource_group_name, - name, - environment, - connection_name, - api_version) + if environment: + url_fmt = ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Web/staticsites/{}/builds/{}" + "/databaseConnections/{}?api-version={}") + request_url = url_fmt.format( + management_hostname.strip('/'), + sub_id, + resource_group_name, + name, + environment, + connection_name, + api_version) + else: + url_fmt = ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Web/staticsites/{}" + "/databaseConnections/{}?api-version={}") + request_url = url_fmt.format( + management_hostname.strip('/'), + sub_id, + resource_group_name, + name, + environment, + connection_name, + api_version) r = send_raw_request(cmd.cli_ctx, "PUT", request_url, body=json.dumps(db_connection)) return r.json() @@ -39,16 +50,27 @@ def show(cls, cmd, resource_group_name, name, environment, connection_name="defa management_hostname = cmd.cli_ctx.cloud.endpoints.resource_manager api_version = API_VERSION sub_id = get_subscription_id(cmd.cli_ctx) - url_fmt = ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Web/staticsites/{}/builds/{}" - "/databaseConnections/{}?api-version={}") - request_url = url_fmt.format( - management_hostname.strip('/'), - sub_id, - resource_group_name, - name, - environment, - connection_name, - api_version) + if environment: + url_fmt = ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Web/staticsites/{}/builds/{}" + "/databaseConnections/{}?api-version={}") + request_url = url_fmt.format( + management_hostname.strip('/'), + sub_id, + resource_group_name, + name, + environment, + connection_name, + api_version) + else: + url_fmt = ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Web/staticsites/{}" + "/databaseConnections/{}?api-version={}") + request_url = url_fmt.format( + management_hostname.strip('/'), + sub_id, + resource_group_name, + name, + connection_name, + api_version) verb = "GET" if not detailed else "POST" @@ -60,16 +82,27 @@ def list(cls, cmd, resource_group_name, name, environment, connection_name="defa management_hostname = cmd.cli_ctx.cloud.endpoints.resource_manager api_version = API_VERSION sub_id = get_subscription_id(cmd.cli_ctx) - url_fmt = ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Web/staticsites/{}/builds/{}" - "/databaseConnections/{}?api-version={}") - request_url = url_fmt.format( - management_hostname.strip('/'), - sub_id, - resource_group_name, - name, - environment, - connection_name if not detailed else f"{connection_name}/show", - api_version) + if environment: + url_fmt = ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Web/staticsites/{}/builds/{}" + "/databaseConnections/{}?api-version={}") + request_url = url_fmt.format( + management_hostname.strip('/'), + sub_id, + resource_group_name, + name, + environment, + connection_name if not detailed else f"{connection_name}/show", + api_version) + else: + url_fmt = ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Web/staticsites/{}" + "/databaseConnections/{}?api-version={}") + request_url = url_fmt.format( + management_hostname.strip('/'), + sub_id, + resource_group_name, + name, + connection_name if not detailed else f"{connection_name}/show", + api_version) verb = "GET" if not detailed else "POST" @@ -82,16 +115,27 @@ def delete(cls, cmd, resource_group_name, name, environment, connection_name="de management_hostname = cmd.cli_ctx.cloud.endpoints.resource_manager api_version = API_VERSION sub_id = get_subscription_id(cmd.cli_ctx) - url_fmt = ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Web/staticsites/{}/builds/{}" - "/databaseConnections/{}?api-version={}") - request_url = url_fmt.format( - management_hostname.strip('/'), - sub_id, - resource_group_name, - name, - environment, - connection_name, - api_version) + if environment: + url_fmt = ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Web/staticsites/{}/builds/{}" + "/databaseConnections/{}?api-version={}") + request_url = url_fmt.format( + management_hostname.strip('/'), + sub_id, + resource_group_name, + name, + environment, + connection_name, + api_version) + else: + url_fmt = ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Web/staticsites/{}" + "/databaseConnections/{}?api-version={}") + request_url = url_fmt.format( + management_hostname.strip('/'), + sub_id, + resource_group_name, + name, + connection_name, + api_version) r = send_raw_request(cmd.cli_ctx, "DELETE", request_url) return r.json() diff --git a/src/staticwebapp/azext_staticwebapp/_params.py b/src/staticwebapp/azext_staticwebapp/_params.py index 4e21cec2714..70dfd186eea 100644 --- a/src/staticwebapp/azext_staticwebapp/_params.py +++ b/src/staticwebapp/azext_staticwebapp/_params.py @@ -11,7 +11,7 @@ def load_arguments(self, _): with self.argument_context('staticwebapp dbconnection') as c: c.argument('name', options_list=['--name', '-n'], help="Name of the Static Web App") c.argument('resource_group_name', resource_group_name_type) - c.argument('environment', help="Name of the environment of Static Web App.", default="default", + c.argument('environment', help="Name of the environment of Static Web App.", options_list=["--environment", "-e"]) with self.argument_context('staticwebapp dbconnection create') as c: From d58d7c69e7580bcece878f3a60dd782c2752e53c Mon Sep 17 00:00:00 2001 From: Silas Strawn Date: Thu, 15 Dec 2022 14:58:36 -0800 Subject: [PATCH 13/27] connection string auth tests --- ...t_staticwebapp_dbconnection_azure_sql.yaml | 1333 +++++++++++++++++ ...st_staticwebapp_dbconnection_cosmosdb.yaml | 761 ++++++++++ ..._staticwebapp_dbconnection_mysql_flex.yaml | 262 ++++ ..._staticwebapp_dbconnection_pgsql_flex.yaml | 262 ++++ ...taticwebapp_dbconnection_pgsql_single.yaml | 915 +++++++++++ .../latest/test_staticwebapp_scenario.py | 113 +- 6 files changed, 3640 insertions(+), 6 deletions(-) create mode 100644 src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_azure_sql.yaml create mode 100644 src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_cosmosdb.yaml create mode 100644 src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_mysql_flex.yaml create mode 100644 src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_pgsql_flex.yaml create mode 100644 src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_pgsql_single.yaml diff --git a/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_azure_sql.yaml b/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_azure_sql.yaml new file mode 100644 index 00000000000..e9998f7a3ab --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_azure_sql.yaml @@ -0,0 +1,1333 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - staticwebapp create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 + response: + body: + string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.Web/staticSites/cli_test000002'' + under resource group ''cli_test000001'' was not found. For more details please + go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '226' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:39:30 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: '{"location": "centralus", "sku": {"name": "Free", "tier": "Free"}, "properties": + {"buildProperties": {"appLocation": "/"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - staticwebapp create + Connection: + - keep-alive + Content-Length: + - '123' + Content-Type: + - application/json + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central + US","properties":{"defaultHostname":"kind-ocean-08d84ec10.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":null,"privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + headers: + cache-control: + - no-cache + content-length: + - '808' + content-type: + - application/json + date: + - Thu, 15 Dec 2022 18:39:31 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - staticwebapp create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central + US","properties":{"defaultHostname":"kind-ocean-08d84ec10.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":null,"privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + headers: + cache-control: + - no-cache + content-length: + - '808' + content-type: + - application/json + date: + - Thu, 15 Dec 2022 18:39:32 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - staticwebapp create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/locations?api-version=2019-11-01 + response: + body: + string: "{\"value\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus\",\"name\":\"eastus\",\"displayName\":\"East + US\",\"regionalDisplayName\":\"(US) East US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-79.8164\",\"latitude\":\"37.3719\",\"physicalLocation\":\"Virginia\",\"pairedRegion\":[{\"name\":\"westus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2\",\"name\":\"eastus2\",\"displayName\":\"East + US 2\",\"regionalDisplayName\":\"(US) East US 2\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-78.3889\",\"latitude\":\"36.6681\",\"physicalLocation\":\"Virginia\",\"pairedRegion\":[{\"name\":\"centralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralus\",\"name\":\"southcentralus\",\"displayName\":\"South + Central US\",\"regionalDisplayName\":\"(US) South Central US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-98.5\",\"latitude\":\"29.4167\",\"physicalLocation\":\"Texas\",\"pairedRegion\":[{\"name\":\"northcentralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northcentralus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus2\",\"name\":\"westus2\",\"displayName\":\"West + US 2\",\"regionalDisplayName\":\"(US) West US 2\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-119.852\",\"latitude\":\"47.233\",\"physicalLocation\":\"Washington\",\"pairedRegion\":[{\"name\":\"westcentralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westcentralus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus3\",\"name\":\"westus3\",\"displayName\":\"West + US 3\",\"regionalDisplayName\":\"(US) West US 3\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-112.074036\",\"latitude\":\"33.448376\",\"physicalLocation\":\"Phoenix\",\"pairedRegion\":[{\"name\":\"eastus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiaeast\",\"name\":\"australiaeast\",\"displayName\":\"Australia + East\",\"regionalDisplayName\":\"(Asia Pacific) Australia East\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"151.2094\",\"latitude\":\"-33.86\",\"physicalLocation\":\"New + South Wales\",\"pairedRegion\":[{\"name\":\"australiasoutheast\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiasoutheast\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southeastasia\",\"name\":\"southeastasia\",\"displayName\":\"Southeast + Asia\",\"regionalDisplayName\":\"(Asia Pacific) Southeast Asia\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"103.833\",\"latitude\":\"1.283\",\"physicalLocation\":\"Singapore\",\"pairedRegion\":[{\"name\":\"eastasia\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastasia\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northeurope\",\"name\":\"northeurope\",\"displayName\":\"North + Europe\",\"regionalDisplayName\":\"(Europe) North Europe\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"-6.2597\",\"latitude\":\"53.3478\",\"physicalLocation\":\"Ireland\",\"pairedRegion\":[{\"name\":\"westeurope\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westeurope\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/swedencentral\",\"name\":\"swedencentral\",\"displayName\":\"Sweden + Central\",\"regionalDisplayName\":\"(Europe) Sweden Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"17.14127\",\"latitude\":\"60.67488\",\"physicalLocation\":\"G\xE4vle\",\"pairedRegion\":[{\"name\":\"swedensouth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/swedensouth\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uksouth\",\"name\":\"uksouth\",\"displayName\":\"UK + South\",\"regionalDisplayName\":\"(Europe) UK South\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"-0.799\",\"latitude\":\"50.941\",\"physicalLocation\":\"London\",\"pairedRegion\":[{\"name\":\"ukwest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/ukwest\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westeurope\",\"name\":\"westeurope\",\"displayName\":\"West + Europe\",\"regionalDisplayName\":\"(Europe) West Europe\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"4.9\",\"latitude\":\"52.3667\",\"physicalLocation\":\"Netherlands\",\"pairedRegion\":[{\"name\":\"northeurope\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northeurope\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralus\",\"name\":\"centralus\",\"displayName\":\"Central + US\",\"regionalDisplayName\":\"(US) Central US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-93.6208\",\"latitude\":\"41.5908\",\"physicalLocation\":\"Iowa\",\"pairedRegion\":[{\"name\":\"eastus2\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricanorth\",\"name\":\"southafricanorth\",\"displayName\":\"South + Africa North\",\"regionalDisplayName\":\"(Africa) South Africa North\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Africa\",\"longitude\":\"28.218370\",\"latitude\":\"-25.731340\",\"physicalLocation\":\"Johannesburg\",\"pairedRegion\":[{\"name\":\"southafricawest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricawest\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralindia\",\"name\":\"centralindia\",\"displayName\":\"Central + India\",\"regionalDisplayName\":\"(Asia Pacific) Central India\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"73.9197\",\"latitude\":\"18.5822\",\"physicalLocation\":\"Pune\",\"pairedRegion\":[{\"name\":\"southindia\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southindia\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastasia\",\"name\":\"eastasia\",\"displayName\":\"East + Asia\",\"regionalDisplayName\":\"(Asia Pacific) East Asia\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"114.188\",\"latitude\":\"22.267\",\"physicalLocation\":\"Hong + Kong\",\"pairedRegion\":[{\"name\":\"southeastasia\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southeastasia\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japaneast\",\"name\":\"japaneast\",\"displayName\":\"Japan + East\",\"regionalDisplayName\":\"(Asia Pacific) Japan East\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"139.77\",\"latitude\":\"35.68\",\"physicalLocation\":\"Tokyo, + Saitama\",\"pairedRegion\":[{\"name\":\"japanwest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japanwest\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreacentral\",\"name\":\"koreacentral\",\"displayName\":\"Korea + Central\",\"regionalDisplayName\":\"(Asia Pacific) Korea Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"126.9780\",\"latitude\":\"37.5665\",\"physicalLocation\":\"Seoul\",\"pairedRegion\":[{\"name\":\"koreasouth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreasouth\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadacentral\",\"name\":\"canadacentral\",\"displayName\":\"Canada + Central\",\"regionalDisplayName\":\"(Canada) Canada Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Canada\",\"longitude\":\"-79.383\",\"latitude\":\"43.653\",\"physicalLocation\":\"Toronto\",\"pairedRegion\":[{\"name\":\"canadaeast\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadaeast\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francecentral\",\"name\":\"francecentral\",\"displayName\":\"France + Central\",\"regionalDisplayName\":\"(Europe) France Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"2.3730\",\"latitude\":\"46.3772\",\"physicalLocation\":\"Paris\",\"pairedRegion\":[{\"name\":\"francesouth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francesouth\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanywestcentral\",\"name\":\"germanywestcentral\",\"displayName\":\"Germany + West Central\",\"regionalDisplayName\":\"(Europe) Germany West Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"8.682127\",\"latitude\":\"50.110924\",\"physicalLocation\":\"Frankfurt\",\"pairedRegion\":[{\"name\":\"germanynorth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanynorth\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwayeast\",\"name\":\"norwayeast\",\"displayName\":\"Norway + East\",\"regionalDisplayName\":\"(Europe) Norway East\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"10.752245\",\"latitude\":\"59.913868\",\"physicalLocation\":\"Norway\",\"pairedRegion\":[{\"name\":\"norwaywest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwaywest\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandnorth\",\"name\":\"switzerlandnorth\",\"displayName\":\"Switzerland + North\",\"regionalDisplayName\":\"(Europe) Switzerland North\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"8.564572\",\"latitude\":\"47.451542\",\"physicalLocation\":\"Zurich\",\"pairedRegion\":[{\"name\":\"switzerlandwest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandwest\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaenorth\",\"name\":\"uaenorth\",\"displayName\":\"UAE + North\",\"regionalDisplayName\":\"(Middle East) UAE North\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Middle + East\",\"longitude\":\"55.316666\",\"latitude\":\"25.266666\",\"physicalLocation\":\"Dubai\",\"pairedRegion\":[{\"name\":\"uaecentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaecentral\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazilsouth\",\"name\":\"brazilsouth\",\"displayName\":\"Brazil + South\",\"regionalDisplayName\":\"(South America) Brazil South\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"South + America\",\"longitude\":\"-46.633\",\"latitude\":\"-23.55\",\"physicalLocation\":\"Sao + Paulo State\",\"pairedRegion\":[{\"name\":\"southcentralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2euap\",\"name\":\"eastus2euap\",\"displayName\":\"East + US 2 EUAP\",\"regionalDisplayName\":\"(US) East US 2 EUAP\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-78.3889\",\"latitude\":\"36.6681\",\"pairedRegion\":[{\"name\":\"centraluseuap\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centraluseuap\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/qatarcentral\",\"name\":\"qatarcentral\",\"displayName\":\"Qatar + Central\",\"regionalDisplayName\":\"(Middle East) Qatar Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Middle + East\",\"longitude\":\"51.439327\",\"latitude\":\"25.551462\",\"physicalLocation\":\"Doha\",\"pairedRegion\":[{\"name\":\"westeurope\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westeurope\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralusstage\",\"name\":\"centralusstage\",\"displayName\":\"Central + US (Stage)\",\"regionalDisplayName\":\"(US) Central US (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastusstage\",\"name\":\"eastusstage\",\"displayName\":\"East + US (Stage)\",\"regionalDisplayName\":\"(US) East US (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2stage\",\"name\":\"eastus2stage\",\"displayName\":\"East + US 2 (Stage)\",\"regionalDisplayName\":\"(US) East US 2 (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northcentralusstage\",\"name\":\"northcentralusstage\",\"displayName\":\"North + Central US (Stage)\",\"regionalDisplayName\":\"(US) North Central US (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralusstage\",\"name\":\"southcentralusstage\",\"displayName\":\"South + Central US (Stage)\",\"regionalDisplayName\":\"(US) South Central US (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westusstage\",\"name\":\"westusstage\",\"displayName\":\"West + US (Stage)\",\"regionalDisplayName\":\"(US) West US (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus2stage\",\"name\":\"westus2stage\",\"displayName\":\"West + US 2 (Stage)\",\"regionalDisplayName\":\"(US) West US 2 (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/asia\",\"name\":\"asia\",\"displayName\":\"Asia\",\"regionalDisplayName\":\"Asia\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/asiapacific\",\"name\":\"asiapacific\",\"displayName\":\"Asia + Pacific\",\"regionalDisplayName\":\"Asia Pacific\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australia\",\"name\":\"australia\",\"displayName\":\"Australia\",\"regionalDisplayName\":\"Australia\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazil\",\"name\":\"brazil\",\"displayName\":\"Brazil\",\"regionalDisplayName\":\"Brazil\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canada\",\"name\":\"canada\",\"displayName\":\"Canada\",\"regionalDisplayName\":\"Canada\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/europe\",\"name\":\"europe\",\"displayName\":\"Europe\",\"regionalDisplayName\":\"Europe\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/france\",\"name\":\"france\",\"displayName\":\"France\",\"regionalDisplayName\":\"France\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germany\",\"name\":\"germany\",\"displayName\":\"Germany\",\"regionalDisplayName\":\"Germany\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/global\",\"name\":\"global\",\"displayName\":\"Global\",\"regionalDisplayName\":\"Global\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/india\",\"name\":\"india\",\"displayName\":\"India\",\"regionalDisplayName\":\"India\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japan\",\"name\":\"japan\",\"displayName\":\"Japan\",\"regionalDisplayName\":\"Japan\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/korea\",\"name\":\"korea\",\"displayName\":\"Korea\",\"regionalDisplayName\":\"Korea\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norway\",\"name\":\"norway\",\"displayName\":\"Norway\",\"regionalDisplayName\":\"Norway\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/singapore\",\"name\":\"singapore\",\"displayName\":\"Singapore\",\"regionalDisplayName\":\"Singapore\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafrica\",\"name\":\"southafrica\",\"displayName\":\"South + Africa\",\"regionalDisplayName\":\"South Africa\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerland\",\"name\":\"switzerland\",\"displayName\":\"Switzerland\",\"regionalDisplayName\":\"Switzerland\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uae\",\"name\":\"uae\",\"displayName\":\"United + Arab Emirates\",\"regionalDisplayName\":\"United Arab Emirates\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uk\",\"name\":\"uk\",\"displayName\":\"United + Kingdom\",\"regionalDisplayName\":\"United Kingdom\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/unitedstates\",\"name\":\"unitedstates\",\"displayName\":\"United + States\",\"regionalDisplayName\":\"United States\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/unitedstateseuap\",\"name\":\"unitedstateseuap\",\"displayName\":\"United + States EUAP\",\"regionalDisplayName\":\"United States EUAP\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastasiastage\",\"name\":\"eastasiastage\",\"displayName\":\"East + Asia (Stage)\",\"regionalDisplayName\":\"(Asia Pacific) East Asia (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southeastasiastage\",\"name\":\"southeastasiastage\",\"displayName\":\"Southeast + Asia (Stage)\",\"regionalDisplayName\":\"(Asia Pacific) Southeast Asia (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastusstg\",\"name\":\"eastusstg\",\"displayName\":\"East + US STG\",\"regionalDisplayName\":\"(US) East US STG\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-79.8164\",\"latitude\":\"37.3719\",\"physicalLocation\":\"Virginia\",\"pairedRegion\":[{\"name\":\"southcentralusstg\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralusstg\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northcentralus\",\"name\":\"northcentralus\",\"displayName\":\"North + Central US\",\"regionalDisplayName\":\"(US) North Central US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-87.6278\",\"latitude\":\"41.8819\",\"physicalLocation\":\"Illinois\",\"pairedRegion\":[{\"name\":\"southcentralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus\",\"name\":\"westus\",\"displayName\":\"West + US\",\"regionalDisplayName\":\"(US) West US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-122.417\",\"latitude\":\"37.783\",\"physicalLocation\":\"California\",\"pairedRegion\":[{\"name\":\"eastus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/jioindiawest\",\"name\":\"jioindiawest\",\"displayName\":\"Jio + India West\",\"regionalDisplayName\":\"(Asia Pacific) Jio India West\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"70.05773\",\"latitude\":\"22.470701\",\"physicalLocation\":\"Jamnagar\",\"pairedRegion\":[{\"name\":\"jioindiacentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/jioindiacentral\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centraluseuap\",\"name\":\"centraluseuap\",\"displayName\":\"Central + US EUAP\",\"regionalDisplayName\":\"(US) Central US EUAP\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-93.6208\",\"latitude\":\"41.5908\",\"pairedRegion\":[{\"name\":\"eastus2euap\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2euap\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westcentralus\",\"name\":\"westcentralus\",\"displayName\":\"West + Central US\",\"regionalDisplayName\":\"(US) West Central US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-110.234\",\"latitude\":\"40.890\",\"physicalLocation\":\"Wyoming\",\"pairedRegion\":[{\"name\":\"westus2\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus2\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricawest\",\"name\":\"southafricawest\",\"displayName\":\"South + Africa West\",\"regionalDisplayName\":\"(Africa) South Africa West\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Africa\",\"longitude\":\"18.843266\",\"latitude\":\"-34.075691\",\"physicalLocation\":\"Cape + Town\",\"pairedRegion\":[{\"name\":\"southafricanorth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricanorth\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral\",\"name\":\"australiacentral\",\"displayName\":\"Australia + Central\",\"regionalDisplayName\":\"(Asia Pacific) Australia Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"149.1244\",\"latitude\":\"-35.3075\",\"physicalLocation\":\"Canberra\",\"pairedRegion\":[{\"name\":\"australiacentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral2\",\"name\":\"australiacentral2\",\"displayName\":\"Australia + Central 2\",\"regionalDisplayName\":\"(Asia Pacific) Australia Central 2\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"149.1244\",\"latitude\":\"-35.3075\",\"physicalLocation\":\"Canberra\",\"pairedRegion\":[{\"name\":\"australiacentral2\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral2\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiasoutheast\",\"name\":\"australiasoutheast\",\"displayName\":\"Australia + Southeast\",\"regionalDisplayName\":\"(Asia Pacific) Australia Southeast\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"144.9631\",\"latitude\":\"-37.8136\",\"physicalLocation\":\"Victoria\",\"pairedRegion\":[{\"name\":\"australiaeast\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiaeast\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japanwest\",\"name\":\"japanwest\",\"displayName\":\"Japan + West\",\"regionalDisplayName\":\"(Asia Pacific) Japan West\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"135.5022\",\"latitude\":\"34.6939\",\"physicalLocation\":\"Osaka\",\"pairedRegion\":[{\"name\":\"japaneast\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japaneast\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/jioindiacentral\",\"name\":\"jioindiacentral\",\"displayName\":\"Jio + India Central\",\"regionalDisplayName\":\"(Asia Pacific) Jio India Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"79.08886\",\"latitude\":\"21.146633\",\"physicalLocation\":\"Nagpur\",\"pairedRegion\":[{\"name\":\"jioindiawest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/jioindiawest\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreasouth\",\"name\":\"koreasouth\",\"displayName\":\"Korea + South\",\"regionalDisplayName\":\"(Asia Pacific) Korea South\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"129.0756\",\"latitude\":\"35.1796\",\"physicalLocation\":\"Busan\",\"pairedRegion\":[{\"name\":\"koreacentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreacentral\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southindia\",\"name\":\"southindia\",\"displayName\":\"South + India\",\"regionalDisplayName\":\"(Asia Pacific) South India\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"80.1636\",\"latitude\":\"12.9822\",\"physicalLocation\":\"Chennai\",\"pairedRegion\":[{\"name\":\"centralindia\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralindia\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westindia\",\"name\":\"westindia\",\"displayName\":\"West + India\",\"regionalDisplayName\":\"(Asia Pacific) West India\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"72.868\",\"latitude\":\"19.088\",\"physicalLocation\":\"Mumbai\",\"pairedRegion\":[{\"name\":\"southindia\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southindia\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadaeast\",\"name\":\"canadaeast\",\"displayName\":\"Canada + East\",\"regionalDisplayName\":\"(Canada) Canada East\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Canada\",\"longitude\":\"-71.217\",\"latitude\":\"46.817\",\"physicalLocation\":\"Quebec\",\"pairedRegion\":[{\"name\":\"canadacentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadacentral\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francesouth\",\"name\":\"francesouth\",\"displayName\":\"France + South\",\"regionalDisplayName\":\"(Europe) France South\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Europe\",\"longitude\":\"2.1972\",\"latitude\":\"43.8345\",\"physicalLocation\":\"Marseille\",\"pairedRegion\":[{\"name\":\"francecentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francecentral\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanynorth\",\"name\":\"germanynorth\",\"displayName\":\"Germany + North\",\"regionalDisplayName\":\"(Europe) Germany North\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Europe\",\"longitude\":\"8.806422\",\"latitude\":\"53.073635\",\"physicalLocation\":\"Berlin\",\"pairedRegion\":[{\"name\":\"germanywestcentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanywestcentral\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwaywest\",\"name\":\"norwaywest\",\"displayName\":\"Norway + West\",\"regionalDisplayName\":\"(Europe) Norway West\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Europe\",\"longitude\":\"5.733107\",\"latitude\":\"58.969975\",\"physicalLocation\":\"Norway\",\"pairedRegion\":[{\"name\":\"norwayeast\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwayeast\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandwest\",\"name\":\"switzerlandwest\",\"displayName\":\"Switzerland + West\",\"regionalDisplayName\":\"(Europe) Switzerland West\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Europe\",\"longitude\":\"6.143158\",\"latitude\":\"46.204391\",\"physicalLocation\":\"Geneva\",\"pairedRegion\":[{\"name\":\"switzerlandnorth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandnorth\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/ukwest\",\"name\":\"ukwest\",\"displayName\":\"UK + West\",\"regionalDisplayName\":\"(Europe) UK West\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Europe\",\"longitude\":\"-3.084\",\"latitude\":\"53.427\",\"physicalLocation\":\"Cardiff\",\"pairedRegion\":[{\"name\":\"uksouth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uksouth\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaecentral\",\"name\":\"uaecentral\",\"displayName\":\"UAE + Central\",\"regionalDisplayName\":\"(Middle East) UAE Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Middle + East\",\"longitude\":\"54.366669\",\"latitude\":\"24.466667\",\"physicalLocation\":\"Abu + Dhabi\",\"pairedRegion\":[{\"name\":\"uaenorth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaenorth\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazilsoutheast\",\"name\":\"brazilsoutheast\",\"displayName\":\"Brazil + Southeast\",\"regionalDisplayName\":\"(South America) Brazil Southeast\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"South + America\",\"longitude\":\"-43.2075\",\"latitude\":\"-22.90278\",\"physicalLocation\":\"Rio\",\"pairedRegion\":[{\"name\":\"brazilsouth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazilsouth\"}]}}]}" + headers: + cache-control: + - no-cache + content-length: + - '29930' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:39:41 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "properties": {"administratorLogin": "aturing", + "administratorLoginPassword": "thisisapassword123!", "administrators": {}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - sql server create + Connection: + - keep-alive + Content-Length: + - '146' + Content-Type: + - application/json + ParameterSetName: + - -l -g -n -u -p + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003?api-version=2021-02-01-preview + response: + body: + string: '{"operation":"UpsertLogicalServer","startTime":"2022-12-15T18:39:41.81Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/9493c9eb-c79e-487e-bec4-ce68b835d485?api-version=2021-02-01-preview + cache-control: + - no-cache + content-length: + - '73' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:39:41 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverOperationResults/9493c9eb-c79e-487e-bec4-ce68b835d485?api-version=2021-02-01-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - sql server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n -u -p + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/9493c9eb-c79e-487e-bec4-ce68b835d485?api-version=2021-02-01-preview + response: + body: + string: '{"name":"9493c9eb-c79e-487e-bec4-ce68b835d485","status":"InProgress","startTime":"2022-12-15T18:39:41.81Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:39:42 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - sql server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n -u -p + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/9493c9eb-c79e-487e-bec4-ce68b835d485?api-version=2021-02-01-preview + response: + body: + string: '{"name":"9493c9eb-c79e-487e-bec4-ce68b835d485","status":"InProgress","startTime":"2022-12-15T18:39:41.81Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:39:43 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - sql server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n -u -p + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/9493c9eb-c79e-487e-bec4-ce68b835d485?api-version=2021-02-01-preview + response: + body: + string: '{"name":"9493c9eb-c79e-487e-bec4-ce68b835d485","status":"InProgress","startTime":"2022-12-15T18:39:41.81Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:39:44 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - sql server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n -u -p + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/9493c9eb-c79e-487e-bec4-ce68b835d485?api-version=2021-02-01-preview + response: + body: + string: '{"name":"9493c9eb-c79e-487e-bec4-ce68b835d485","status":"InProgress","startTime":"2022-12-15T18:39:41.81Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:39:45 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - sql server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n -u -p + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/9493c9eb-c79e-487e-bec4-ce68b835d485?api-version=2021-02-01-preview + response: + body: + string: '{"name":"9493c9eb-c79e-487e-bec4-ce68b835d485","status":"InProgress","startTime":"2022-12-15T18:39:41.81Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:39:46 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - sql server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n -u -p + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/9493c9eb-c79e-487e-bec4-ce68b835d485?api-version=2021-02-01-preview + response: + body: + string: '{"name":"9493c9eb-c79e-487e-bec4-ce68b835d485","status":"InProgress","startTime":"2022-12-15T18:39:41.81Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:40:06 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - sql server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n -u -p + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/9493c9eb-c79e-487e-bec4-ce68b835d485?api-version=2021-02-01-preview + response: + body: + string: '{"name":"9493c9eb-c79e-487e-bec4-ce68b835d485","status":"InProgress","startTime":"2022-12-15T18:39:41.81Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:40:26 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - sql server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n -u -p + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/9493c9eb-c79e-487e-bec4-ce68b835d485?api-version=2021-02-01-preview + response: + body: + string: '{"name":"9493c9eb-c79e-487e-bec4-ce68b835d485","status":"InProgress","startTime":"2022-12-15T18:39:41.81Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:40:46 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - sql server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n -u -p + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/9493c9eb-c79e-487e-bec4-ce68b835d485?api-version=2021-02-01-preview + response: + body: + string: '{"name":"9493c9eb-c79e-487e-bec4-ce68b835d485","status":"Succeeded","startTime":"2022-12-15T18:39:41.81Z"}' + headers: + cache-control: + - no-cache + content-length: + - '106' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:41:01 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - sql server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n -u -p + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003?api-version=2021-02-01-preview + response: + body: + string: '{"kind":"v12.0","properties":{"administratorLogin":"aturing","version":"12.0","state":"Ready","fullyQualifiedDomainName":"cli-test000003.database.windows.net","privateEndpointConnections":[],"publicNetworkAccess":"Enabled","restrictOutboundNetworkAccess":"Disabled"},"location":"westus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003","name":"cli-test000003","type":"Microsoft.Sql/servers"}' + headers: + cache-control: + - no-cache + content-length: + - '478' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:41:01 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - sql db create + Connection: + - keep-alive + ParameterSetName: + - -g -n -s + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003?api-version=2021-02-01-preview + response: + body: + string: '{"kind":"v12.0","properties":{"administratorLogin":"aturing","version":"12.0","state":"Ready","fullyQualifiedDomainName":"cli-test000003.database.windows.net","privateEndpointConnections":[],"publicNetworkAccess":"Enabled","restrictOutboundNetworkAccess":"Disabled"},"location":"westus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003","name":"cli-test000003","type":"Microsoft.Sql/servers"}' + headers: + cache-control: + - no-cache + content-length: + - '478' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:41:03 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - sql db create + Connection: + - keep-alive + ParameterSetName: + - -g -n -s + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003?api-version=2021-02-01-preview + response: + body: + string: '{"kind":"v12.0","properties":{"administratorLogin":"aturing","version":"12.0","state":"Ready","fullyQualifiedDomainName":"cli-test000003.database.windows.net","privateEndpointConnections":[],"publicNetworkAccess":"Enabled","restrictOutboundNetworkAccess":"Disabled"},"location":"westus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003","name":"cli-test000003","type":"Microsoft.Sql/servers"}' + headers: + cache-control: + - no-cache + content-length: + - '478' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:41:02 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "westus"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - sql db create + Connection: + - keep-alive + Content-Length: + - '22' + Content-Type: + - application/json + ParameterSetName: + - -g -n -s + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003/databases/tables?api-version=2022-02-01-preview + response: + body: + string: '{"operation":"CreateLogicalDatabase","startTime":"2022-12-15T18:41:04.207Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseAzureAsyncOperation/9f5fa24f-067d-4434-8189-e287c30f7c20?api-version=2022-02-01-preview + cache-control: + - no-cache + content-length: + - '76' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:41:04 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseOperationResults/9f5fa24f-067d-4434-8189-e287c30f7c20?api-version=2022-02-01-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - sql db create + Connection: + - keep-alive + ParameterSetName: + - -g -n -s + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseAzureAsyncOperation/9f5fa24f-067d-4434-8189-e287c30f7c20?api-version=2022-02-01-preview + response: + body: + string: '{"name":"9f5fa24f-067d-4434-8189-e287c30f7c20","status":"InProgress","startTime":"2022-12-15T18:41:04.207Z"}' + headers: + cache-control: + - no-cache + content-length: + - '108' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:41:19 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - sql db create + Connection: + - keep-alive + ParameterSetName: + - -g -n -s + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseAzureAsyncOperation/9f5fa24f-067d-4434-8189-e287c30f7c20?api-version=2022-02-01-preview + response: + body: + string: '{"name":"9f5fa24f-067d-4434-8189-e287c30f7c20","status":"InProgress","startTime":"2022-12-15T18:41:04.207Z"}' + headers: + cache-control: + - no-cache + content-length: + - '108' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:41:34 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - sql db create + Connection: + - keep-alive + ParameterSetName: + - -g -n -s + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseAzureAsyncOperation/9f5fa24f-067d-4434-8189-e287c30f7c20?api-version=2022-02-01-preview + response: + body: + string: '{"name":"9f5fa24f-067d-4434-8189-e287c30f7c20","status":"InProgress","startTime":"2022-12-15T18:41:04.207Z"}' + headers: + cache-control: + - no-cache + content-length: + - '108' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:41:49 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - sql db create + Connection: + - keep-alive + ParameterSetName: + - -g -n -s + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseAzureAsyncOperation/9f5fa24f-067d-4434-8189-e287c30f7c20?api-version=2022-02-01-preview + response: + body: + string: '{"name":"9f5fa24f-067d-4434-8189-e287c30f7c20","status":"Succeeded","startTime":"2022-12-15T18:41:04.207Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:42:04 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - sql db create + Connection: + - keep-alive + ParameterSetName: + - -g -n -s + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003/databases/tables?api-version=2022-02-01-preview + response: + body: + string: '{"sku":{"name":"GP_Gen5","tier":"GeneralPurpose","family":"Gen5","capacity":2},"kind":"v12.0,user,vcore","properties":{"collation":"SQL_Latin1_General_CP1_CI_AS","maxSizeBytes":34359738368,"status":"Online","databaseId":"ac50c269-abdf-4a18-b4b2-316775a3db36","creationDate":"2022-12-15T18:41:55.91Z","currentServiceObjectiveName":"GP_Gen5_2","requestedServiceObjectiveName":"GP_Gen5_2","defaultSecondaryLocation":"eastus","catalogCollation":"SQL_Latin1_General_CP1_CI_AS","zoneRedundant":false,"licenseType":"LicenseIncluded","maxLogSizeBytes":193273528320,"readScale":"Disabled","currentSku":{"name":"GP_Gen5","tier":"GeneralPurpose","family":"Gen5","capacity":2},"currentBackupStorageRedundancy":"Geo","requestedBackupStorageRedundancy":"Geo","maintenanceConfigurationId":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default","isLedgerOn":false,"isInfraEncryptionEnabled":false},"location":"westus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003/databases/tables","name":"tables","type":"Microsoft.Sql/servers/databases"}' + headers: + cache-control: + - no-cache + content-length: + - '1187' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:42:04 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - staticwebapp dbconnection create + Connection: + - keep-alive + ParameterSetName: + - -n -g -u -p -d -b + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central + US","properties":{"defaultHostname":"kind-ocean-08d84ec10.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":null,"privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + headers: + cache-control: + - no-cache + content-length: + - '808' + content-type: + - application/json + date: + - Thu, 15 Dec 2022 18:42:05 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - staticwebapp dbconnection create + Connection: + - keep-alive + ParameterSetName: + - -n -g -u -p -d -b + User-Agent: + - python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) AZURECLI/2.43.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003?api-version=2021-11-01 + response: + body: + string: '{"kind":"v12.0","properties":{"administratorLogin":"aturing","version":"12.0","state":"Ready","fullyQualifiedDomainName":"cli-test000003.database.windows.net","privateEndpointConnections":[],"publicNetworkAccess":"Enabled","restrictOutboundNetworkAccess":"Disabled"},"location":"westus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003","name":"cli-test000003","type":"Microsoft.Sql/servers"}' + headers: + cache-control: + - no-cache + content-length: + - '478' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:42:05 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003", + "connectionIdentity": null, "region": "westus", "connectionString": "Server=tcp:cli-test000003.database.windows.net,1433;Database=tables;User + ID=aturing;Password=thisisapassword123!;Encrypt=true;Connection Timeout=30;"}}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - staticwebapp dbconnection create + Connection: + - keep-alive + Content-Length: + - '382' + Content-Type: + - application/json + ParameterSetName: + - -n -g -u -p -d -b + User-Agent: + - python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) AZURECLI/2.43.0 + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticsites/cli_test000002/builds/default/databaseConnections/default?api-version=2022-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002/builds/default/databaseConnections/default","name":"default","type":"Microsoft.Web/staticSites/builds/databaseConnections","location":"Central + US","properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003","region":"West + US"}}' + headers: + cache-control: + - no-cache + content-length: + - '465' + content-type: + - application/json + date: + - Thu, 15 Dec 2022 18:42:07 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_cosmosdb.yaml b/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_cosmosdb.yaml new file mode 100644 index 00000000000..265782047b4 --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_cosmosdb.yaml @@ -0,0 +1,761 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - staticwebapp create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 + response: + body: + string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.Web/staticSites/cli_test000002'' + under resource group ''cli_test000001'' was not found. For more details please + go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '226' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:48:05 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: '{"location": "centralus", "sku": {"name": "Free", "tier": "Free"}, "properties": + {"buildProperties": {"appLocation": "/"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - staticwebapp create + Connection: + - keep-alive + Content-Length: + - '123' + Content-Type: + - application/json + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central + US","properties":{"defaultHostname":"victorious-pond-031d08210.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":null,"privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + headers: + cache-control: + - no-cache + content-length: + - '813' + content-type: + - application/json + date: + - Thu, 15 Dec 2022 18:48:06 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - staticwebapp create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central + US","properties":{"defaultHostname":"victorious-pond-031d08210.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":null,"privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + headers: + cache-control: + - no-cache + content-length: + - '813' + content-type: + - application/json + date: + - Thu, 15 Dec 2022 18:48:07 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - cosmosdb create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001","name":"cli_test000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2022-12-15T18:48:02Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '306' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:48:08 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "kind": "GlobalDocumentDB", "properties": {"locations": + [{"locationName": "westus", "failoverPriority": 0, "isZoneRedundant": false}], + "databaseAccountOfferType": "Standard", "apiProperties": {}, "createMode": "Default"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - cosmosdb create + Connection: + - keep-alive + Content-Length: + - '244' + Content-Type: + - application/json + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003?api-version=2022-08-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003","name":"cli-test000003","location":"West + US","type":"Microsoft.DocumentDB/databaseAccounts","kind":"GlobalDocumentDB","tags":{},"systemData":{"createdAt":"2022-12-15T18:48:12.2120681Z"},"properties":{"provisioningState":"Creating","publicNetworkAccess":"Enabled","enableAutomaticFailover":false,"enableMultipleWriteLocations":false,"enablePartitionKeyMonitor":false,"isVirtualNetworkFilterEnabled":false,"virtualNetworkRules":[],"EnabledApiTypes":"Sql","disableKeyBasedMetadataWriteAccess":false,"enableFreeTier":false,"enableAnalyticalStorage":false,"analyticalStorageConfiguration":{"schemaType":"WellDefined"},"instanceId":"ebe10200-ddcb-4057-9646-4a05732031bb","databaseAccountOfferType":"Standard","defaultIdentity":"","networkAclBypass":"None","disableLocalAuth":false,"enablePartitionMerge":false,"consistencyPolicy":{"defaultConsistencyLevel":"Session","maxIntervalInSeconds":5,"maxStalenessPrefix":100},"configurationOverrides":{},"writeLocations":[{"id":"cli-test000003-westus","locationName":"West + US","provisioningState":"Creating","failoverPriority":0,"isZoneRedundant":false}],"readLocations":[{"id":"cli-test000003-westus","locationName":"West + US","provisioningState":"Creating","failoverPriority":0,"isZoneRedundant":false}],"locations":[{"id":"cli-test000003-westus","locationName":"West + US","provisioningState":"Creating","failoverPriority":0,"isZoneRedundant":false}],"failoverPolicies":[{"id":"cli-test000003-westus","locationName":"West + US","failoverPriority":0}],"cors":[],"capabilities":[],"ipRules":[],"backupPolicy":{"type":"Periodic","periodicModeProperties":{"backupIntervalInMinutes":240,"backupRetentionIntervalInHours":8,"backupStorageRedundancy":"Invalid"}},"networkAclBypassResourceIds":[],"keysMetadata":{"primaryMasterKey":{"generationTime":"2022-12-15T18:48:12.2120681Z"},"secondaryMasterKey":{"generationTime":"2022-12-15T18:48:12.2120681Z"},"primaryReadonlyMasterKey":{"generationTime":"2022-12-15T18:48:12.2120681Z"},"secondaryReadonlyMasterKey":{"generationTime":"2022-12-15T18:48:12.2120681Z"}}},"identity":{"type":"None"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westus/operationsStatus/0428e158-d447-4e35-96e6-0a184f26d47b?api-version=2022-08-15 + cache-control: + - no-store, no-cache + content-length: + - '2216' + content-type: + - application/json + date: + - Thu, 15 Dec 2022 18:48:14 GMT + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003/operationResults/0428e158-d447-4e35-96e6-0a184f26d47b?api-version=2022-08-15 + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-gatewayversion: + - version=2.14.0 + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: Ok +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - cosmosdb create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westus/operationsStatus/0428e158-d447-4e35-96e6-0a184f26d47b?api-version=2022-08-15 + response: + body: + string: '{"status":"Dequeued"}' + headers: + cache-control: + - no-store, no-cache + content-length: + - '21' + content-type: + - application/json + date: + - Thu, 15 Dec 2022 18:48:44 GMT + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-gatewayversion: + - version=2.14.0 + status: + code: 200 + message: Ok +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - cosmosdb create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westus/operationsStatus/0428e158-d447-4e35-96e6-0a184f26d47b?api-version=2022-08-15 + response: + body: + string: '{"status":"Dequeued"}' + headers: + cache-control: + - no-store, no-cache + content-length: + - '21' + content-type: + - application/json + date: + - Thu, 15 Dec 2022 18:49:13 GMT + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-gatewayversion: + - version=2.14.0 + status: + code: 200 + message: Ok +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - cosmosdb create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westus/operationsStatus/0428e158-d447-4e35-96e6-0a184f26d47b?api-version=2022-08-15 + response: + body: + string: '{"status":"Dequeued"}' + headers: + cache-control: + - no-store, no-cache + content-length: + - '21' + content-type: + - application/json + date: + - Thu, 15 Dec 2022 18:49:43 GMT + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-gatewayversion: + - version=2.14.0 + status: + code: 200 + message: Ok +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - cosmosdb create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westus/operationsStatus/0428e158-d447-4e35-96e6-0a184f26d47b?api-version=2022-08-15 + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-store, no-cache + content-length: + - '22' + content-type: + - application/json + date: + - Thu, 15 Dec 2022 18:50:13 GMT + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-gatewayversion: + - version=2.14.0 + status: + code: 200 + message: Ok +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - cosmosdb create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003?api-version=2022-08-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003","name":"cli-test000003","location":"West + US","type":"Microsoft.DocumentDB/databaseAccounts","kind":"GlobalDocumentDB","tags":{},"systemData":{"createdAt":"2022-12-15T18:49:39.3573097Z"},"properties":{"provisioningState":"Succeeded","documentEndpoint":"https://cli-test000003.documents.azure.com:443/","publicNetworkAccess":"Enabled","enableAutomaticFailover":false,"enableMultipleWriteLocations":false,"enablePartitionKeyMonitor":false,"isVirtualNetworkFilterEnabled":false,"virtualNetworkRules":[],"EnabledApiTypes":"Sql","disableKeyBasedMetadataWriteAccess":false,"enableFreeTier":false,"enableAnalyticalStorage":false,"analyticalStorageConfiguration":{"schemaType":"WellDefined"},"instanceId":"ebe10200-ddcb-4057-9646-4a05732031bb","databaseAccountOfferType":"Standard","defaultIdentity":"FirstPartyIdentity","networkAclBypass":"None","disableLocalAuth":false,"enablePartitionMerge":false,"consistencyPolicy":{"defaultConsistencyLevel":"Session","maxIntervalInSeconds":5,"maxStalenessPrefix":100},"configurationOverrides":{},"writeLocations":[{"id":"cli-test000003-westus","locationName":"West + US","documentEndpoint":"https://cli-test000003-westus.documents.azure.com:443/","provisioningState":"Succeeded","failoverPriority":0,"isZoneRedundant":false}],"readLocations":[{"id":"cli-test000003-westus","locationName":"West + US","documentEndpoint":"https://cli-test000003-westus.documents.azure.com:443/","provisioningState":"Succeeded","failoverPriority":0,"isZoneRedundant":false}],"locations":[{"id":"cli-test000003-westus","locationName":"West + US","documentEndpoint":"https://cli-test000003-westus.documents.azure.com:443/","provisioningState":"Succeeded","failoverPriority":0,"isZoneRedundant":false}],"failoverPolicies":[{"id":"cli-test000003-westus","locationName":"West + US","failoverPriority":0}],"cors":[],"capabilities":[],"ipRules":[],"backupPolicy":{"type":"Periodic","periodicModeProperties":{"backupIntervalInMinutes":240,"backupRetentionIntervalInHours":8,"backupStorageRedundancy":"Geo"}},"networkAclBypassResourceIds":[],"keysMetadata":{"primaryMasterKey":{"generationTime":"2022-12-15T18:49:39.3573097Z"},"secondaryMasterKey":{"generationTime":"2022-12-15T18:49:39.3573097Z"},"primaryReadonlyMasterKey":{"generationTime":"2022-12-15T18:49:39.3573097Z"},"secondaryReadonlyMasterKey":{"generationTime":"2022-12-15T18:49:39.3573097Z"}}},"identity":{"type":"None"}}' + headers: + cache-control: + - no-store, no-cache + content-length: + - '2531' + content-type: + - application/json + date: + - Thu, 15 Dec 2022 18:50:13 GMT + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-gatewayversion: + - version=2.14.0 + status: + code: 200 + message: Ok +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - cosmosdb create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003?api-version=2022-08-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003","name":"cli-test000003","location":"West + US","type":"Microsoft.DocumentDB/databaseAccounts","kind":"GlobalDocumentDB","tags":{},"systemData":{"createdAt":"2022-12-15T18:49:39.3573097Z"},"properties":{"provisioningState":"Succeeded","documentEndpoint":"https://cli-test000003.documents.azure.com:443/","publicNetworkAccess":"Enabled","enableAutomaticFailover":false,"enableMultipleWriteLocations":false,"enablePartitionKeyMonitor":false,"isVirtualNetworkFilterEnabled":false,"virtualNetworkRules":[],"EnabledApiTypes":"Sql","disableKeyBasedMetadataWriteAccess":false,"enableFreeTier":false,"enableAnalyticalStorage":false,"analyticalStorageConfiguration":{"schemaType":"WellDefined"},"instanceId":"ebe10200-ddcb-4057-9646-4a05732031bb","databaseAccountOfferType":"Standard","defaultIdentity":"FirstPartyIdentity","networkAclBypass":"None","disableLocalAuth":false,"enablePartitionMerge":false,"consistencyPolicy":{"defaultConsistencyLevel":"Session","maxIntervalInSeconds":5,"maxStalenessPrefix":100},"configurationOverrides":{},"writeLocations":[{"id":"cli-test000003-westus","locationName":"West + US","documentEndpoint":"https://cli-test000003-westus.documents.azure.com:443/","provisioningState":"Succeeded","failoverPriority":0,"isZoneRedundant":false}],"readLocations":[{"id":"cli-test000003-westus","locationName":"West + US","documentEndpoint":"https://cli-test000003-westus.documents.azure.com:443/","provisioningState":"Succeeded","failoverPriority":0,"isZoneRedundant":false}],"locations":[{"id":"cli-test000003-westus","locationName":"West + US","documentEndpoint":"https://cli-test000003-westus.documents.azure.com:443/","provisioningState":"Succeeded","failoverPriority":0,"isZoneRedundant":false}],"failoverPolicies":[{"id":"cli-test000003-westus","locationName":"West + US","failoverPriority":0}],"cors":[],"capabilities":[],"ipRules":[],"backupPolicy":{"type":"Periodic","periodicModeProperties":{"backupIntervalInMinutes":240,"backupRetentionIntervalInHours":8,"backupStorageRedundancy":"Geo"}},"networkAclBypassResourceIds":[],"keysMetadata":{"primaryMasterKey":{"generationTime":"2022-12-15T18:49:39.3573097Z"},"secondaryMasterKey":{"generationTime":"2022-12-15T18:49:39.3573097Z"},"primaryReadonlyMasterKey":{"generationTime":"2022-12-15T18:49:39.3573097Z"},"secondaryReadonlyMasterKey":{"generationTime":"2022-12-15T18:49:39.3573097Z"}}},"identity":{"type":"None"}}' + headers: + cache-control: + - no-store, no-cache + content-length: + - '2531' + content-type: + - application/json + date: + - Thu, 15 Dec 2022 18:50:13 GMT + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-gatewayversion: + - version=2.14.0 + status: + code: 200 + message: Ok +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - staticwebapp dbconnection create + Connection: + - keep-alive + ParameterSetName: + - -n -g -d + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central + US","properties":{"defaultHostname":"victorious-pond-031d08210.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":null,"privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + headers: + cache-control: + - no-cache + content-length: + - '813' + content-type: + - application/json + date: + - Thu, 15 Dec 2022 18:50:15 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - staticwebapp dbconnection create + Connection: + - keep-alive + ParameterSetName: + - -n -g -d + User-Agent: + - python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) AZURECLI/2.43.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003?api-version=2021-10-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003","name":"cli-test000003","location":"West + US","type":"Microsoft.DocumentDB/databaseAccounts","kind":"GlobalDocumentDB","tags":{},"systemData":{"createdAt":"2022-12-15T18:49:39.3573097Z"},"properties":{"provisioningState":"Succeeded","documentEndpoint":"https://cli-test000003.documents.azure.com:443/","publicNetworkAccess":"Enabled","enableAutomaticFailover":false,"enableMultipleWriteLocations":false,"enablePartitionKeyMonitor":false,"isVirtualNetworkFilterEnabled":false,"virtualNetworkRules":[],"EnabledApiTypes":"Sql","disableKeyBasedMetadataWriteAccess":false,"enableFreeTier":false,"enableAnalyticalStorage":false,"analyticalStorageConfiguration":{"schemaType":"WellDefined"},"instanceId":"ebe10200-ddcb-4057-9646-4a05732031bb","databaseAccountOfferType":"Standard","defaultIdentity":"FirstPartyIdentity","networkAclBypass":"None","disableLocalAuth":false,"consistencyPolicy":{"defaultConsistencyLevel":"Session","maxIntervalInSeconds":5,"maxStalenessPrefix":100},"configurationOverrides":{},"writeLocations":[{"id":"cli-test000003-westus","locationName":"West + US","documentEndpoint":"https://cli-test000003-westus.documents.azure.com:443/","provisioningState":"Succeeded","failoverPriority":0,"isZoneRedundant":false}],"readLocations":[{"id":"cli-test000003-westus","locationName":"West + US","documentEndpoint":"https://cli-test000003-westus.documents.azure.com:443/","provisioningState":"Succeeded","failoverPriority":0,"isZoneRedundant":false}],"locations":[{"id":"cli-test000003-westus","locationName":"West + US","documentEndpoint":"https://cli-test000003-westus.documents.azure.com:443/","provisioningState":"Succeeded","failoverPriority":0,"isZoneRedundant":false}],"failoverPolicies":[{"id":"cli-test000003-westus","locationName":"West + US","failoverPriority":0}],"cors":[],"capabilities":[],"ipRules":[],"backupPolicy":{"type":"Periodic","periodicModeProperties":{"backupIntervalInMinutes":240,"backupRetentionIntervalInHours":8,"backupStorageRedundancy":"Geo"}},"networkAclBypassResourceIds":[]},"identity":{"type":"None"}}' + headers: + cache-control: + - no-store, no-cache + content-length: + - '2189' + content-type: + - application/json + date: + - Thu, 15 Dec 2022 18:50:16 GMT + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-gatewayversion: + - version=2.14.0 + status: + code: 200 + message: Ok +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - staticwebapp dbconnection create + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n -g -d + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003/listConnectionStrings?api-version=2022-08-15 + response: + body: + string: '{"connectionStrings":[{"connectionString":"AccountEndpoint=https://cli-test000003.documents.azure.com:443/;AccountKey=UDgdlBaz89FXp7tdw4sj3KPZffCa9FJL8SuEXjkaaMv222NMIWdqFE4JPXAu9BSuGwFZHdgYoEm2ACDb460rQg==;","description":"Primary + SQL Connection String"},{"connectionString":"AccountEndpoint=https://cli-test000003.documents.azure.com:443/;AccountKey=BCLQTP89RvR9R8EruPp8PLtqCpihbMUSqQsLSqJSsx4VF1EsKESp6fFNxGzlbbw6Z6K0a1yaw8wxACDbcx4CDw==;","description":"Secondary + SQL Connection String"},{"connectionString":"AccountEndpoint=https://cli-test000003.documents.azure.com:443/;AccountKey=GijZlhXXbHrxXoShgqNCr23m6DluSrOl3oLBMnFjhQqLKoPbgx5oO2tzEx3MVBqyH47zigEZQYb5ACDb3ZAKpA==;","description":"Primary + Read-Only SQL Connection String"},{"connectionString":"AccountEndpoint=https://cli-test000003.documents.azure.com:443/;AccountKey=fzCzgWodBP5uYSMibiSmRELRk86Fow0rEqtDX522mAlNon1kP1efRLpFtVkmQIYL28fwqsxWPU19ACDbv4kJ7w==;","description":"Secondary + Read-Only SQL Connection String"}]}' + headers: + cache-control: + - no-store, no-cache + content-length: + - '983' + content-type: + - application/json + date: + - Thu, 15 Dec 2022 18:50:16 GMT + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-gatewayversion: + - version=2.14.0 + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: Ok +- request: + body: '{"properties": {"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003", + "connectionIdentity": null, "region": "West US", "connectionString": "AccountEndpoint=https://cli-test000003.documents.azure.com:443/;AccountKey=UDgdlBaz89FXp7tdw4sj3KPZffCa9FJL8SuEXjkaaMv222NMIWdqFE4JPXAu9BSuGwFZHdgYoEm2ACDb460rQg==;"}}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - staticwebapp dbconnection create + Connection: + - keep-alive + Content-Length: + - '415' + Content-Type: + - application/json + ParameterSetName: + - -n -g -d + User-Agent: + - python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) AZURECLI/2.43.0 + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticsites/cli_test000002/builds/default/databaseConnections/default?api-version=2022-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002/builds/default/databaseConnections/default","name":"default","type":"Microsoft.Web/staticSites/builds/databaseConnections","location":"Central + US","properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003","region":"West + US"}}' + headers: + cache-control: + - no-cache + content-length: + - '481' + content-type: + - application/json + date: + - Thu, 15 Dec 2022 18:50:18 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_mysql_flex.yaml b/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_mysql_flex.yaml new file mode 100644 index 00000000000..db39e2168b9 --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_mysql_flex.yaml @@ -0,0 +1,262 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - staticwebapp create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 + response: + body: + string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.Web/staticSites/cli_test000002'' + under resource group ''cli_test000001'' was not found. For more details please + go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '226' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 21:18:01 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: '{"location": "centralus", "sku": {"name": "Free", "tier": "Free"}, "properties": + {"buildProperties": {"appLocation": "/"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - staticwebapp create + Connection: + - keep-alive + Content-Length: + - '123' + Content-Type: + - application/json + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central + US","properties":{"defaultHostname":"black-tree-044fef110.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":null,"privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + headers: + cache-control: + - no-cache + content-length: + - '808' + content-type: + - application/json + date: + - Thu, 15 Dec 2022 21:18:03 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - staticwebapp create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central + US","properties":{"defaultHostname":"black-tree-044fef110.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":null,"privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + headers: + cache-control: + - no-cache + content-length: + - '808' + content-type: + - application/json + date: + - Thu, 15 Dec 2022 21:18:04 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - unknown + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central + US","properties":{"defaultHostname":"black-tree-044fef110.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":null,"privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + headers: + cache-control: + - no-cache + content-length: + - '808' + content-type: + - application/json + date: + - Thu, 15 Dec 2022 21:18:04 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"properties": {"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DBforMySQL/flexibleServers/cli-test000003", + "connectionIdentity": null, "region": "East US", "connectionString": "Server=\"cli-test000003.mysql.database.azure.com\";UserID + = \"aturing\";Password=\"thisisapassword123!\";Database=\"tables\";SslMode=MySqlSslMode.Required;SslCa=\"{path_to_CA_cert}\""}}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - unknown + Connection: + - keep-alive + Content-Length: + - '432' + Content-Type: + - application/json + User-Agent: + - python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) AZURECLI/2.43.0 + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticsites/cli_test000002/builds/default/databaseConnections/default?api-version=2022-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002/builds/default/databaseConnections/default","name":"default","type":"Microsoft.Web/staticSites/builds/databaseConnections","location":"Central + US","properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DBforMySQL/flexibleServers/cli-test000003","region":"East + US"}}' + headers: + cache-control: + - no-cache + content-length: + - '480' + content-type: + - application/json + date: + - Thu, 15 Dec 2022 21:18:06 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_pgsql_flex.yaml b/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_pgsql_flex.yaml new file mode 100644 index 00000000000..62d2432ad53 --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_pgsql_flex.yaml @@ -0,0 +1,262 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - staticwebapp create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 + response: + body: + string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.Web/staticSites/cli_test000002'' + under resource group ''cli_test000001'' was not found. For more details please + go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '226' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 21:54:12 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: '{"location": "centralus", "sku": {"name": "Free", "tier": "Free"}, "properties": + {"buildProperties": {"appLocation": "/"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - staticwebapp create + Connection: + - keep-alive + Content-Length: + - '123' + Content-Type: + - application/json + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central + US","properties":{"defaultHostname":"red-glacier-0fc376510.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":null,"privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + headers: + cache-control: + - no-cache + content-length: + - '809' + content-type: + - application/json + date: + - Thu, 15 Dec 2022 21:54:14 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - staticwebapp create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central + US","properties":{"defaultHostname":"red-glacier-0fc376510.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":null,"privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + headers: + cache-control: + - no-cache + content-length: + - '809' + content-type: + - application/json + date: + - Thu, 15 Dec 2022 21:54:14 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - unknown + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central + US","properties":{"defaultHostname":"red-glacier-0fc376510.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":null,"privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + headers: + cache-control: + - no-cache + content-length: + - '809' + content-type: + - application/json + date: + - Thu, 15 Dec 2022 21:54:16 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"properties": {"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DBforMySQL/flexibleServers/cli-test000003", + "connectionIdentity": null, "region": "East US", "connectionString": "Server=cli-test000003.postgres.database.azure.com;Database=tables;Port=5432;User + Id=aturing;Password=thisisapassword123!;Ssl Mode=Require;"}}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - unknown + Connection: + - keep-alive + Content-Length: + - '388' + Content-Type: + - application/json + User-Agent: + - python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) AZURECLI/2.43.0 + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticsites/cli_test000002/builds/default/databaseConnections/default?api-version=2022-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002/builds/default/databaseConnections/default","name":"default","type":"Microsoft.Web/staticSites/builds/databaseConnections","location":"Central + US","properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DBforMySQL/flexibleServers/cli-test000003","region":"East + US"}}' + headers: + cache-control: + - no-cache + content-length: + - '480' + content-type: + - application/json + date: + - Thu, 15 Dec 2022 21:54:18 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_pgsql_single.yaml b/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_pgsql_single.yaml new file mode 100644 index 00000000000..d515a3189ee --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_pgsql_single.yaml @@ -0,0 +1,915 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - staticwebapp create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 + response: + body: + string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.Web/staticSites/cli_test000002'' + under resource group ''cli_test000001'' was not found. For more details please + go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '226' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:55:20 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: '{"location": "centralus", "sku": {"name": "Free", "tier": "Free"}, "properties": + {"buildProperties": {"appLocation": "/"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - staticwebapp create + Connection: + - keep-alive + Content-Length: + - '123' + Content-Type: + - application/json + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central + US","properties":{"defaultHostname":"lively-sea-0027bf610.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":null,"privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + headers: + cache-control: + - no-cache + content-length: + - '808' + content-type: + - application/json + date: + - Thu, 15 Dec 2022 18:55:21 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - staticwebapp create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central + US","properties":{"defaultHostname":"lively-sea-0027bf610.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":null,"privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + headers: + cache-control: + - no-cache + content-length: + - '808' + content-type: + - application/json + date: + - Thu, 15 Dec 2022 18:55:22 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - staticwebapp create + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/locations?api-version=2019-11-01 + response: + body: + string: "{\"value\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus\",\"name\":\"eastus\",\"displayName\":\"East + US\",\"regionalDisplayName\":\"(US) East US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-79.8164\",\"latitude\":\"37.3719\",\"physicalLocation\":\"Virginia\",\"pairedRegion\":[{\"name\":\"westus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2\",\"name\":\"eastus2\",\"displayName\":\"East + US 2\",\"regionalDisplayName\":\"(US) East US 2\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-78.3889\",\"latitude\":\"36.6681\",\"physicalLocation\":\"Virginia\",\"pairedRegion\":[{\"name\":\"centralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralus\",\"name\":\"southcentralus\",\"displayName\":\"South + Central US\",\"regionalDisplayName\":\"(US) South Central US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-98.5\",\"latitude\":\"29.4167\",\"physicalLocation\":\"Texas\",\"pairedRegion\":[{\"name\":\"northcentralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northcentralus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus2\",\"name\":\"westus2\",\"displayName\":\"West + US 2\",\"regionalDisplayName\":\"(US) West US 2\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-119.852\",\"latitude\":\"47.233\",\"physicalLocation\":\"Washington\",\"pairedRegion\":[{\"name\":\"westcentralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westcentralus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus3\",\"name\":\"westus3\",\"displayName\":\"West + US 3\",\"regionalDisplayName\":\"(US) West US 3\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-112.074036\",\"latitude\":\"33.448376\",\"physicalLocation\":\"Phoenix\",\"pairedRegion\":[{\"name\":\"eastus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiaeast\",\"name\":\"australiaeast\",\"displayName\":\"Australia + East\",\"regionalDisplayName\":\"(Asia Pacific) Australia East\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"151.2094\",\"latitude\":\"-33.86\",\"physicalLocation\":\"New + South Wales\",\"pairedRegion\":[{\"name\":\"australiasoutheast\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiasoutheast\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southeastasia\",\"name\":\"southeastasia\",\"displayName\":\"Southeast + Asia\",\"regionalDisplayName\":\"(Asia Pacific) Southeast Asia\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"103.833\",\"latitude\":\"1.283\",\"physicalLocation\":\"Singapore\",\"pairedRegion\":[{\"name\":\"eastasia\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastasia\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northeurope\",\"name\":\"northeurope\",\"displayName\":\"North + Europe\",\"regionalDisplayName\":\"(Europe) North Europe\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"-6.2597\",\"latitude\":\"53.3478\",\"physicalLocation\":\"Ireland\",\"pairedRegion\":[{\"name\":\"westeurope\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westeurope\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/swedencentral\",\"name\":\"swedencentral\",\"displayName\":\"Sweden + Central\",\"regionalDisplayName\":\"(Europe) Sweden Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"17.14127\",\"latitude\":\"60.67488\",\"physicalLocation\":\"G\xE4vle\",\"pairedRegion\":[{\"name\":\"swedensouth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/swedensouth\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uksouth\",\"name\":\"uksouth\",\"displayName\":\"UK + South\",\"regionalDisplayName\":\"(Europe) UK South\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"-0.799\",\"latitude\":\"50.941\",\"physicalLocation\":\"London\",\"pairedRegion\":[{\"name\":\"ukwest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/ukwest\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westeurope\",\"name\":\"westeurope\",\"displayName\":\"West + Europe\",\"regionalDisplayName\":\"(Europe) West Europe\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"4.9\",\"latitude\":\"52.3667\",\"physicalLocation\":\"Netherlands\",\"pairedRegion\":[{\"name\":\"northeurope\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northeurope\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralus\",\"name\":\"centralus\",\"displayName\":\"Central + US\",\"regionalDisplayName\":\"(US) Central US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-93.6208\",\"latitude\":\"41.5908\",\"physicalLocation\":\"Iowa\",\"pairedRegion\":[{\"name\":\"eastus2\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricanorth\",\"name\":\"southafricanorth\",\"displayName\":\"South + Africa North\",\"regionalDisplayName\":\"(Africa) South Africa North\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Africa\",\"longitude\":\"28.218370\",\"latitude\":\"-25.731340\",\"physicalLocation\":\"Johannesburg\",\"pairedRegion\":[{\"name\":\"southafricawest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricawest\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralindia\",\"name\":\"centralindia\",\"displayName\":\"Central + India\",\"regionalDisplayName\":\"(Asia Pacific) Central India\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"73.9197\",\"latitude\":\"18.5822\",\"physicalLocation\":\"Pune\",\"pairedRegion\":[{\"name\":\"southindia\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southindia\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastasia\",\"name\":\"eastasia\",\"displayName\":\"East + Asia\",\"regionalDisplayName\":\"(Asia Pacific) East Asia\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"114.188\",\"latitude\":\"22.267\",\"physicalLocation\":\"Hong + Kong\",\"pairedRegion\":[{\"name\":\"southeastasia\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southeastasia\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japaneast\",\"name\":\"japaneast\",\"displayName\":\"Japan + East\",\"regionalDisplayName\":\"(Asia Pacific) Japan East\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"139.77\",\"latitude\":\"35.68\",\"physicalLocation\":\"Tokyo, + Saitama\",\"pairedRegion\":[{\"name\":\"japanwest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japanwest\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreacentral\",\"name\":\"koreacentral\",\"displayName\":\"Korea + Central\",\"regionalDisplayName\":\"(Asia Pacific) Korea Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"126.9780\",\"latitude\":\"37.5665\",\"physicalLocation\":\"Seoul\",\"pairedRegion\":[{\"name\":\"koreasouth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreasouth\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadacentral\",\"name\":\"canadacentral\",\"displayName\":\"Canada + Central\",\"regionalDisplayName\":\"(Canada) Canada Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Canada\",\"longitude\":\"-79.383\",\"latitude\":\"43.653\",\"physicalLocation\":\"Toronto\",\"pairedRegion\":[{\"name\":\"canadaeast\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadaeast\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francecentral\",\"name\":\"francecentral\",\"displayName\":\"France + Central\",\"regionalDisplayName\":\"(Europe) France Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"2.3730\",\"latitude\":\"46.3772\",\"physicalLocation\":\"Paris\",\"pairedRegion\":[{\"name\":\"francesouth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francesouth\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanywestcentral\",\"name\":\"germanywestcentral\",\"displayName\":\"Germany + West Central\",\"regionalDisplayName\":\"(Europe) Germany West Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"8.682127\",\"latitude\":\"50.110924\",\"physicalLocation\":\"Frankfurt\",\"pairedRegion\":[{\"name\":\"germanynorth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanynorth\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwayeast\",\"name\":\"norwayeast\",\"displayName\":\"Norway + East\",\"regionalDisplayName\":\"(Europe) Norway East\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"10.752245\",\"latitude\":\"59.913868\",\"physicalLocation\":\"Norway\",\"pairedRegion\":[{\"name\":\"norwaywest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwaywest\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandnorth\",\"name\":\"switzerlandnorth\",\"displayName\":\"Switzerland + North\",\"regionalDisplayName\":\"(Europe) Switzerland North\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Europe\",\"longitude\":\"8.564572\",\"latitude\":\"47.451542\",\"physicalLocation\":\"Zurich\",\"pairedRegion\":[{\"name\":\"switzerlandwest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandwest\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaenorth\",\"name\":\"uaenorth\",\"displayName\":\"UAE + North\",\"regionalDisplayName\":\"(Middle East) UAE North\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Middle + East\",\"longitude\":\"55.316666\",\"latitude\":\"25.266666\",\"physicalLocation\":\"Dubai\",\"pairedRegion\":[{\"name\":\"uaecentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaecentral\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazilsouth\",\"name\":\"brazilsouth\",\"displayName\":\"Brazil + South\",\"regionalDisplayName\":\"(South America) Brazil South\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"South + America\",\"longitude\":\"-46.633\",\"latitude\":\"-23.55\",\"physicalLocation\":\"Sao + Paulo State\",\"pairedRegion\":[{\"name\":\"southcentralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2euap\",\"name\":\"eastus2euap\",\"displayName\":\"East + US 2 EUAP\",\"regionalDisplayName\":\"(US) East US 2 EUAP\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-78.3889\",\"latitude\":\"36.6681\",\"pairedRegion\":[{\"name\":\"centraluseuap\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centraluseuap\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/qatarcentral\",\"name\":\"qatarcentral\",\"displayName\":\"Qatar + Central\",\"regionalDisplayName\":\"(Middle East) Qatar Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Middle + East\",\"longitude\":\"51.439327\",\"latitude\":\"25.551462\",\"physicalLocation\":\"Doha\",\"pairedRegion\":[{\"name\":\"westeurope\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westeurope\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralusstage\",\"name\":\"centralusstage\",\"displayName\":\"Central + US (Stage)\",\"regionalDisplayName\":\"(US) Central US (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastusstage\",\"name\":\"eastusstage\",\"displayName\":\"East + US (Stage)\",\"regionalDisplayName\":\"(US) East US (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2stage\",\"name\":\"eastus2stage\",\"displayName\":\"East + US 2 (Stage)\",\"regionalDisplayName\":\"(US) East US 2 (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northcentralusstage\",\"name\":\"northcentralusstage\",\"displayName\":\"North + Central US (Stage)\",\"regionalDisplayName\":\"(US) North Central US (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralusstage\",\"name\":\"southcentralusstage\",\"displayName\":\"South + Central US (Stage)\",\"regionalDisplayName\":\"(US) South Central US (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westusstage\",\"name\":\"westusstage\",\"displayName\":\"West + US (Stage)\",\"regionalDisplayName\":\"(US) West US (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus2stage\",\"name\":\"westus2stage\",\"displayName\":\"West + US 2 (Stage)\",\"regionalDisplayName\":\"(US) West US 2 (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/asia\",\"name\":\"asia\",\"displayName\":\"Asia\",\"regionalDisplayName\":\"Asia\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/asiapacific\",\"name\":\"asiapacific\",\"displayName\":\"Asia + Pacific\",\"regionalDisplayName\":\"Asia Pacific\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australia\",\"name\":\"australia\",\"displayName\":\"Australia\",\"regionalDisplayName\":\"Australia\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazil\",\"name\":\"brazil\",\"displayName\":\"Brazil\",\"regionalDisplayName\":\"Brazil\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canada\",\"name\":\"canada\",\"displayName\":\"Canada\",\"regionalDisplayName\":\"Canada\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/europe\",\"name\":\"europe\",\"displayName\":\"Europe\",\"regionalDisplayName\":\"Europe\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/france\",\"name\":\"france\",\"displayName\":\"France\",\"regionalDisplayName\":\"France\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germany\",\"name\":\"germany\",\"displayName\":\"Germany\",\"regionalDisplayName\":\"Germany\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/global\",\"name\":\"global\",\"displayName\":\"Global\",\"regionalDisplayName\":\"Global\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/india\",\"name\":\"india\",\"displayName\":\"India\",\"regionalDisplayName\":\"India\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japan\",\"name\":\"japan\",\"displayName\":\"Japan\",\"regionalDisplayName\":\"Japan\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/korea\",\"name\":\"korea\",\"displayName\":\"Korea\",\"regionalDisplayName\":\"Korea\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norway\",\"name\":\"norway\",\"displayName\":\"Norway\",\"regionalDisplayName\":\"Norway\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/singapore\",\"name\":\"singapore\",\"displayName\":\"Singapore\",\"regionalDisplayName\":\"Singapore\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafrica\",\"name\":\"southafrica\",\"displayName\":\"South + Africa\",\"regionalDisplayName\":\"South Africa\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerland\",\"name\":\"switzerland\",\"displayName\":\"Switzerland\",\"regionalDisplayName\":\"Switzerland\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uae\",\"name\":\"uae\",\"displayName\":\"United + Arab Emirates\",\"regionalDisplayName\":\"United Arab Emirates\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uk\",\"name\":\"uk\",\"displayName\":\"United + Kingdom\",\"regionalDisplayName\":\"United Kingdom\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/unitedstates\",\"name\":\"unitedstates\",\"displayName\":\"United + States\",\"regionalDisplayName\":\"United States\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/unitedstateseuap\",\"name\":\"unitedstateseuap\",\"displayName\":\"United + States EUAP\",\"regionalDisplayName\":\"United States EUAP\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastasiastage\",\"name\":\"eastasiastage\",\"displayName\":\"East + Asia (Stage)\",\"regionalDisplayName\":\"(Asia Pacific) East Asia (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southeastasiastage\",\"name\":\"southeastasiastage\",\"displayName\":\"Southeast + Asia (Stage)\",\"regionalDisplayName\":\"(Asia Pacific) Southeast Asia (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastusstg\",\"name\":\"eastusstg\",\"displayName\":\"East + US STG\",\"regionalDisplayName\":\"(US) East US STG\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-79.8164\",\"latitude\":\"37.3719\",\"physicalLocation\":\"Virginia\",\"pairedRegion\":[{\"name\":\"southcentralusstg\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralusstg\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northcentralus\",\"name\":\"northcentralus\",\"displayName\":\"North + Central US\",\"regionalDisplayName\":\"(US) North Central US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-87.6278\",\"latitude\":\"41.8819\",\"physicalLocation\":\"Illinois\",\"pairedRegion\":[{\"name\":\"southcentralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus\",\"name\":\"westus\",\"displayName\":\"West + US\",\"regionalDisplayName\":\"(US) West US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-122.417\",\"latitude\":\"37.783\",\"physicalLocation\":\"California\",\"pairedRegion\":[{\"name\":\"eastus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/jioindiawest\",\"name\":\"jioindiawest\",\"displayName\":\"Jio + India West\",\"regionalDisplayName\":\"(Asia Pacific) Jio India West\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"70.05773\",\"latitude\":\"22.470701\",\"physicalLocation\":\"Jamnagar\",\"pairedRegion\":[{\"name\":\"jioindiacentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/jioindiacentral\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centraluseuap\",\"name\":\"centraluseuap\",\"displayName\":\"Central + US EUAP\",\"regionalDisplayName\":\"(US) Central US EUAP\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-93.6208\",\"latitude\":\"41.5908\",\"pairedRegion\":[{\"name\":\"eastus2euap\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2euap\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westcentralus\",\"name\":\"westcentralus\",\"displayName\":\"West + Central US\",\"regionalDisplayName\":\"(US) West Central US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-110.234\",\"latitude\":\"40.890\",\"physicalLocation\":\"Wyoming\",\"pairedRegion\":[{\"name\":\"westus2\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus2\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricawest\",\"name\":\"southafricawest\",\"displayName\":\"South + Africa West\",\"regionalDisplayName\":\"(Africa) South Africa West\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Africa\",\"longitude\":\"18.843266\",\"latitude\":\"-34.075691\",\"physicalLocation\":\"Cape + Town\",\"pairedRegion\":[{\"name\":\"southafricanorth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricanorth\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral\",\"name\":\"australiacentral\",\"displayName\":\"Australia + Central\",\"regionalDisplayName\":\"(Asia Pacific) Australia Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"149.1244\",\"latitude\":\"-35.3075\",\"physicalLocation\":\"Canberra\",\"pairedRegion\":[{\"name\":\"australiacentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral2\",\"name\":\"australiacentral2\",\"displayName\":\"Australia + Central 2\",\"regionalDisplayName\":\"(Asia Pacific) Australia Central 2\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"149.1244\",\"latitude\":\"-35.3075\",\"physicalLocation\":\"Canberra\",\"pairedRegion\":[{\"name\":\"australiacentral2\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral2\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiasoutheast\",\"name\":\"australiasoutheast\",\"displayName\":\"Australia + Southeast\",\"regionalDisplayName\":\"(Asia Pacific) Australia Southeast\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"144.9631\",\"latitude\":\"-37.8136\",\"physicalLocation\":\"Victoria\",\"pairedRegion\":[{\"name\":\"australiaeast\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiaeast\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japanwest\",\"name\":\"japanwest\",\"displayName\":\"Japan + West\",\"regionalDisplayName\":\"(Asia Pacific) Japan West\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"135.5022\",\"latitude\":\"34.6939\",\"physicalLocation\":\"Osaka\",\"pairedRegion\":[{\"name\":\"japaneast\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japaneast\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/jioindiacentral\",\"name\":\"jioindiacentral\",\"displayName\":\"Jio + India Central\",\"regionalDisplayName\":\"(Asia Pacific) Jio India Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"79.08886\",\"latitude\":\"21.146633\",\"physicalLocation\":\"Nagpur\",\"pairedRegion\":[{\"name\":\"jioindiawest\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/jioindiawest\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreasouth\",\"name\":\"koreasouth\",\"displayName\":\"Korea + South\",\"regionalDisplayName\":\"(Asia Pacific) Korea South\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"129.0756\",\"latitude\":\"35.1796\",\"physicalLocation\":\"Busan\",\"pairedRegion\":[{\"name\":\"koreacentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreacentral\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southindia\",\"name\":\"southindia\",\"displayName\":\"South + India\",\"regionalDisplayName\":\"(Asia Pacific) South India\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"80.1636\",\"latitude\":\"12.9822\",\"physicalLocation\":\"Chennai\",\"pairedRegion\":[{\"name\":\"centralindia\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralindia\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westindia\",\"name\":\"westindia\",\"displayName\":\"West + India\",\"regionalDisplayName\":\"(Asia Pacific) West India\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia + Pacific\",\"longitude\":\"72.868\",\"latitude\":\"19.088\",\"physicalLocation\":\"Mumbai\",\"pairedRegion\":[{\"name\":\"southindia\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southindia\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadaeast\",\"name\":\"canadaeast\",\"displayName\":\"Canada + East\",\"regionalDisplayName\":\"(Canada) Canada East\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Canada\",\"longitude\":\"-71.217\",\"latitude\":\"46.817\",\"physicalLocation\":\"Quebec\",\"pairedRegion\":[{\"name\":\"canadacentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadacentral\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francesouth\",\"name\":\"francesouth\",\"displayName\":\"France + South\",\"regionalDisplayName\":\"(Europe) France South\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Europe\",\"longitude\":\"2.1972\",\"latitude\":\"43.8345\",\"physicalLocation\":\"Marseille\",\"pairedRegion\":[{\"name\":\"francecentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francecentral\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanynorth\",\"name\":\"germanynorth\",\"displayName\":\"Germany + North\",\"regionalDisplayName\":\"(Europe) Germany North\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Europe\",\"longitude\":\"8.806422\",\"latitude\":\"53.073635\",\"physicalLocation\":\"Berlin\",\"pairedRegion\":[{\"name\":\"germanywestcentral\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanywestcentral\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwaywest\",\"name\":\"norwaywest\",\"displayName\":\"Norway + West\",\"regionalDisplayName\":\"(Europe) Norway West\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Europe\",\"longitude\":\"5.733107\",\"latitude\":\"58.969975\",\"physicalLocation\":\"Norway\",\"pairedRegion\":[{\"name\":\"norwayeast\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwayeast\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandwest\",\"name\":\"switzerlandwest\",\"displayName\":\"Switzerland + West\",\"regionalDisplayName\":\"(Europe) Switzerland West\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Europe\",\"longitude\":\"6.143158\",\"latitude\":\"46.204391\",\"physicalLocation\":\"Geneva\",\"pairedRegion\":[{\"name\":\"switzerlandnorth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandnorth\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/ukwest\",\"name\":\"ukwest\",\"displayName\":\"UK + West\",\"regionalDisplayName\":\"(Europe) UK West\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Europe\",\"longitude\":\"-3.084\",\"latitude\":\"53.427\",\"physicalLocation\":\"Cardiff\",\"pairedRegion\":[{\"name\":\"uksouth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uksouth\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaecentral\",\"name\":\"uaecentral\",\"displayName\":\"UAE + Central\",\"regionalDisplayName\":\"(Middle East) UAE Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Middle + East\",\"longitude\":\"54.366669\",\"latitude\":\"24.466667\",\"physicalLocation\":\"Abu + Dhabi\",\"pairedRegion\":[{\"name\":\"uaenorth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaenorth\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazilsoutheast\",\"name\":\"brazilsoutheast\",\"displayName\":\"Brazil + Southeast\",\"regionalDisplayName\":\"(South America) Brazil Southeast\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"South + America\",\"longitude\":\"-43.2075\",\"latitude\":\"-22.90278\",\"physicalLocation\":\"Rio\",\"pairedRegion\":[{\"name\":\"brazilsouth\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazilsouth\"}]}}]}" + headers: + cache-control: + - no-cache + content-length: + - '29930' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:55:24 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n -u -p + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: HEAD + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test000001?api-version=2021-04-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 15 Dec 2022 18:55:24 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n -u -p + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001","name":"cli_test000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2022-12-15T18:55:18Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '306' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:55:24 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"name": "cli-test000003", "type": "Microsoft.DBforPostgreSQL/servers"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres server create + Connection: + - keep-alive + Content-Length: + - '71' + Content-Type: + - application/json + ParameterSetName: + - -l -g -n -u -p + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-rdbms/10.2.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/checkNameAvailability?api-version=2017-12-01 + response: + body: + string: '{"nameAvailable":true,"message":""}' + headers: + cache-control: + - no-cache + content-length: + - '35' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:55:26 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: '{"sku": {"name": "GP_Gen5_2"}, "properties": {"version": "11", "storageProfile": + {"storageMB": 5120, "storageAutogrow": "Enabled"}, "createMode": "Default", + "administratorLogin": "aturing", "administratorLoginPassword": "thisisapassword123!"}, + "location": "westus"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres server create + Connection: + - keep-alive + Content-Length: + - '265' + Content-Type: + - application/json + ParameterSetName: + - -l -g -n -u -p + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-rdbms/10.2.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DBforPostgreSQL/servers/cli-test000003?api-version=2017-12-01 + response: + body: + string: '{"operation":"UpsertElasticServer","startTime":"2022-12-15T18:55:27.767Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/westus/azureAsyncOperation/4b254167-d8bf-482d-9d36-d137a9da7605?api-version=2017-12-01 + cache-control: + - no-cache + content-length: + - '74' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:55:28 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/westus/operationResults/4b254167-d8bf-482d-9d36-d137a9da7605?api-version=2017-12-01 + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n -u -p + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-rdbms/10.2.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/westus/azureAsyncOperation/4b254167-d8bf-482d-9d36-d137a9da7605?api-version=2017-12-01 + response: + body: + string: '{"name":"4b254167-d8bf-482d-9d36-d137a9da7605","status":"InProgress","startTime":"2022-12-15T18:55:27.767Z"}' + headers: + cache-control: + - no-cache + content-length: + - '108' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:56:28 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n -u -p + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-rdbms/10.2.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/westus/azureAsyncOperation/4b254167-d8bf-482d-9d36-d137a9da7605?api-version=2017-12-01 + response: + body: + string: '{"name":"4b254167-d8bf-482d-9d36-d137a9da7605","status":"Succeeded","startTime":"2022-12-15T18:55:27.767Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:57:28 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n -u -p + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-rdbms/10.2.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DBforPostgreSQL/servers/cli-test000003?api-version=2017-12-01 + response: + body: + string: '{"sku":{"name":"GP_Gen5_2","tier":"GeneralPurpose","family":"Gen5","capacity":2},"properties":{"administratorLogin":"aturing","storageProfile":{"storageMB":5120,"backupRetentionDays":7,"geoRedundantBackup":"Disabled","storageAutogrow":"Enabled"},"version":"11","sslEnforcement":"Enabled","minimalTlsVersion":"TLSEnforcementDisabled","userVisibleState":"Ready","fullyQualifiedDomainName":"cli-test000003.postgres.database.azure.com","earliestRestoreDate":"2022-12-15T19:05:28.173+00:00","replicationRole":"None","masterServerId":"","replicaCapacity":5,"byokEnforcement":"Disabled","privateEndpointConnections":[],"infrastructureEncryption":"Disabled","publicNetworkAccess":"Enabled"},"location":"westus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DBforPostgreSQL/servers/cli-test000003","name":"cli-test000003","type":"Microsoft.DBforPostgreSQL/servers"}' + headers: + cache-control: + - no-cache + content-length: + - '918' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:57:28 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres db create + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + ParameterSetName: + - -g -n -s + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-rdbms/10.2.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DBforPostgreSQL/servers/cli-test000003/databases/tables?api-version=2017-12-01 + response: + body: + string: '{"operation":"UpsertElasticServerDatabase","startTime":"2022-12-15T18:57:29.63Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/westus/azureAsyncOperation/195feb0d-5f40-466f-b661-dba48ba653c3?api-version=2017-12-01 + cache-control: + - no-cache + content-length: + - '81' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:57:28 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/westus/operationResults/195feb0d-5f40-466f-b661-dba48ba653c3?api-version=2017-12-01 + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres db create + Connection: + - keep-alive + ParameterSetName: + - -g -n -s + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-rdbms/10.2.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/westus/azureAsyncOperation/195feb0d-5f40-466f-b661-dba48ba653c3?api-version=2017-12-01 + response: + body: + string: '{"name":"195feb0d-5f40-466f-b661-dba48ba653c3","status":"Succeeded","startTime":"2022-12-15T18:57:29.63Z"}' + headers: + cache-control: + - no-cache + content-length: + - '106' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:57:43 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres db create + Connection: + - keep-alive + ParameterSetName: + - -g -n -s + User-Agent: + - AZURECLI/2.43.0 azsdk-python-mgmt-rdbms/10.2.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DBforPostgreSQL/servers/cli-test000003/databases/tables?api-version=2017-12-01 + response: + body: + string: '{"properties":{"charset":"UTF8","collation":"English_United States.1252"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DBforPostgreSQL/servers/cli-test000003/databases/tables","name":"tables","type":"Microsoft.DBforPostgreSQL/servers/databases"}' + headers: + cache-control: + - no-cache + content-length: + - '308' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:57:44 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - staticwebapp dbconnection create + Connection: + - keep-alive + ParameterSetName: + - -n -g -u -p -d -b + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central + US","properties":{"defaultHostname":"lively-sea-0027bf610.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":null,"privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + headers: + cache-control: + - no-cache + content-length: + - '808' + content-type: + - application/json + date: + - Thu, 15 Dec 2022 18:57:45 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - staticwebapp dbconnection create + Connection: + - keep-alive + ParameterSetName: + - -n -g -u -p -d -b + User-Agent: + - python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) AZURECLI/2.43.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DBforPostgreSQL/servers/cli-test000003?api-version=2017-12-01 + response: + body: + string: '{"sku":{"name":"GP_Gen5_2","tier":"GeneralPurpose","family":"Gen5","capacity":2},"properties":{"administratorLogin":"aturing","storageProfile":{"storageMB":5120,"backupRetentionDays":7,"geoRedundantBackup":"Disabled","storageAutogrow":"Enabled"},"version":"11","sslEnforcement":"Enabled","minimalTlsVersion":"TLSEnforcementDisabled","userVisibleState":"Ready","fullyQualifiedDomainName":"cli-test000003.postgres.database.azure.com","earliestRestoreDate":"2022-12-15T19:05:28.173+00:00","replicationRole":"None","masterServerId":"","replicaCapacity":5,"byokEnforcement":"Disabled","privateEndpointConnections":[],"infrastructureEncryption":"Disabled","publicNetworkAccess":"Enabled"},"location":"westus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DBforPostgreSQL/servers/cli-test000003","name":"cli-test000003","type":"Microsoft.DBforPostgreSQL/servers"}' + headers: + cache-control: + - no-cache + content-length: + - '918' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 15 Dec 2022 18:57:45 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DBforPostgreSQL/servers/cli-test000003", + "connectionIdentity": null, "region": "westus", "connectionString": "Server=cli-test000003.postgres.database.azure.com;Database=tables;Port=5432;User + Id=aturing@cli-test000003;Password=thisisapassword123!;Ssl Mode=Require;"}}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - staticwebapp dbconnection create + Connection: + - keep-alive + Content-Length: + - '399' + Content-Type: + - application/json + ParameterSetName: + - -n -g -u -p -d -b + User-Agent: + - python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) AZURECLI/2.43.0 + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticsites/cli_test000002/builds/default/databaseConnections/default?api-version=2022-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002/builds/default/databaseConnections/default","name":"default","type":"Microsoft.Web/staticSites/builds/databaseConnections","location":"Central + US","properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DBforPostgreSQL/servers/cli-test000003","region":"West + US"}}' + headers: + cache-control: + - no-cache + content-length: + - '477' + content-type: + - application/json + date: + - Thu, 15 Dec 2022 18:57:47 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/src/staticwebapp/azext_staticwebapp/tests/latest/test_staticwebapp_scenario.py b/src/staticwebapp/azext_staticwebapp/tests/latest/test_staticwebapp_scenario.py index 2bf1628a78d..1ee1163a2bf 100644 --- a/src/staticwebapp/azext_staticwebapp/tests/latest/test_staticwebapp_scenario.py +++ b/src/staticwebapp/azext_staticwebapp/tests/latest/test_staticwebapp_scenario.py @@ -4,16 +4,117 @@ # -------------------------------------------------------------------------------------------- import os +from unittest import mock -from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer) +from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer, JMESPathCheck) + +from azext_staticwebapp.custom import create_dbconnection +from azext_staticwebapp._utils import MySqlFlexHandler, PgSqlFlexHandler TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) -class StaticwebappScenarioTest(ScenarioTest): +class StaticwebappDbConnectionScenarioTest(ScenarioTest): + @ResourceGroupPreparer(name_prefix='cli_test') + def test_staticwebapp_dbconnection_azure_sql(self, resource_group): + name = self.create_random_name("cli_test", length=20) + server = self.create_random_name("cli-test", length=20) + username = "aturing" + password = "thisisapassword123!" + location = "West US" + db_name = "tables" + + self.cmd(f"staticwebapp create -n {name} -g {resource_group}") + server_id = self.cmd(f"sql server create -l '{location}' -g {resource_group} -n {server} -u {username} -p {password}").get_output_in_json()["id"] + self.cmd(f"sql db create -g {resource_group} -n {db_name} -s {server}") + + self.cmd(f"staticwebapp dbconnection create -n {name} -g {resource_group} -u {username} -p {password} -d {server_id} -b {db_name}", + checks=[JMESPathCheck("properties.region", location, case_sensitive=False), + JMESPathCheck("properties.resourceId", server_id)]) + + @ResourceGroupPreparer(name_prefix='cli_test', location="westus") + def test_staticwebapp_dbconnection_cosmosdb(self, resource_group): + name = self.create_random_name("cli_test", length=20) + server = self.create_random_name("cli-test", length=20) + location = "West US" + + self.cmd(f"staticwebapp create -n {name} -g {resource_group}") + server_id = self.cmd(f"cosmosdb create -n {server} -g {resource_group}").get_output_in_json()["id"] + + self.cmd(f"staticwebapp dbconnection create -n {name} -g {resource_group} -d {server_id}", + checks=[JMESPathCheck("properties.region", location, case_sensitive=False), + JMESPathCheck("properties.resourceId", server_id)]) + + def _get_mock_cmd(self): + from azure.cli.core.mock import DummyCli + from azure.cli.core import AzCommandsLoader + from azure.cli.core.commands import AzCliCommand + from azext_staticwebapp import StaticwebappCommandsLoader + cli_ctx = DummyCli() + + loader = StaticwebappCommandsLoader(cli_ctx) + cmd = AzCliCommand(loader, 'test', None) + cmd.cli_ctx = cli_ctx + return cmd + + @ResourceGroupPreparer(name_prefix='cli_test') + def test_staticwebapp_dbconnection_mysql_flex(self, resource_group): + name = self.create_random_name("cli_test", length=20) + server = self.create_random_name("cli-test", length=20) + username = "aturing" + password = "thisisapassword123!" + location = "East US" + db_name = "tables" + + self.cmd(f"staticwebapp create -n {name} -g {resource_group}") + # Creating flexible servers takes too long and the polling messes with test recordings + server_id = f"/subscriptions/{self.get_subscription_id()}/resourceGroups/{resource_group}/providers/Microsoft.DBforMySQL/flexibleServers/{server}" + + mock_get_location = lambda *args, **kwargs: location + handler = MySqlFlexHandler() + handler.get_location = mock_get_location + + with mock.patch('azext_staticwebapp.custom.get_database_type', return_value=handler): + conn = create_dbconnection(self._get_mock_cmd(), resource_group, name, server_id, db_name, username=username, password=password, environment="default") + self.assertEqual(conn["properties"]["region"], location) + self.assertEqual(conn["properties"]["resourceId"], server_id) + + @ResourceGroupPreparer(name_prefix='cli_test') + def test_staticwebapp_dbconnection_pgsql_single(self, resource_group): + name = self.create_random_name("cli_test", length=20) + server = self.create_random_name("cli-test", length=20) + username = "aturing" + password = "thisisapassword123!" + location = "West US" + db_name = "tables" + + self.cmd(f"staticwebapp create -n {name} -g {resource_group}") + server_id = self.cmd(f"postgres server create -l '{location}' -g {resource_group} -n {server} -u {username} -p {password}").get_output_in_json()["id"] + self.cmd(f"postgres db create -g {resource_group} -n {db_name} -s {server}") + + self.cmd(f"staticwebapp dbconnection create -n {name} -g {resource_group} -u {username} -p {password} -d {server_id} -b {db_name}", + checks=[JMESPathCheck("properties.region", location, case_sensitive=False), + JMESPathCheck("properties.resourceId", server_id)]) + + @ResourceGroupPreparer(name_prefix='cli_test') + def test_staticwebapp_dbconnection_pgsql_flex(self, resource_group): + name = self.create_random_name("cli_test", length=20) + server = self.create_random_name("cli-test", length=20) + username = "aturing" + password = "thisisapassword123!" + location = "East US" + db_name = "tables" + + self.cmd(f"staticwebapp create -n {name} -g {resource_group}") + # Creating flexible servers takes too long and the polling messes with test recordings + server_id = f"/subscriptions/{self.get_subscription_id()}/resourceGroups/{resource_group}/providers/Microsoft.DBforMySQL/flexibleServers/{server}" + + mock_get_location = lambda *args, **kwargs: location + handler = PgSqlFlexHandler() + handler.get_location = mock_get_location - # TODO - @ResourceGroupPreparer(name_prefix='cli_test_staticwebapp') - def test_staticwebapp(self, resource_group): - pass \ No newline at end of file + with mock.patch('azext_staticwebapp.custom.get_database_type', return_value=handler): + conn = create_dbconnection(self._get_mock_cmd(), resource_group, name, server_id, db_name, username=username, password=password, environment="default") + self.assertEqual(conn["properties"]["region"], location) + self.assertEqual(conn["properties"]["resourceId"], server_id) From 72432175f8884396e71de84c04683029de2c21ec Mon Sep 17 00:00:00 2001 From: Silas Strawn Date: Mon, 19 Dec 2022 10:10:28 -0600 Subject: [PATCH 14/27] fix --- src/staticwebapp/azext_staticwebapp/_clients.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/staticwebapp/azext_staticwebapp/_clients.py b/src/staticwebapp/azext_staticwebapp/_clients.py index 6cd93337e3c..f2985fbeeed 100644 --- a/src/staticwebapp/azext_staticwebapp/_clients.py +++ b/src/staticwebapp/azext_staticwebapp/_clients.py @@ -38,7 +38,6 @@ def create_or_update(cls, cmd, resource_group_name, name, environment, connectio sub_id, resource_group_name, name, - environment, connection_name, api_version) From bfc0d43a872775329b2007a99766b264456850fa Mon Sep 17 00:00:00 2001 From: Silas Strawn Date: Tue, 24 Jan 2023 14:27:38 -0800 Subject: [PATCH 15/27] mark command group as preview --- src/staticwebapp/azext_staticwebapp/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/staticwebapp/azext_staticwebapp/commands.py b/src/staticwebapp/azext_staticwebapp/commands.py index 0cbd6831754..9ef906dbed5 100644 --- a/src/staticwebapp/azext_staticwebapp/commands.py +++ b/src/staticwebapp/azext_staticwebapp/commands.py @@ -5,7 +5,7 @@ def load_command_table(self, _): - with self.command_group('staticwebapp dbconnection') as g: + with self.command_group('staticwebapp dbconnection', is_preview=True) as g: g.custom_command('create', 'create_dbconnection') g.custom_command('show', 'show_dbconnection') g.custom_command('delete', 'delete_dbconnection') From 07f6f2133332816d7771df412a29945a92c8735b Mon Sep 17 00:00:00 2001 From: Silas Strawn Date: Mon, 30 Jan 2023 15:23:55 -0800 Subject: [PATCH 16/27] change logic for SWA builds --- src/staticwebapp/azext_staticwebapp/custom.py | 2 +- ...t_staticwebapp_dbconnection_azure_sql.yaml | 303 ++++++------------ ...st_staticwebapp_dbconnection_cosmosdb.yaml | 122 +++---- ...taticwebapp_dbconnection_pgsql_single.yaml | 131 ++++---- 4 files changed, 234 insertions(+), 324 deletions(-) diff --git a/src/staticwebapp/azext_staticwebapp/custom.py b/src/staticwebapp/azext_staticwebapp/custom.py index 73c1ba8fa4f..38d45d0cefc 100644 --- a/src/staticwebapp/azext_staticwebapp/custom.py +++ b/src/staticwebapp/azext_staticwebapp/custom.py @@ -54,5 +54,5 @@ def show_dbconnection(cmd, resource_group_name, name, environment=None, detailed return DbConnectionClient.list(cmd, resource_group_name, name, environment, detailed=detailed) -def delete_dbconnection(cmd, resource_group_name, name, environment): +def delete_dbconnection(cmd, resource_group_name, name, environment=None): return DbConnectionClient.delete(cmd, resource_group_name, name, environment) diff --git a/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_azure_sql.yaml b/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_azure_sql.yaml index e9998f7a3ab..a3968d7e73f 100644 --- a/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_azure_sql.yaml +++ b/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_azure_sql.yaml @@ -13,7 +13,7 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 response: @@ -29,7 +29,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:39:30 GMT + - Mon, 30 Jan 2023 23:15:13 GMT expires: - '-1' pragma: @@ -62,22 +62,22 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central - US","properties":{"defaultHostname":"kind-ocean-08d84ec10.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":null,"privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + US","properties":{"defaultHostname":"red-desert-04090d810.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":"20.98.190.171","privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' headers: cache-control: - no-cache content-length: - - '808' + - '819' content-type: - application/json date: - - Thu, 15 Dec 2022 18:39:31 GMT + - Mon, 30 Jan 2023 23:15:16 GMT expires: - '-1' pragma: @@ -95,7 +95,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' x-powered-by: - ASP.NET status: @@ -115,22 +115,22 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central - US","properties":{"defaultHostname":"kind-ocean-08d84ec10.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":null,"privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + US","properties":{"defaultHostname":"red-desert-04090d810.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":"20.98.190.171","privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' headers: cache-control: - no-cache content-length: - - '808' + - '819' content-type: - application/json date: - - Thu, 15 Dec 2022 18:39:32 GMT + - Mon, 30 Jan 2023 23:15:16 GMT expires: - '-1' pragma: @@ -166,7 +166,7 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/locations?api-version=2019-11-01 response: @@ -210,7 +210,7 @@ interactions: Paulo State\",\"pairedRegion\":[{\"name\":\"southcentralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2euap\",\"name\":\"eastus2euap\",\"displayName\":\"East US 2 EUAP\",\"regionalDisplayName\":\"(US) East US 2 EUAP\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-78.3889\",\"latitude\":\"36.6681\",\"pairedRegion\":[{\"name\":\"centraluseuap\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centraluseuap\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/qatarcentral\",\"name\":\"qatarcentral\",\"displayName\":\"Qatar Central\",\"regionalDisplayName\":\"(Middle East) Qatar Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Middle - East\",\"longitude\":\"51.439327\",\"latitude\":\"25.551462\",\"physicalLocation\":\"Doha\",\"pairedRegion\":[{\"name\":\"westeurope\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westeurope\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralusstage\",\"name\":\"centralusstage\",\"displayName\":\"Central + East\",\"longitude\":\"51.439327\",\"latitude\":\"25.551462\",\"physicalLocation\":\"Doha\",\"pairedRegion\":[]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralusstage\",\"name\":\"centralusstage\",\"displayName\":\"Central US (Stage)\",\"regionalDisplayName\":\"(US) Central US (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastusstage\",\"name\":\"eastusstage\",\"displayName\":\"East US (Stage)\",\"regionalDisplayName\":\"(US) East US (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2stage\",\"name\":\"eastus2stage\",\"displayName\":\"East US 2 (Stage)\",\"regionalDisplayName\":\"(US) East US 2 (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northcentralusstage\",\"name\":\"northcentralusstage\",\"displayName\":\"North @@ -228,7 +228,8 @@ interactions: Pacific\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southeastasiastage\",\"name\":\"southeastasiastage\",\"displayName\":\"Southeast Asia (Stage)\",\"regionalDisplayName\":\"(Asia Pacific) Southeast Asia (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia Pacific\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastusstg\",\"name\":\"eastusstg\",\"displayName\":\"East - US STG\",\"regionalDisplayName\":\"(US) East US STG\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-79.8164\",\"latitude\":\"37.3719\",\"physicalLocation\":\"Virginia\",\"pairedRegion\":[{\"name\":\"southcentralusstg\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralusstg\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northcentralus\",\"name\":\"northcentralus\",\"displayName\":\"North + US STG\",\"regionalDisplayName\":\"(US) East US STG\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-79.8164\",\"latitude\":\"37.3719\",\"physicalLocation\":\"Virginia\",\"pairedRegion\":[{\"name\":\"southcentralusstg\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralusstg\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralusstg\",\"name\":\"southcentralusstg\",\"displayName\":\"South + Central US STG\",\"regionalDisplayName\":\"(US) South Central US STG\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-98.5\",\"latitude\":\"29.4167\",\"physicalLocation\":\"Texas\",\"pairedRegion\":[{\"name\":\"eastusstg\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastusstg\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northcentralus\",\"name\":\"northcentralus\",\"displayName\":\"North Central US\",\"regionalDisplayName\":\"(US) North Central US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-87.6278\",\"latitude\":\"41.8819\",\"physicalLocation\":\"Illinois\",\"pairedRegion\":[{\"name\":\"southcentralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus\",\"name\":\"westus\",\"displayName\":\"West US\",\"regionalDisplayName\":\"(US) West US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-122.417\",\"latitude\":\"37.783\",\"physicalLocation\":\"California\",\"pairedRegion\":[{\"name\":\"eastus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/jioindiawest\",\"name\":\"jioindiawest\",\"displayName\":\"Jio India West\",\"regionalDisplayName\":\"(Asia Pacific) Jio India West\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia @@ -268,11 +269,11 @@ interactions: cache-control: - no-cache content-length: - - '29930' + - '30301' content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:39:41 GMT + - Mon, 30 Jan 2023 23:15:18 GMT expires: - '-1' pragma: @@ -305,27 +306,27 @@ interactions: ParameterSetName: - -l -g -n -u -p User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003?api-version=2021-02-01-preview response: body: - string: '{"operation":"UpsertLogicalServer","startTime":"2022-12-15T18:39:41.81Z"}' + string: '{"operation":"UpsertLogicalServer","startTime":"2023-01-30T23:15:20.787Z"}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/9493c9eb-c79e-487e-bec4-ce68b835d485?api-version=2021-02-01-preview + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/400f42d7-444e-4a9b-892b-80f2a12c74b0?api-version=2021-02-01-preview cache-control: - no-cache content-length: - - '73' + - '74' content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:39:41 GMT + - Mon, 30 Jan 2023 23:15:20 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverOperationResults/9493c9eb-c79e-487e-bec4-ce68b835d485?api-version=2021-02-01-preview + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverOperationResults/400f42d7-444e-4a9b-892b-80f2a12c74b0?api-version=2021-02-01-preview pragma: - no-cache server: @@ -353,67 +354,21 @@ interactions: ParameterSetName: - -l -g -n -u -p User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/9493c9eb-c79e-487e-bec4-ce68b835d485?api-version=2021-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/400f42d7-444e-4a9b-892b-80f2a12c74b0?api-version=2021-02-01-preview response: body: - string: '{"name":"9493c9eb-c79e-487e-bec4-ce68b835d485","status":"InProgress","startTime":"2022-12-15T18:39:41.81Z"}' + string: '{"name":"400f42d7-444e-4a9b-892b-80f2a12c74b0","status":"InProgress","startTime":"2023-01-30T23:15:20.787Z"}' headers: cache-control: - no-cache content-length: - - '107' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 15 Dec 2022 18:39:42 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - sql server create - Connection: - - keep-alive - ParameterSetName: - - -l -g -n -u -p - User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/9493c9eb-c79e-487e-bec4-ce68b835d485?api-version=2021-02-01-preview - response: - body: - string: '{"name":"9493c9eb-c79e-487e-bec4-ce68b835d485","status":"InProgress","startTime":"2022-12-15T18:39:41.81Z"}' - headers: - cache-control: - - no-cache - content-length: - - '107' + - '108' content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:39:43 GMT + - Mon, 30 Jan 2023 23:15:21 GMT expires: - '-1' pragma: @@ -445,21 +400,21 @@ interactions: ParameterSetName: - -l -g -n -u -p User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/9493c9eb-c79e-487e-bec4-ce68b835d485?api-version=2021-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/400f42d7-444e-4a9b-892b-80f2a12c74b0?api-version=2021-02-01-preview response: body: - string: '{"name":"9493c9eb-c79e-487e-bec4-ce68b835d485","status":"InProgress","startTime":"2022-12-15T18:39:41.81Z"}' + string: '{"name":"400f42d7-444e-4a9b-892b-80f2a12c74b0","status":"InProgress","startTime":"2023-01-30T23:15:20.787Z"}' headers: cache-control: - no-cache content-length: - - '107' + - '108' content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:39:44 GMT + - Mon, 30 Jan 2023 23:15:22 GMT expires: - '-1' pragma: @@ -491,21 +446,21 @@ interactions: ParameterSetName: - -l -g -n -u -p User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/9493c9eb-c79e-487e-bec4-ce68b835d485?api-version=2021-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/400f42d7-444e-4a9b-892b-80f2a12c74b0?api-version=2021-02-01-preview response: body: - string: '{"name":"9493c9eb-c79e-487e-bec4-ce68b835d485","status":"InProgress","startTime":"2022-12-15T18:39:41.81Z"}' + string: '{"name":"400f42d7-444e-4a9b-892b-80f2a12c74b0","status":"InProgress","startTime":"2023-01-30T23:15:20.787Z"}' headers: cache-control: - no-cache content-length: - - '107' + - '108' content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:39:45 GMT + - Mon, 30 Jan 2023 23:15:23 GMT expires: - '-1' pragma: @@ -537,21 +492,21 @@ interactions: ParameterSetName: - -l -g -n -u -p User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/9493c9eb-c79e-487e-bec4-ce68b835d485?api-version=2021-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/400f42d7-444e-4a9b-892b-80f2a12c74b0?api-version=2021-02-01-preview response: body: - string: '{"name":"9493c9eb-c79e-487e-bec4-ce68b835d485","status":"InProgress","startTime":"2022-12-15T18:39:41.81Z"}' + string: '{"name":"400f42d7-444e-4a9b-892b-80f2a12c74b0","status":"InProgress","startTime":"2023-01-30T23:15:20.787Z"}' headers: cache-control: - no-cache content-length: - - '107' + - '108' content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:39:46 GMT + - Mon, 30 Jan 2023 23:15:25 GMT expires: - '-1' pragma: @@ -583,21 +538,21 @@ interactions: ParameterSetName: - -l -g -n -u -p User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/9493c9eb-c79e-487e-bec4-ce68b835d485?api-version=2021-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/400f42d7-444e-4a9b-892b-80f2a12c74b0?api-version=2021-02-01-preview response: body: - string: '{"name":"9493c9eb-c79e-487e-bec4-ce68b835d485","status":"InProgress","startTime":"2022-12-15T18:39:41.81Z"}' + string: '{"name":"400f42d7-444e-4a9b-892b-80f2a12c74b0","status":"InProgress","startTime":"2023-01-30T23:15:20.787Z"}' headers: cache-control: - no-cache content-length: - - '107' + - '108' content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:40:06 GMT + - Mon, 30 Jan 2023 23:15:26 GMT expires: - '-1' pragma: @@ -629,21 +584,21 @@ interactions: ParameterSetName: - -l -g -n -u -p User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/9493c9eb-c79e-487e-bec4-ce68b835d485?api-version=2021-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/400f42d7-444e-4a9b-892b-80f2a12c74b0?api-version=2021-02-01-preview response: body: - string: '{"name":"9493c9eb-c79e-487e-bec4-ce68b835d485","status":"InProgress","startTime":"2022-12-15T18:39:41.81Z"}' + string: '{"name":"400f42d7-444e-4a9b-892b-80f2a12c74b0","status":"InProgress","startTime":"2023-01-30T23:15:20.787Z"}' headers: cache-control: - no-cache content-length: - - '107' + - '108' content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:40:26 GMT + - Mon, 30 Jan 2023 23:15:46 GMT expires: - '-1' pragma: @@ -675,12 +630,12 @@ interactions: ParameterSetName: - -l -g -n -u -p User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/9493c9eb-c79e-487e-bec4-ce68b835d485?api-version=2021-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/400f42d7-444e-4a9b-892b-80f2a12c74b0?api-version=2021-02-01-preview response: body: - string: '{"name":"9493c9eb-c79e-487e-bec4-ce68b835d485","status":"InProgress","startTime":"2022-12-15T18:39:41.81Z"}' + string: '{"name":"400f42d7-444e-4a9b-892b-80f2a12c74b0","status":"Succeeded","startTime":"2023-01-30T23:15:20.787Z"}' headers: cache-control: - no-cache @@ -689,53 +644,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:40:46 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - sql server create - Connection: - - keep-alive - ParameterSetName: - - -l -g -n -u -p - User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/9493c9eb-c79e-487e-bec4-ce68b835d485?api-version=2021-02-01-preview - response: - body: - string: '{"name":"9493c9eb-c79e-487e-bec4-ce68b835d485","status":"Succeeded","startTime":"2022-12-15T18:39:41.81Z"}' - headers: - cache-control: - - no-cache - content-length: - - '106' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 15 Dec 2022 18:41:01 GMT + - Mon, 30 Jan 2023 23:16:07 GMT expires: - '-1' pragma: @@ -767,7 +676,7 @@ interactions: ParameterSetName: - -l -g -n -u -p User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003?api-version=2021-02-01-preview response: @@ -781,7 +690,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:41:01 GMT + - Mon, 30 Jan 2023 23:16:07 GMT expires: - '-1' pragma: @@ -813,7 +722,7 @@ interactions: ParameterSetName: - -g -n -s User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003?api-version=2021-02-01-preview response: @@ -827,7 +736,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:41:03 GMT + - Mon, 30 Jan 2023 23:16:08 GMT expires: - '-1' pragma: @@ -859,7 +768,7 @@ interactions: ParameterSetName: - -g -n -s User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003?api-version=2021-02-01-preview response: @@ -873,7 +782,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:41:02 GMT + - Mon, 30 Jan 2023 23:16:09 GMT expires: - '-1' pragma: @@ -909,27 +818,27 @@ interactions: ParameterSetName: - -g -n -s User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003/databases/tables?api-version=2022-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003/databases/tables?api-version=2022-05-01-preview response: body: - string: '{"operation":"CreateLogicalDatabase","startTime":"2022-12-15T18:41:04.207Z"}' + string: '{"operation":"CreateLogicalDatabase","startTime":"2023-01-30T23:16:10.16Z"}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseAzureAsyncOperation/9f5fa24f-067d-4434-8189-e287c30f7c20?api-version=2022-02-01-preview + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseAzureAsyncOperation/d64e242f-24ec-4627-9c34-b82e2e6d4ffa?api-version=2022-05-01-preview cache-control: - no-cache content-length: - - '76' + - '75' content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:41:04 GMT + - Mon, 30 Jan 2023 23:16:10 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseOperationResults/9f5fa24f-067d-4434-8189-e287c30f7c20?api-version=2022-02-01-preview + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseOperationResults/d64e242f-24ec-4627-9c34-b82e2e6d4ffa?api-version=2022-05-01-preview pragma: - no-cache server: @@ -957,21 +866,21 @@ interactions: ParameterSetName: - -g -n -s User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseAzureAsyncOperation/9f5fa24f-067d-4434-8189-e287c30f7c20?api-version=2022-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseAzureAsyncOperation/d64e242f-24ec-4627-9c34-b82e2e6d4ffa?api-version=2022-05-01-preview response: body: - string: '{"name":"9f5fa24f-067d-4434-8189-e287c30f7c20","status":"InProgress","startTime":"2022-12-15T18:41:04.207Z"}' + string: '{"name":"d64e242f-24ec-4627-9c34-b82e2e6d4ffa","status":"InProgress","startTime":"2023-01-30T23:16:10.16Z"}' headers: cache-control: - no-cache content-length: - - '108' + - '107' content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:41:19 GMT + - Mon, 30 Jan 2023 23:16:25 GMT expires: - '-1' pragma: @@ -1003,21 +912,21 @@ interactions: ParameterSetName: - -g -n -s User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseAzureAsyncOperation/9f5fa24f-067d-4434-8189-e287c30f7c20?api-version=2022-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseAzureAsyncOperation/d64e242f-24ec-4627-9c34-b82e2e6d4ffa?api-version=2022-05-01-preview response: body: - string: '{"name":"9f5fa24f-067d-4434-8189-e287c30f7c20","status":"InProgress","startTime":"2022-12-15T18:41:04.207Z"}' + string: '{"name":"d64e242f-24ec-4627-9c34-b82e2e6d4ffa","status":"InProgress","startTime":"2023-01-30T23:16:10.16Z"}' headers: cache-control: - no-cache content-length: - - '108' + - '107' content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:41:34 GMT + - Mon, 30 Jan 2023 23:16:40 GMT expires: - '-1' pragma: @@ -1049,21 +958,21 @@ interactions: ParameterSetName: - -g -n -s User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseAzureAsyncOperation/9f5fa24f-067d-4434-8189-e287c30f7c20?api-version=2022-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseAzureAsyncOperation/d64e242f-24ec-4627-9c34-b82e2e6d4ffa?api-version=2022-05-01-preview response: body: - string: '{"name":"9f5fa24f-067d-4434-8189-e287c30f7c20","status":"InProgress","startTime":"2022-12-15T18:41:04.207Z"}' + string: '{"name":"d64e242f-24ec-4627-9c34-b82e2e6d4ffa","status":"InProgress","startTime":"2023-01-30T23:16:10.16Z"}' headers: cache-control: - no-cache content-length: - - '108' + - '107' content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:41:49 GMT + - Mon, 30 Jan 2023 23:16:55 GMT expires: - '-1' pragma: @@ -1095,21 +1004,21 @@ interactions: ParameterSetName: - -g -n -s User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseAzureAsyncOperation/9f5fa24f-067d-4434-8189-e287c30f7c20?api-version=2022-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseAzureAsyncOperation/d64e242f-24ec-4627-9c34-b82e2e6d4ffa?api-version=2022-05-01-preview response: body: - string: '{"name":"9f5fa24f-067d-4434-8189-e287c30f7c20","status":"Succeeded","startTime":"2022-12-15T18:41:04.207Z"}' + string: '{"name":"d64e242f-24ec-4627-9c34-b82e2e6d4ffa","status":"Succeeded","startTime":"2023-01-30T23:16:10.16Z"}' headers: cache-control: - no-cache content-length: - - '107' + - '106' content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:42:04 GMT + - Mon, 30 Jan 2023 23:17:10 GMT expires: - '-1' pragma: @@ -1141,21 +1050,21 @@ interactions: ParameterSetName: - -g -n -s User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-sql/4.0.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003/databases/tables?api-version=2022-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003/databases/tables?api-version=2022-05-01-preview response: body: - string: '{"sku":{"name":"GP_Gen5","tier":"GeneralPurpose","family":"Gen5","capacity":2},"kind":"v12.0,user,vcore","properties":{"collation":"SQL_Latin1_General_CP1_CI_AS","maxSizeBytes":34359738368,"status":"Online","databaseId":"ac50c269-abdf-4a18-b4b2-316775a3db36","creationDate":"2022-12-15T18:41:55.91Z","currentServiceObjectiveName":"GP_Gen5_2","requestedServiceObjectiveName":"GP_Gen5_2","defaultSecondaryLocation":"eastus","catalogCollation":"SQL_Latin1_General_CP1_CI_AS","zoneRedundant":false,"licenseType":"LicenseIncluded","maxLogSizeBytes":193273528320,"readScale":"Disabled","currentSku":{"name":"GP_Gen5","tier":"GeneralPurpose","family":"Gen5","capacity":2},"currentBackupStorageRedundancy":"Geo","requestedBackupStorageRedundancy":"Geo","maintenanceConfigurationId":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default","isLedgerOn":false,"isInfraEncryptionEnabled":false},"location":"westus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003/databases/tables","name":"tables","type":"Microsoft.Sql/servers/databases"}' + string: '{"sku":{"name":"GP_Gen5","tier":"GeneralPurpose","family":"Gen5","capacity":2},"kind":"v12.0,user,vcore","properties":{"collation":"SQL_Latin1_General_CP1_CI_AS","maxSizeBytes":34359738368,"status":"Online","databaseId":"37cc4410-5db8-43b7-bffa-72c0e674ce4f","creationDate":"2023-01-30T23:16:54.863Z","currentServiceObjectiveName":"GP_Gen5_2","requestedServiceObjectiveName":"GP_Gen5_2","defaultSecondaryLocation":"eastus","catalogCollation":"SQL_Latin1_General_CP1_CI_AS","zoneRedundant":false,"licenseType":"LicenseIncluded","maxLogSizeBytes":193273528320,"readScale":"Disabled","currentSku":{"name":"GP_Gen5","tier":"GeneralPurpose","family":"Gen5","capacity":2},"currentBackupStorageRedundancy":"Geo","requestedBackupStorageRedundancy":"Geo","maintenanceConfigurationId":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default","isLedgerOn":false,"isInfraEncryptionEnabled":false},"location":"westus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003/databases/tables","name":"tables","type":"Microsoft.Sql/servers/databases"}' headers: cache-control: - no-cache content-length: - - '1187' + - '1188' content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:42:04 GMT + - Mon, 30 Jan 2023 23:17:11 GMT expires: - '-1' pragma: @@ -1187,22 +1096,22 @@ interactions: ParameterSetName: - -n -g -u -p -d -b User-Agent: - - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central - US","properties":{"defaultHostname":"kind-ocean-08d84ec10.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":null,"privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + US","properties":{"defaultHostname":"red-desert-04090d810.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":"20.98.190.171","privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' headers: cache-control: - no-cache content-length: - - '808' + - '819' content-type: - application/json date: - - Thu, 15 Dec 2022 18:42:05 GMT + - Mon, 30 Jan 2023 23:17:12 GMT expires: - '-1' pragma: @@ -1238,7 +1147,7 @@ interactions: ParameterSetName: - -n -g -u -p -d -b User-Agent: - - python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) AZURECLI/2.43.0 + - python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) AZURECLI/2.44.1 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003?api-version=2021-11-01 response: @@ -1252,7 +1161,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:42:05 GMT + - Mon, 30 Jan 2023 23:17:13 GMT expires: - '-1' pragma: @@ -1290,23 +1199,23 @@ interactions: ParameterSetName: - -n -g -u -p -d -b User-Agent: - - python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) AZURECLI/2.43.0 + - python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) AZURECLI/2.44.1 method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticsites/cli_test000002/builds/default/databaseConnections/default?api-version=2022-03-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticsites/cli_test000002/databaseConnections/default?api-version=2022-03-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002/builds/default/databaseConnections/default","name":"default","type":"Microsoft.Web/staticSites/builds/databaseConnections","location":"Central + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002/databaseConnections/default","name":"default","type":"Microsoft.Web/staticSites/databaseConnections","location":"Central US","properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003","region":"West US"}}' headers: cache-control: - no-cache content-length: - - '465' + - '443' content-type: - application/json date: - - Thu, 15 Dec 2022 18:42:07 GMT + - Mon, 30 Jan 2023 23:17:15 GMT expires: - '-1' pragma: diff --git a/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_cosmosdb.yaml b/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_cosmosdb.yaml index 265782047b4..217989da106 100644 --- a/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_cosmosdb.yaml +++ b/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_cosmosdb.yaml @@ -13,7 +13,7 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 response: @@ -29,7 +29,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:48:05 GMT + - Mon, 30 Jan 2023 23:15:13 GMT expires: - '-1' pragma: @@ -62,22 +62,22 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central - US","properties":{"defaultHostname":"victorious-pond-031d08210.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":null,"privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + US","properties":{"defaultHostname":"kind-tree-0d7dc9c10.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":"20.84.233.22","privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' headers: cache-control: - no-cache content-length: - - '813' + - '817' content-type: - application/json date: - - Thu, 15 Dec 2022 18:48:06 GMT + - Mon, 30 Jan 2023 23:15:16 GMT expires: - '-1' pragma: @@ -115,22 +115,22 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central - US","properties":{"defaultHostname":"victorious-pond-031d08210.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":null,"privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + US","properties":{"defaultHostname":"kind-tree-0d7dc9c10.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":"20.84.233.22","privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' headers: cache-control: - no-cache content-length: - - '813' + - '817' content-type: - application/json date: - - Thu, 15 Dec 2022 18:48:07 GMT + - Mon, 30 Jan 2023 23:15:16 GMT expires: - '-1' pragma: @@ -166,12 +166,12 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001","name":"cli_test000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2022-12-15T18:48:02Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001","name":"cli_test000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2023-01-30T23:15:08Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -180,7 +180,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:48:08 GMT + - Mon, 30 Jan 2023 23:15:17 GMT expires: - '-1' pragma: @@ -214,20 +214,20 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003?api-version=2022-08-15 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003","name":"cli-test000003","location":"West - US","type":"Microsoft.DocumentDB/databaseAccounts","kind":"GlobalDocumentDB","tags":{},"systemData":{"createdAt":"2022-12-15T18:48:12.2120681Z"},"properties":{"provisioningState":"Creating","publicNetworkAccess":"Enabled","enableAutomaticFailover":false,"enableMultipleWriteLocations":false,"enablePartitionKeyMonitor":false,"isVirtualNetworkFilterEnabled":false,"virtualNetworkRules":[],"EnabledApiTypes":"Sql","disableKeyBasedMetadataWriteAccess":false,"enableFreeTier":false,"enableAnalyticalStorage":false,"analyticalStorageConfiguration":{"schemaType":"WellDefined"},"instanceId":"ebe10200-ddcb-4057-9646-4a05732031bb","databaseAccountOfferType":"Standard","defaultIdentity":"","networkAclBypass":"None","disableLocalAuth":false,"enablePartitionMerge":false,"consistencyPolicy":{"defaultConsistencyLevel":"Session","maxIntervalInSeconds":5,"maxStalenessPrefix":100},"configurationOverrides":{},"writeLocations":[{"id":"cli-test000003-westus","locationName":"West + US","type":"Microsoft.DocumentDB/databaseAccounts","kind":"GlobalDocumentDB","tags":{},"systemData":{"createdAt":"2023-01-30T23:15:22.6963118Z"},"properties":{"provisioningState":"Creating","publicNetworkAccess":"Enabled","enableAutomaticFailover":false,"enableMultipleWriteLocations":false,"enablePartitionKeyMonitor":false,"isVirtualNetworkFilterEnabled":false,"virtualNetworkRules":[],"EnabledApiTypes":"Sql","disableKeyBasedMetadataWriteAccess":false,"enableFreeTier":false,"enableAnalyticalStorage":false,"analyticalStorageConfiguration":{"schemaType":"WellDefined"},"instanceId":"5628dcd8-b098-4b95-b5d1-c5f55e061d78","databaseAccountOfferType":"Standard","defaultIdentity":"","networkAclBypass":"None","disableLocalAuth":false,"enablePartitionMerge":false,"consistencyPolicy":{"defaultConsistencyLevel":"Session","maxIntervalInSeconds":5,"maxStalenessPrefix":100},"configurationOverrides":{},"writeLocations":[{"id":"cli-test000003-westus","locationName":"West US","provisioningState":"Creating","failoverPriority":0,"isZoneRedundant":false}],"readLocations":[{"id":"cli-test000003-westus","locationName":"West US","provisioningState":"Creating","failoverPriority":0,"isZoneRedundant":false}],"locations":[{"id":"cli-test000003-westus","locationName":"West US","provisioningState":"Creating","failoverPriority":0,"isZoneRedundant":false}],"failoverPolicies":[{"id":"cli-test000003-westus","locationName":"West - US","failoverPriority":0}],"cors":[],"capabilities":[],"ipRules":[],"backupPolicy":{"type":"Periodic","periodicModeProperties":{"backupIntervalInMinutes":240,"backupRetentionIntervalInHours":8,"backupStorageRedundancy":"Invalid"}},"networkAclBypassResourceIds":[],"keysMetadata":{"primaryMasterKey":{"generationTime":"2022-12-15T18:48:12.2120681Z"},"secondaryMasterKey":{"generationTime":"2022-12-15T18:48:12.2120681Z"},"primaryReadonlyMasterKey":{"generationTime":"2022-12-15T18:48:12.2120681Z"},"secondaryReadonlyMasterKey":{"generationTime":"2022-12-15T18:48:12.2120681Z"}}},"identity":{"type":"None"}}' + US","failoverPriority":0}],"cors":[],"capabilities":[],"ipRules":[],"backupPolicy":{"type":"Periodic","periodicModeProperties":{"backupIntervalInMinutes":240,"backupRetentionIntervalInHours":8,"backupStorageRedundancy":"Invalid"}},"networkAclBypassResourceIds":[],"keysMetadata":{"primaryMasterKey":{"generationTime":"2023-01-30T23:15:22.6963118Z"},"secondaryMasterKey":{"generationTime":"2023-01-30T23:15:22.6963118Z"},"primaryReadonlyMasterKey":{"generationTime":"2023-01-30T23:15:22.6963118Z"},"secondaryReadonlyMasterKey":{"generationTime":"2023-01-30T23:15:22.6963118Z"}}},"identity":{"type":"None"}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westus/operationsStatus/0428e158-d447-4e35-96e6-0a184f26d47b?api-version=2022-08-15 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westus/operationsStatus/611ff26c-a0b6-40f3-8d18-cfb3e2119754?api-version=2022-08-15 cache-control: - no-store, no-cache content-length: @@ -235,9 +235,9 @@ interactions: content-type: - application/json date: - - Thu, 15 Dec 2022 18:48:14 GMT + - Mon, 30 Jan 2023 23:15:24 GMT location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003/operationResults/0428e158-d447-4e35-96e6-0a184f26d47b?api-version=2022-08-15 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003/operationResults/611ff26c-a0b6-40f3-8d18-cfb3e2119754?api-version=2022-08-15 pragma: - no-cache server: @@ -271,9 +271,9 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westus/operationsStatus/0428e158-d447-4e35-96e6-0a184f26d47b?api-version=2022-08-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westus/operationsStatus/611ff26c-a0b6-40f3-8d18-cfb3e2119754?api-version=2022-08-15 response: body: string: '{"status":"Dequeued"}' @@ -285,7 +285,7 @@ interactions: content-type: - application/json date: - - Thu, 15 Dec 2022 18:48:44 GMT + - Mon, 30 Jan 2023 23:15:55 GMT pragma: - no-cache server: @@ -317,9 +317,9 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westus/operationsStatus/0428e158-d447-4e35-96e6-0a184f26d47b?api-version=2022-08-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westus/operationsStatus/611ff26c-a0b6-40f3-8d18-cfb3e2119754?api-version=2022-08-15 response: body: string: '{"status":"Dequeued"}' @@ -331,7 +331,7 @@ interactions: content-type: - application/json date: - - Thu, 15 Dec 2022 18:49:13 GMT + - Mon, 30 Jan 2023 23:16:25 GMT pragma: - no-cache server: @@ -363,9 +363,9 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westus/operationsStatus/0428e158-d447-4e35-96e6-0a184f26d47b?api-version=2022-08-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westus/operationsStatus/611ff26c-a0b6-40f3-8d18-cfb3e2119754?api-version=2022-08-15 response: body: string: '{"status":"Dequeued"}' @@ -377,7 +377,7 @@ interactions: content-type: - application/json date: - - Thu, 15 Dec 2022 18:49:43 GMT + - Mon, 30 Jan 2023 23:16:55 GMT pragma: - no-cache server: @@ -409,9 +409,9 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westus/operationsStatus/0428e158-d447-4e35-96e6-0a184f26d47b?api-version=2022-08-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westus/operationsStatus/611ff26c-a0b6-40f3-8d18-cfb3e2119754?api-version=2022-08-15 response: body: string: '{"status":"Succeeded"}' @@ -423,7 +423,7 @@ interactions: content-type: - application/json date: - - Thu, 15 Dec 2022 18:50:13 GMT + - Mon, 30 Jan 2023 23:17:26 GMT pragma: - no-cache server: @@ -455,26 +455,26 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003?api-version=2022-08-15 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003","name":"cli-test000003","location":"West - US","type":"Microsoft.DocumentDB/databaseAccounts","kind":"GlobalDocumentDB","tags":{},"systemData":{"createdAt":"2022-12-15T18:49:39.3573097Z"},"properties":{"provisioningState":"Succeeded","documentEndpoint":"https://cli-test000003.documents.azure.com:443/","publicNetworkAccess":"Enabled","enableAutomaticFailover":false,"enableMultipleWriteLocations":false,"enablePartitionKeyMonitor":false,"isVirtualNetworkFilterEnabled":false,"virtualNetworkRules":[],"EnabledApiTypes":"Sql","disableKeyBasedMetadataWriteAccess":false,"enableFreeTier":false,"enableAnalyticalStorage":false,"analyticalStorageConfiguration":{"schemaType":"WellDefined"},"instanceId":"ebe10200-ddcb-4057-9646-4a05732031bb","databaseAccountOfferType":"Standard","defaultIdentity":"FirstPartyIdentity","networkAclBypass":"None","disableLocalAuth":false,"enablePartitionMerge":false,"consistencyPolicy":{"defaultConsistencyLevel":"Session","maxIntervalInSeconds":5,"maxStalenessPrefix":100},"configurationOverrides":{},"writeLocations":[{"id":"cli-test000003-westus","locationName":"West + US","type":"Microsoft.DocumentDB/databaseAccounts","kind":"GlobalDocumentDB","tags":{},"systemData":{"createdAt":"2023-01-30T23:16:49.5946062Z"},"properties":{"provisioningState":"Succeeded","documentEndpoint":"https://cli-test000003.documents.azure.com:443/","sqlEndpoint":"https://cli-test000003.documents.azure.com:443/","publicNetworkAccess":"Enabled","enableAutomaticFailover":false,"enableMultipleWriteLocations":false,"enablePartitionKeyMonitor":false,"isVirtualNetworkFilterEnabled":false,"virtualNetworkRules":[],"EnabledApiTypes":"Sql","disableKeyBasedMetadataWriteAccess":false,"enableFreeTier":false,"enableAnalyticalStorage":false,"analyticalStorageConfiguration":{"schemaType":"WellDefined"},"instanceId":"5628dcd8-b098-4b95-b5d1-c5f55e061d78","databaseAccountOfferType":"Standard","defaultIdentity":"FirstPartyIdentity","networkAclBypass":"None","disableLocalAuth":false,"enablePartitionMerge":false,"consistencyPolicy":{"defaultConsistencyLevel":"Session","maxIntervalInSeconds":5,"maxStalenessPrefix":100},"configurationOverrides":{},"writeLocations":[{"id":"cli-test000003-westus","locationName":"West US","documentEndpoint":"https://cli-test000003-westus.documents.azure.com:443/","provisioningState":"Succeeded","failoverPriority":0,"isZoneRedundant":false}],"readLocations":[{"id":"cli-test000003-westus","locationName":"West US","documentEndpoint":"https://cli-test000003-westus.documents.azure.com:443/","provisioningState":"Succeeded","failoverPriority":0,"isZoneRedundant":false}],"locations":[{"id":"cli-test000003-westus","locationName":"West US","documentEndpoint":"https://cli-test000003-westus.documents.azure.com:443/","provisioningState":"Succeeded","failoverPriority":0,"isZoneRedundant":false}],"failoverPolicies":[{"id":"cli-test000003-westus","locationName":"West - US","failoverPriority":0}],"cors":[],"capabilities":[],"ipRules":[],"backupPolicy":{"type":"Periodic","periodicModeProperties":{"backupIntervalInMinutes":240,"backupRetentionIntervalInHours":8,"backupStorageRedundancy":"Geo"}},"networkAclBypassResourceIds":[],"keysMetadata":{"primaryMasterKey":{"generationTime":"2022-12-15T18:49:39.3573097Z"},"secondaryMasterKey":{"generationTime":"2022-12-15T18:49:39.3573097Z"},"primaryReadonlyMasterKey":{"generationTime":"2022-12-15T18:49:39.3573097Z"},"secondaryReadonlyMasterKey":{"generationTime":"2022-12-15T18:49:39.3573097Z"}}},"identity":{"type":"None"}}' + US","failoverPriority":0}],"cors":[],"capabilities":[],"ipRules":[],"backupPolicy":{"type":"Periodic","periodicModeProperties":{"backupIntervalInMinutes":240,"backupRetentionIntervalInHours":8,"backupStorageRedundancy":"Geo"}},"networkAclBypassResourceIds":[],"keysMetadata":{"primaryMasterKey":{"generationTime":"2023-01-30T23:16:49.5946062Z"},"secondaryMasterKey":{"generationTime":"2023-01-30T23:16:49.5946062Z"},"primaryReadonlyMasterKey":{"generationTime":"2023-01-30T23:16:49.5946062Z"},"secondaryReadonlyMasterKey":{"generationTime":"2023-01-30T23:16:49.5946062Z"}}},"identity":{"type":"None"}}' headers: cache-control: - no-store, no-cache content-length: - - '2531' + - '2595' content-type: - application/json date: - - Thu, 15 Dec 2022 18:50:13 GMT + - Mon, 30 Jan 2023 23:17:26 GMT pragma: - no-cache server: @@ -506,26 +506,26 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003?api-version=2022-08-15 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003","name":"cli-test000003","location":"West - US","type":"Microsoft.DocumentDB/databaseAccounts","kind":"GlobalDocumentDB","tags":{},"systemData":{"createdAt":"2022-12-15T18:49:39.3573097Z"},"properties":{"provisioningState":"Succeeded","documentEndpoint":"https://cli-test000003.documents.azure.com:443/","publicNetworkAccess":"Enabled","enableAutomaticFailover":false,"enableMultipleWriteLocations":false,"enablePartitionKeyMonitor":false,"isVirtualNetworkFilterEnabled":false,"virtualNetworkRules":[],"EnabledApiTypes":"Sql","disableKeyBasedMetadataWriteAccess":false,"enableFreeTier":false,"enableAnalyticalStorage":false,"analyticalStorageConfiguration":{"schemaType":"WellDefined"},"instanceId":"ebe10200-ddcb-4057-9646-4a05732031bb","databaseAccountOfferType":"Standard","defaultIdentity":"FirstPartyIdentity","networkAclBypass":"None","disableLocalAuth":false,"enablePartitionMerge":false,"consistencyPolicy":{"defaultConsistencyLevel":"Session","maxIntervalInSeconds":5,"maxStalenessPrefix":100},"configurationOverrides":{},"writeLocations":[{"id":"cli-test000003-westus","locationName":"West + US","type":"Microsoft.DocumentDB/databaseAccounts","kind":"GlobalDocumentDB","tags":{},"systemData":{"createdAt":"2023-01-30T23:16:49.5946062Z"},"properties":{"provisioningState":"Succeeded","documentEndpoint":"https://cli-test000003.documents.azure.com:443/","sqlEndpoint":"https://cli-test000003.documents.azure.com:443/","publicNetworkAccess":"Enabled","enableAutomaticFailover":false,"enableMultipleWriteLocations":false,"enablePartitionKeyMonitor":false,"isVirtualNetworkFilterEnabled":false,"virtualNetworkRules":[],"EnabledApiTypes":"Sql","disableKeyBasedMetadataWriteAccess":false,"enableFreeTier":false,"enableAnalyticalStorage":false,"analyticalStorageConfiguration":{"schemaType":"WellDefined"},"instanceId":"5628dcd8-b098-4b95-b5d1-c5f55e061d78","databaseAccountOfferType":"Standard","defaultIdentity":"FirstPartyIdentity","networkAclBypass":"None","disableLocalAuth":false,"enablePartitionMerge":false,"consistencyPolicy":{"defaultConsistencyLevel":"Session","maxIntervalInSeconds":5,"maxStalenessPrefix":100},"configurationOverrides":{},"writeLocations":[{"id":"cli-test000003-westus","locationName":"West US","documentEndpoint":"https://cli-test000003-westus.documents.azure.com:443/","provisioningState":"Succeeded","failoverPriority":0,"isZoneRedundant":false}],"readLocations":[{"id":"cli-test000003-westus","locationName":"West US","documentEndpoint":"https://cli-test000003-westus.documents.azure.com:443/","provisioningState":"Succeeded","failoverPriority":0,"isZoneRedundant":false}],"locations":[{"id":"cli-test000003-westus","locationName":"West US","documentEndpoint":"https://cli-test000003-westus.documents.azure.com:443/","provisioningState":"Succeeded","failoverPriority":0,"isZoneRedundant":false}],"failoverPolicies":[{"id":"cli-test000003-westus","locationName":"West - US","failoverPriority":0}],"cors":[],"capabilities":[],"ipRules":[],"backupPolicy":{"type":"Periodic","periodicModeProperties":{"backupIntervalInMinutes":240,"backupRetentionIntervalInHours":8,"backupStorageRedundancy":"Geo"}},"networkAclBypassResourceIds":[],"keysMetadata":{"primaryMasterKey":{"generationTime":"2022-12-15T18:49:39.3573097Z"},"secondaryMasterKey":{"generationTime":"2022-12-15T18:49:39.3573097Z"},"primaryReadonlyMasterKey":{"generationTime":"2022-12-15T18:49:39.3573097Z"},"secondaryReadonlyMasterKey":{"generationTime":"2022-12-15T18:49:39.3573097Z"}}},"identity":{"type":"None"}}' + US","failoverPriority":0}],"cors":[],"capabilities":[],"ipRules":[],"backupPolicy":{"type":"Periodic","periodicModeProperties":{"backupIntervalInMinutes":240,"backupRetentionIntervalInHours":8,"backupStorageRedundancy":"Geo"}},"networkAclBypassResourceIds":[],"keysMetadata":{"primaryMasterKey":{"generationTime":"2023-01-30T23:16:49.5946062Z"},"secondaryMasterKey":{"generationTime":"2023-01-30T23:16:49.5946062Z"},"primaryReadonlyMasterKey":{"generationTime":"2023-01-30T23:16:49.5946062Z"},"secondaryReadonlyMasterKey":{"generationTime":"2023-01-30T23:16:49.5946062Z"}}},"identity":{"type":"None"}}' headers: cache-control: - no-store, no-cache content-length: - - '2531' + - '2595' content-type: - application/json date: - - Thu, 15 Dec 2022 18:50:13 GMT + - Mon, 30 Jan 2023 23:17:26 GMT pragma: - no-cache server: @@ -557,22 +557,22 @@ interactions: ParameterSetName: - -n -g -d User-Agent: - - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central - US","properties":{"defaultHostname":"victorious-pond-031d08210.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":null,"privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + US","properties":{"defaultHostname":"kind-tree-0d7dc9c10.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":"20.84.233.22","privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' headers: cache-control: - no-cache content-length: - - '813' + - '817' content-type: - application/json date: - - Thu, 15 Dec 2022 18:50:15 GMT + - Mon, 30 Jan 2023 23:17:27 GMT expires: - '-1' pragma: @@ -608,13 +608,13 @@ interactions: ParameterSetName: - -n -g -d User-Agent: - - python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) AZURECLI/2.43.0 + - python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) AZURECLI/2.44.1 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003?api-version=2021-10-15 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003","name":"cli-test000003","location":"West - US","type":"Microsoft.DocumentDB/databaseAccounts","kind":"GlobalDocumentDB","tags":{},"systemData":{"createdAt":"2022-12-15T18:49:39.3573097Z"},"properties":{"provisioningState":"Succeeded","documentEndpoint":"https://cli-test000003.documents.azure.com:443/","publicNetworkAccess":"Enabled","enableAutomaticFailover":false,"enableMultipleWriteLocations":false,"enablePartitionKeyMonitor":false,"isVirtualNetworkFilterEnabled":false,"virtualNetworkRules":[],"EnabledApiTypes":"Sql","disableKeyBasedMetadataWriteAccess":false,"enableFreeTier":false,"enableAnalyticalStorage":false,"analyticalStorageConfiguration":{"schemaType":"WellDefined"},"instanceId":"ebe10200-ddcb-4057-9646-4a05732031bb","databaseAccountOfferType":"Standard","defaultIdentity":"FirstPartyIdentity","networkAclBypass":"None","disableLocalAuth":false,"consistencyPolicy":{"defaultConsistencyLevel":"Session","maxIntervalInSeconds":5,"maxStalenessPrefix":100},"configurationOverrides":{},"writeLocations":[{"id":"cli-test000003-westus","locationName":"West + US","type":"Microsoft.DocumentDB/databaseAccounts","kind":"GlobalDocumentDB","tags":{},"systemData":{"createdAt":"2023-01-30T23:16:49.5946062Z"},"properties":{"provisioningState":"Succeeded","documentEndpoint":"https://cli-test000003.documents.azure.com:443/","sqlEndpoint":"https://cli-test000003.documents.azure.com:443/","publicNetworkAccess":"Enabled","enableAutomaticFailover":false,"enableMultipleWriteLocations":false,"enablePartitionKeyMonitor":false,"isVirtualNetworkFilterEnabled":false,"virtualNetworkRules":[],"EnabledApiTypes":"Sql","disableKeyBasedMetadataWriteAccess":false,"enableFreeTier":false,"enableAnalyticalStorage":false,"analyticalStorageConfiguration":{"schemaType":"WellDefined"},"instanceId":"5628dcd8-b098-4b95-b5d1-c5f55e061d78","databaseAccountOfferType":"Standard","defaultIdentity":"FirstPartyIdentity","networkAclBypass":"None","disableLocalAuth":false,"consistencyPolicy":{"defaultConsistencyLevel":"Session","maxIntervalInSeconds":5,"maxStalenessPrefix":100},"configurationOverrides":{},"writeLocations":[{"id":"cli-test000003-westus","locationName":"West US","documentEndpoint":"https://cli-test000003-westus.documents.azure.com:443/","provisioningState":"Succeeded","failoverPriority":0,"isZoneRedundant":false}],"readLocations":[{"id":"cli-test000003-westus","locationName":"West US","documentEndpoint":"https://cli-test000003-westus.documents.azure.com:443/","provisioningState":"Succeeded","failoverPriority":0,"isZoneRedundant":false}],"locations":[{"id":"cli-test000003-westus","locationName":"West US","documentEndpoint":"https://cli-test000003-westus.documents.azure.com:443/","provisioningState":"Succeeded","failoverPriority":0,"isZoneRedundant":false}],"failoverPolicies":[{"id":"cli-test000003-westus","locationName":"West @@ -623,11 +623,11 @@ interactions: cache-control: - no-store, no-cache content-length: - - '2189' + - '2253' content-type: - application/json date: - - Thu, 15 Dec 2022 18:50:16 GMT + - Mon, 30 Jan 2023 23:17:27 GMT pragma: - no-cache server: @@ -661,15 +661,15 @@ interactions: ParameterSetName: - -n -g -d User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003/listConnectionStrings?api-version=2022-08-15 response: body: - string: '{"connectionStrings":[{"connectionString":"AccountEndpoint=https://cli-test000003.documents.azure.com:443/;AccountKey=UDgdlBaz89FXp7tdw4sj3KPZffCa9FJL8SuEXjkaaMv222NMIWdqFE4JPXAu9BSuGwFZHdgYoEm2ACDb460rQg==;","description":"Primary - SQL Connection String"},{"connectionString":"AccountEndpoint=https://cli-test000003.documents.azure.com:443/;AccountKey=BCLQTP89RvR9R8EruPp8PLtqCpihbMUSqQsLSqJSsx4VF1EsKESp6fFNxGzlbbw6Z6K0a1yaw8wxACDbcx4CDw==;","description":"Secondary - SQL Connection String"},{"connectionString":"AccountEndpoint=https://cli-test000003.documents.azure.com:443/;AccountKey=GijZlhXXbHrxXoShgqNCr23m6DluSrOl3oLBMnFjhQqLKoPbgx5oO2tzEx3MVBqyH47zigEZQYb5ACDb3ZAKpA==;","description":"Primary - Read-Only SQL Connection String"},{"connectionString":"AccountEndpoint=https://cli-test000003.documents.azure.com:443/;AccountKey=fzCzgWodBP5uYSMibiSmRELRk86Fow0rEqtDX522mAlNon1kP1efRLpFtVkmQIYL28fwqsxWPU19ACDbv4kJ7w==;","description":"Secondary + string: '{"connectionStrings":[{"connectionString":"AccountEndpoint=https://cli-test000003.documents.azure.com:443/;AccountKey=HGKZ5CGuqNGC73qUqisWXUzGaZY2qrjzzX4hegOBd6NhioqhfmeB326oq7byTTQB6uNOZlBhbFwRACDbzOpYIQ==;","description":"Primary + SQL Connection String"},{"connectionString":"AccountEndpoint=https://cli-test000003.documents.azure.com:443/;AccountKey=ATpa8kvWwBorRriQXorWVJkC5UgWR1hIhzfFVKOhI3xjZogaSXNkR83S3mo1YHTQFkIXIIMq7uadACDb4IICdQ==;","description":"Secondary + SQL Connection String"},{"connectionString":"AccountEndpoint=https://cli-test000003.documents.azure.com:443/;AccountKey=SrKLig43VNZJ9hhvhkxzLlmq52RwnNIKfkkSQ1HyJ7rlWJuV7HGb2KO7yeLlTJJkueRkgGVhl3TrACDbc6smUg==;","description":"Primary + Read-Only SQL Connection String"},{"connectionString":"AccountEndpoint=https://cli-test000003.documents.azure.com:443/;AccountKey=9GGM0uIgI608Ogju7YmYw7mQampbASwotNCwMprIXJRInCBHh7a4TZrPkIs1khxshkGSlHvyVR4BACDbF9kK9g==;","description":"Secondary Read-Only SQL Connection String"}]}' headers: cache-control: @@ -679,7 +679,7 @@ interactions: content-type: - application/json date: - - Thu, 15 Dec 2022 18:50:16 GMT + - Mon, 30 Jan 2023 23:17:29 GMT pragma: - no-cache server: @@ -701,7 +701,7 @@ interactions: message: Ok - request: body: '{"properties": {"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003", - "connectionIdentity": null, "region": "West US", "connectionString": "AccountEndpoint=https://cli-test000003.documents.azure.com:443/;AccountKey=UDgdlBaz89FXp7tdw4sj3KPZffCa9FJL8SuEXjkaaMv222NMIWdqFE4JPXAu9BSuGwFZHdgYoEm2ACDb460rQg==;"}}' + "connectionIdentity": null, "region": "West US", "connectionString": "AccountEndpoint=https://cli-test000003.documents.azure.com:443/;AccountKey=HGKZ5CGuqNGC73qUqisWXUzGaZY2qrjzzX4hegOBd6NhioqhfmeB326oq7byTTQB6uNOZlBhbFwRACDbzOpYIQ==;"}}' headers: Accept: - '*/*' @@ -718,23 +718,23 @@ interactions: ParameterSetName: - -n -g -d User-Agent: - - python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) AZURECLI/2.43.0 + - python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) AZURECLI/2.44.1 method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticsites/cli_test000002/builds/default/databaseConnections/default?api-version=2022-03-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticsites/cli_test000002/databaseConnections/default?api-version=2022-03-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002/builds/default/databaseConnections/default","name":"default","type":"Microsoft.Web/staticSites/builds/databaseConnections","location":"Central + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002/databaseConnections/default","name":"default","type":"Microsoft.Web/staticSites/databaseConnections","location":"Central US","properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003","region":"West US"}}' headers: cache-control: - no-cache content-length: - - '481' + - '459' content-type: - application/json date: - - Thu, 15 Dec 2022 18:50:18 GMT + - Mon, 30 Jan 2023 23:17:30 GMT expires: - '-1' pragma: diff --git a/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_pgsql_single.yaml b/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_pgsql_single.yaml index d515a3189ee..151f583e25e 100644 --- a/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_pgsql_single.yaml +++ b/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_pgsql_single.yaml @@ -13,7 +13,7 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 response: @@ -29,7 +29,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:55:20 GMT + - Mon, 30 Jan 2023 23:15:13 GMT expires: - '-1' pragma: @@ -62,22 +62,22 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central - US","properties":{"defaultHostname":"lively-sea-0027bf610.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":null,"privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + US","properties":{"defaultHostname":"salmon-river-078941310.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":"20.84.233.22","privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' headers: cache-control: - no-cache content-length: - - '808' + - '820' content-type: - application/json date: - - Thu, 15 Dec 2022 18:55:21 GMT + - Mon, 30 Jan 2023 23:15:17 GMT expires: - '-1' pragma: @@ -115,22 +115,22 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central - US","properties":{"defaultHostname":"lively-sea-0027bf610.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":null,"privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + US","properties":{"defaultHostname":"salmon-river-078941310.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":"20.84.233.22","privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' headers: cache-control: - no-cache content-length: - - '808' + - '820' content-type: - application/json date: - - Thu, 15 Dec 2022 18:55:22 GMT + - Mon, 30 Jan 2023 23:15:17 GMT expires: - '-1' pragma: @@ -166,7 +166,7 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/locations?api-version=2019-11-01 response: @@ -210,7 +210,7 @@ interactions: Paulo State\",\"pairedRegion\":[{\"name\":\"southcentralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2euap\",\"name\":\"eastus2euap\",\"displayName\":\"East US 2 EUAP\",\"regionalDisplayName\":\"(US) East US 2 EUAP\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"US\",\"longitude\":\"-78.3889\",\"latitude\":\"36.6681\",\"pairedRegion\":[{\"name\":\"centraluseuap\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centraluseuap\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/qatarcentral\",\"name\":\"qatarcentral\",\"displayName\":\"Qatar Central\",\"regionalDisplayName\":\"(Middle East) Qatar Central\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Recommended\",\"geographyGroup\":\"Middle - East\",\"longitude\":\"51.439327\",\"latitude\":\"25.551462\",\"physicalLocation\":\"Doha\",\"pairedRegion\":[{\"name\":\"westeurope\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westeurope\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralusstage\",\"name\":\"centralusstage\",\"displayName\":\"Central + East\",\"longitude\":\"51.439327\",\"latitude\":\"25.551462\",\"physicalLocation\":\"Doha\",\"pairedRegion\":[]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralusstage\",\"name\":\"centralusstage\",\"displayName\":\"Central US (Stage)\",\"regionalDisplayName\":\"(US) Central US (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastusstage\",\"name\":\"eastusstage\",\"displayName\":\"East US (Stage)\",\"regionalDisplayName\":\"(US) East US (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2stage\",\"name\":\"eastus2stage\",\"displayName\":\"East US 2 (Stage)\",\"regionalDisplayName\":\"(US) East US 2 (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northcentralusstage\",\"name\":\"northcentralusstage\",\"displayName\":\"North @@ -228,7 +228,8 @@ interactions: Pacific\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southeastasiastage\",\"name\":\"southeastasiastage\",\"displayName\":\"Southeast Asia (Stage)\",\"regionalDisplayName\":\"(Asia Pacific) Southeast Asia (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia Pacific\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastusstg\",\"name\":\"eastusstg\",\"displayName\":\"East - US STG\",\"regionalDisplayName\":\"(US) East US STG\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-79.8164\",\"latitude\":\"37.3719\",\"physicalLocation\":\"Virginia\",\"pairedRegion\":[{\"name\":\"southcentralusstg\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralusstg\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northcentralus\",\"name\":\"northcentralus\",\"displayName\":\"North + US STG\",\"regionalDisplayName\":\"(US) East US STG\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-79.8164\",\"latitude\":\"37.3719\",\"physicalLocation\":\"Virginia\",\"pairedRegion\":[{\"name\":\"southcentralusstg\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralusstg\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralusstg\",\"name\":\"southcentralusstg\",\"displayName\":\"South + Central US STG\",\"regionalDisplayName\":\"(US) South Central US STG\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-98.5\",\"latitude\":\"29.4167\",\"physicalLocation\":\"Texas\",\"pairedRegion\":[{\"name\":\"eastusstg\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastusstg\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northcentralus\",\"name\":\"northcentralus\",\"displayName\":\"North Central US\",\"regionalDisplayName\":\"(US) North Central US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-87.6278\",\"latitude\":\"41.8819\",\"physicalLocation\":\"Illinois\",\"pairedRegion\":[{\"name\":\"southcentralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus\",\"name\":\"westus\",\"displayName\":\"West US\",\"regionalDisplayName\":\"(US) West US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-122.417\",\"latitude\":\"37.783\",\"physicalLocation\":\"California\",\"pairedRegion\":[{\"name\":\"eastus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/jioindiawest\",\"name\":\"jioindiawest\",\"displayName\":\"Jio India West\",\"regionalDisplayName\":\"(Asia Pacific) Jio India West\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia @@ -268,11 +269,11 @@ interactions: cache-control: - no-cache content-length: - - '29930' + - '30301' content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:55:24 GMT + - Mon, 30 Jan 2023 23:15:21 GMT expires: - '-1' pragma: @@ -300,7 +301,7 @@ interactions: ParameterSetName: - -l -g -n -u -p User-Agent: - - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: HEAD uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test000001?api-version=2021-04-01 response: @@ -312,7 +313,7 @@ interactions: content-length: - '0' date: - - Thu, 15 Dec 2022 18:55:24 GMT + - Mon, 30 Jan 2023 23:15:20 GMT expires: - '-1' pragma: @@ -338,12 +339,12 @@ interactions: ParameterSetName: - -l -g -n -u -p User-Agent: - - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001","name":"cli_test000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2022-12-15T18:55:18Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001","name":"cli_test000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2023-01-30T23:15:08Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -352,7 +353,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:55:24 GMT + - Mon, 30 Jan 2023 23:15:21 GMT expires: - '-1' pragma: @@ -384,7 +385,7 @@ interactions: ParameterSetName: - -l -g -n -u -p User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-rdbms/10.2.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-rdbms/10.2.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/checkNameAvailability?api-version=2017-12-01 response: @@ -398,7 +399,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:55:26 GMT + - Mon, 30 Jan 2023 23:15:24 GMT expires: - '-1' pragma: @@ -439,15 +440,15 @@ interactions: ParameterSetName: - -l -g -n -u -p User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-rdbms/10.2.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-rdbms/10.2.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DBforPostgreSQL/servers/cli-test000003?api-version=2017-12-01 response: body: - string: '{"operation":"UpsertElasticServer","startTime":"2022-12-15T18:55:27.767Z"}' + string: '{"operation":"UpsertElasticServer","startTime":"2023-01-30T23:15:25.763Z"}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/westus/azureAsyncOperation/4b254167-d8bf-482d-9d36-d137a9da7605?api-version=2017-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/westus/azureAsyncOperation/cf434d22-0200-4a09-8ccc-3af6a6268c32?api-version=2017-12-01 cache-control: - no-cache content-length: @@ -455,11 +456,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:55:28 GMT + - Mon, 30 Jan 2023 23:15:26 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/westus/operationResults/4b254167-d8bf-482d-9d36-d137a9da7605?api-version=2017-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/westus/operationResults/cf434d22-0200-4a09-8ccc-3af6a6268c32?api-version=2017-12-01 pragma: - no-cache server: @@ -487,12 +488,12 @@ interactions: ParameterSetName: - -l -g -n -u -p User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-rdbms/10.2.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-rdbms/10.2.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/westus/azureAsyncOperation/4b254167-d8bf-482d-9d36-d137a9da7605?api-version=2017-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/westus/azureAsyncOperation/cf434d22-0200-4a09-8ccc-3af6a6268c32?api-version=2017-12-01 response: body: - string: '{"name":"4b254167-d8bf-482d-9d36-d137a9da7605","status":"InProgress","startTime":"2022-12-15T18:55:27.767Z"}' + string: '{"name":"cf434d22-0200-4a09-8ccc-3af6a6268c32","status":"InProgress","startTime":"2023-01-30T23:15:25.763Z"}' headers: cache-control: - no-cache @@ -501,7 +502,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:56:28 GMT + - Mon, 30 Jan 2023 23:16:26 GMT expires: - '-1' pragma: @@ -533,12 +534,12 @@ interactions: ParameterSetName: - -l -g -n -u -p User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-rdbms/10.2.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-rdbms/10.2.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/westus/azureAsyncOperation/4b254167-d8bf-482d-9d36-d137a9da7605?api-version=2017-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/westus/azureAsyncOperation/cf434d22-0200-4a09-8ccc-3af6a6268c32?api-version=2017-12-01 response: body: - string: '{"name":"4b254167-d8bf-482d-9d36-d137a9da7605","status":"Succeeded","startTime":"2022-12-15T18:55:27.767Z"}' + string: '{"name":"cf434d22-0200-4a09-8ccc-3af6a6268c32","status":"Succeeded","startTime":"2023-01-30T23:15:25.763Z"}' headers: cache-control: - no-cache @@ -547,7 +548,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:57:28 GMT + - Mon, 30 Jan 2023 23:17:27 GMT expires: - '-1' pragma: @@ -579,21 +580,21 @@ interactions: ParameterSetName: - -l -g -n -u -p User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-rdbms/10.2.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-rdbms/10.2.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DBforPostgreSQL/servers/cli-test000003?api-version=2017-12-01 response: body: - string: '{"sku":{"name":"GP_Gen5_2","tier":"GeneralPurpose","family":"Gen5","capacity":2},"properties":{"administratorLogin":"aturing","storageProfile":{"storageMB":5120,"backupRetentionDays":7,"geoRedundantBackup":"Disabled","storageAutogrow":"Enabled"},"version":"11","sslEnforcement":"Enabled","minimalTlsVersion":"TLSEnforcementDisabled","userVisibleState":"Ready","fullyQualifiedDomainName":"cli-test000003.postgres.database.azure.com","earliestRestoreDate":"2022-12-15T19:05:28.173+00:00","replicationRole":"None","masterServerId":"","replicaCapacity":5,"byokEnforcement":"Disabled","privateEndpointConnections":[],"infrastructureEncryption":"Disabled","publicNetworkAccess":"Enabled"},"location":"westus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DBforPostgreSQL/servers/cli-test000003","name":"cli-test000003","type":"Microsoft.DBforPostgreSQL/servers"}' + string: '{"sku":{"name":"GP_Gen5_2","tier":"GeneralPurpose","family":"Gen5","capacity":2},"properties":{"administratorLogin":"aturing","storageProfile":{"storageMB":5120,"backupRetentionDays":7,"geoRedundantBackup":"Disabled","storageAutogrow":"Enabled"},"version":"11","sslEnforcement":"Enabled","minimalTlsVersion":"TLSEnforcementDisabled","userVisibleState":"Ready","fullyQualifiedDomainName":"cli-test000003.postgres.database.azure.com","earliestRestoreDate":"2023-01-30T23:25:26.17+00:00","replicationRole":"None","masterServerId":"","replicaCapacity":5,"byokEnforcement":"Disabled","privateEndpointConnections":[],"infrastructureEncryption":"Disabled","publicNetworkAccess":"Enabled"},"location":"westus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DBforPostgreSQL/servers/cli-test000003","name":"cli-test000003","type":"Microsoft.DBforPostgreSQL/servers"}' headers: cache-control: - no-cache content-length: - - '918' + - '917' content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:57:28 GMT + - Mon, 30 Jan 2023 23:17:28 GMT expires: - '-1' pragma: @@ -629,27 +630,27 @@ interactions: ParameterSetName: - -g -n -s User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-rdbms/10.2.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-rdbms/10.2.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DBforPostgreSQL/servers/cli-test000003/databases/tables?api-version=2017-12-01 response: body: - string: '{"operation":"UpsertElasticServerDatabase","startTime":"2022-12-15T18:57:29.63Z"}' + string: '{"operation":"UpsertElasticServerDatabase","startTime":"2023-01-30T23:17:29.337Z"}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/westus/azureAsyncOperation/195feb0d-5f40-466f-b661-dba48ba653c3?api-version=2017-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/westus/azureAsyncOperation/8c757d37-25bf-4510-a321-71e967ef8f24?api-version=2017-12-01 cache-control: - no-cache content-length: - - '81' + - '82' content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:57:28 GMT + - Mon, 30 Jan 2023 23:17:28 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/westus/operationResults/195feb0d-5f40-466f-b661-dba48ba653c3?api-version=2017-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/westus/operationResults/8c757d37-25bf-4510-a321-71e967ef8f24?api-version=2017-12-01 pragma: - no-cache server: @@ -677,21 +678,21 @@ interactions: ParameterSetName: - -g -n -s User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-rdbms/10.2.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-rdbms/10.2.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/westus/azureAsyncOperation/195feb0d-5f40-466f-b661-dba48ba653c3?api-version=2017-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/westus/azureAsyncOperation/8c757d37-25bf-4510-a321-71e967ef8f24?api-version=2017-12-01 response: body: - string: '{"name":"195feb0d-5f40-466f-b661-dba48ba653c3","status":"Succeeded","startTime":"2022-12-15T18:57:29.63Z"}' + string: '{"name":"8c757d37-25bf-4510-a321-71e967ef8f24","status":"Succeeded","startTime":"2023-01-30T23:17:29.337Z"}' headers: cache-control: - no-cache content-length: - - '106' + - '107' content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:57:43 GMT + - Mon, 30 Jan 2023 23:17:44 GMT expires: - '-1' pragma: @@ -723,7 +724,7 @@ interactions: ParameterSetName: - -g -n -s User-Agent: - - AZURECLI/2.43.0 azsdk-python-mgmt-rdbms/10.2.0b5 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-mgmt-rdbms/10.2.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DBforPostgreSQL/servers/cli-test000003/databases/tables?api-version=2017-12-01 response: @@ -737,7 +738,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:57:44 GMT + - Mon, 30 Jan 2023 23:17:44 GMT expires: - '-1' pragma: @@ -769,22 +770,22 @@ interactions: ParameterSetName: - -n -g -u -p -d -b User-Agent: - - AZURECLI/2.43.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central - US","properties":{"defaultHostname":"lively-sea-0027bf610.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":null,"privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + US","properties":{"defaultHostname":"salmon-river-078941310.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":"20.84.233.22","privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' headers: cache-control: - no-cache content-length: - - '808' + - '820' content-type: - application/json date: - - Thu, 15 Dec 2022 18:57:45 GMT + - Mon, 30 Jan 2023 23:17:45 GMT expires: - '-1' pragma: @@ -820,21 +821,21 @@ interactions: ParameterSetName: - -n -g -u -p -d -b User-Agent: - - python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) AZURECLI/2.43.0 + - python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) AZURECLI/2.44.1 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DBforPostgreSQL/servers/cli-test000003?api-version=2017-12-01 response: body: - string: '{"sku":{"name":"GP_Gen5_2","tier":"GeneralPurpose","family":"Gen5","capacity":2},"properties":{"administratorLogin":"aturing","storageProfile":{"storageMB":5120,"backupRetentionDays":7,"geoRedundantBackup":"Disabled","storageAutogrow":"Enabled"},"version":"11","sslEnforcement":"Enabled","minimalTlsVersion":"TLSEnforcementDisabled","userVisibleState":"Ready","fullyQualifiedDomainName":"cli-test000003.postgres.database.azure.com","earliestRestoreDate":"2022-12-15T19:05:28.173+00:00","replicationRole":"None","masterServerId":"","replicaCapacity":5,"byokEnforcement":"Disabled","privateEndpointConnections":[],"infrastructureEncryption":"Disabled","publicNetworkAccess":"Enabled"},"location":"westus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DBforPostgreSQL/servers/cli-test000003","name":"cli-test000003","type":"Microsoft.DBforPostgreSQL/servers"}' + string: '{"sku":{"name":"GP_Gen5_2","tier":"GeneralPurpose","family":"Gen5","capacity":2},"properties":{"administratorLogin":"aturing","storageProfile":{"storageMB":5120,"backupRetentionDays":7,"geoRedundantBackup":"Disabled","storageAutogrow":"Enabled"},"version":"11","sslEnforcement":"Enabled","minimalTlsVersion":"TLSEnforcementDisabled","userVisibleState":"Ready","fullyQualifiedDomainName":"cli-test000003.postgres.database.azure.com","earliestRestoreDate":"2023-01-30T23:25:26.17+00:00","replicationRole":"None","masterServerId":"","replicaCapacity":5,"byokEnforcement":"Disabled","privateEndpointConnections":[],"infrastructureEncryption":"Disabled","publicNetworkAccess":"Enabled"},"location":"westus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DBforPostgreSQL/servers/cli-test000003","name":"cli-test000003","type":"Microsoft.DBforPostgreSQL/servers"}' headers: cache-control: - no-cache content-length: - - '918' + - '917' content-type: - application/json; charset=utf-8 date: - - Thu, 15 Dec 2022 18:57:45 GMT + - Mon, 30 Jan 2023 23:17:46 GMT expires: - '-1' pragma: @@ -872,23 +873,23 @@ interactions: ParameterSetName: - -n -g -u -p -d -b User-Agent: - - python/3.8.13 (macOS-12.6.1-x86_64-i386-64bit) AZURECLI/2.43.0 + - python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) AZURECLI/2.44.1 method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticsites/cli_test000002/builds/default/databaseConnections/default?api-version=2022-03-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticsites/cli_test000002/databaseConnections/default?api-version=2022-03-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002/builds/default/databaseConnections/default","name":"default","type":"Microsoft.Web/staticSites/builds/databaseConnections","location":"Central + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002/databaseConnections/default","name":"default","type":"Microsoft.Web/staticSites/databaseConnections","location":"Central US","properties":{"resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DBforPostgreSQL/servers/cli-test000003","region":"West US"}}' headers: cache-control: - no-cache content-length: - - '477' + - '455' content-type: - application/json date: - - Thu, 15 Dec 2022 18:57:47 GMT + - Mon, 30 Jan 2023 23:17:47 GMT expires: - '-1' pragma: From b293ffe2c98c3610519ba924a387d129d4288612 Mon Sep 17 00:00:00 2001 From: Silas Strawn Date: Tue, 31 Jan 2023 13:41:07 -0800 Subject: [PATCH 17/27] fix style/linter issues --- src/staticwebapp/azext_staticwebapp/_client_factory.py | 1 - src/staticwebapp/azext_staticwebapp/_clients.py | 3 +-- src/staticwebapp/azext_staticwebapp/_params.py | 2 +- src/staticwebapp/azext_staticwebapp/_utils.py | 7 +++---- src/staticwebapp/azext_staticwebapp/_validators.py | 1 - src/staticwebapp/azext_staticwebapp/commands.py | 2 +- src/staticwebapp/setup.py | 2 +- 7 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/staticwebapp/azext_staticwebapp/_client_factory.py b/src/staticwebapp/azext_staticwebapp/_client_factory.py index 8dd7ea066b4..34913fb394d 100644 --- a/src/staticwebapp/azext_staticwebapp/_client_factory.py +++ b/src/staticwebapp/azext_staticwebapp/_client_factory.py @@ -2,4 +2,3 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- - diff --git a/src/staticwebapp/azext_staticwebapp/_clients.py b/src/staticwebapp/azext_staticwebapp/_clients.py index f2985fbeeed..5429814a28f 100644 --- a/src/staticwebapp/azext_staticwebapp/_clients.py +++ b/src/staticwebapp/azext_staticwebapp/_clients.py @@ -21,7 +21,7 @@ def create_or_update(cls, cmd, resource_group_name, name, environment, connectio sub_id = get_subscription_id(cmd.cli_ctx) if environment: url_fmt = ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Web/staticsites/{}/builds/{}" - "/databaseConnections/{}?api-version={}") + "/databaseConnections/{}?api-version={}") request_url = url_fmt.format( management_hostname.strip('/'), sub_id, @@ -108,7 +108,6 @@ def list(cls, cmd, resource_group_name, name, environment, connection_name="defa r = send_raw_request(cmd.cli_ctx, verb, request_url) return r.json() - @classmethod def delete(cls, cmd, resource_group_name, name, environment, connection_name="default"): management_hostname = cmd.cli_ctx.cloud.endpoints.resource_manager diff --git a/src/staticwebapp/azext_staticwebapp/_params.py b/src/staticwebapp/azext_staticwebapp/_params.py index 70dfd186eea..61e9002e6d5 100644 --- a/src/staticwebapp/azext_staticwebapp/_params.py +++ b/src/staticwebapp/azext_staticwebapp/_params.py @@ -24,5 +24,5 @@ def load_arguments(self, _): c.argument('mi_system_assigned', options_list=["--mi-system-assigned", "-s"], help="Use the Static Web App's system-assigned identity for auth with the database. Must be assigned to the Static Web App and have the right permissions on the database.") with self.argument_context('staticwebapp dbconnection show') as c: - c.argument('detailed', options_list=['--detailed', '-d'],action='store_true', + c.argument('detailed', options_list=['--detailed', '-d'], action='store_true', default=False, help="Get detailed information on database connections") diff --git a/src/staticwebapp/azext_staticwebapp/_utils.py b/src/staticwebapp/azext_staticwebapp/_utils.py index 503cee503b7..1c9ab6bc859 100644 --- a/src/staticwebapp/azext_staticwebapp/_utils.py +++ b/src/staticwebapp/azext_staticwebapp/_utils.py @@ -24,7 +24,7 @@ class ConnectionType(Enum): CONNECTION_STRING = auto() MANAGED_IDENTITY_USER_ASSIGNED = auto() - MANAGED_IDENTITY_SYSTEM_ASSIGNED= auto() + MANAGED_IDENTITY_SYSTEM_ASSIGNED = auto() class Sku(Enum): @@ -54,7 +54,7 @@ def _requires_database_name(cls) -> bool: @classmethod def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id, database_name, - username=None, password=None, **kwargs): + username=None, password=None, **kwargs): raise NotImplementedError() # saves some time by prevent reparsing of RIDs @@ -184,7 +184,7 @@ def _requires_database_name(cls) -> bool: @classmethod def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id, database_name, - username=None, password=None, **kwargs) -> str: + username=None, password=None, **kwargs) -> str: parsed_rid = cls._parse_resource_id(resource_id) name = parsed_rid["name"] @@ -285,7 +285,6 @@ def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionTyp f"User Id={client_id};Ssl Mode=Require;") - class PgSqlFlexHandler(AbstractDbHandler): DB_TYPE_NAME = "PostgreSQL Flex" API_VERSION = "2021-06-01" diff --git a/src/staticwebapp/azext_staticwebapp/_validators.py b/src/staticwebapp/azext_staticwebapp/_validators.py index 8dd7ea066b4..34913fb394d 100644 --- a/src/staticwebapp/azext_staticwebapp/_validators.py +++ b/src/staticwebapp/azext_staticwebapp/_validators.py @@ -2,4 +2,3 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- - diff --git a/src/staticwebapp/azext_staticwebapp/commands.py b/src/staticwebapp/azext_staticwebapp/commands.py index 9ef906dbed5..f3d8cadda18 100644 --- a/src/staticwebapp/azext_staticwebapp/commands.py +++ b/src/staticwebapp/azext_staticwebapp/commands.py @@ -7,5 +7,5 @@ def load_command_table(self, _): with self.command_group('staticwebapp dbconnection', is_preview=True) as g: g.custom_command('create', 'create_dbconnection') - g.custom_command('show', 'show_dbconnection') + g.custom_show_command('show', 'show_dbconnection') g.custom_command('delete', 'delete_dbconnection') diff --git a/src/staticwebapp/setup.py b/src/staticwebapp/setup.py index 89001387f13..3deec9e7af2 100644 --- a/src/staticwebapp/setup.py +++ b/src/staticwebapp/setup.py @@ -55,4 +55,4 @@ packages=find_packages(), install_requires=DEPENDENCIES, package_data={'azext_staticwebapp': ['azext_metadata.json']}, -) \ No newline at end of file +) From c950bd2c6dac34a96effebc9682663fe84324465 Mon Sep 17 00:00:00 2001 From: Silas Strawn Date: Tue, 31 Jan 2023 13:55:55 -0800 Subject: [PATCH 18/27] fix codeowners --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 906086bf68f..d3d6881ea61 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -244,7 +244,7 @@ /src/fleet/ @pdaru -/src/azext_staticwebapp/ @strawnsc +/src/staticwebapp/ @strawnsc /src/traffic-collector/ @rmodh @japani @kukulkarni1 From 2dccd53d3e6d6897d8eb5a27aa9162b3b7b51cbb Mon Sep 17 00:00:00 2001 From: Silas Strawn Date: Tue, 31 Jan 2023 16:08:06 -0800 Subject: [PATCH 19/27] update connection string formats --- src/staticwebapp/azext_staticwebapp/_utils.py | 38 ++++--------------- 1 file changed, 8 insertions(+), 30 deletions(-) diff --git a/src/staticwebapp/azext_staticwebapp/_utils.py b/src/staticwebapp/azext_staticwebapp/_utils.py index 1c9ab6bc859..b00a88ee522 100644 --- a/src/staticwebapp/azext_staticwebapp/_utils.py +++ b/src/staticwebapp/azext_staticwebapp/_utils.py @@ -12,10 +12,7 @@ from knack.log import get_logger from azure.cli.core.azclierror import InvalidArgumentValueError, RequiredArgumentMissingError, ValidationError from azure.cli.core.util import send_raw_request -from azure.cli.core.profiles import ResourceType -from azure.cli.core.commands.client_factory import get_mgmt_service_client from azure.cli.command_modules.cosmosdb._client_factory import cf_db_accounts -from azure.cli.command_modules.role import graph_client_factory logger = get_logger(__name__) @@ -159,7 +156,7 @@ def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionTyp if connection_type == ConnectionType.CONNECTION_STRING: return client.list_connection_strings(resource_group, name).connection_strings[0].connection_string else: - return client.get(resource_group, name).document_endpoint + return f"AccountEndpoint={client.get(resource_group, name).document_endpoint};" class AzureSqlHandler(AbstractDbHandler): @@ -190,10 +187,9 @@ def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionTyp if connection_type == ConnectionType.CONNECTION_STRING: return (f"Server=tcp:{name}.database.windows.net,1433;Database={database_name};" - f"User ID={username};Password={password};Encrypt=true;Connection Timeout=30;") + f"User ID={username};Password={password};") else: - return (f"Server=tcp:{name}.database.windows.net,1433;Database={database_name};" - f"Encrypt=true;Connection Timeout=30;") + return f"Server=tcp:{name}.database.windows.net,1433;Database={database_name};" class MySqlFlexHandler(AbstractDbHandler): @@ -222,9 +218,8 @@ def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionTyp parsed_rid = cls._parse_resource_id(resource_id) server = parsed_rid["name"] # only connection string auth supported - return (f'Server="{server}.mysql.database.azure.com";UserID = "{username}";' - f'Password="{password}";Database="{database_name}";SslMode=MySqlSslMode.Required;' - 'SslCa="{path_to_CA_cert}"') + return (f'Server={server}.mysql.database.azure.com;UserID = {username};' + f'Password={password}";Database={database_name};') @classmethod def get_location(cls, cmd, resource_id: str) -> str: @@ -255,22 +250,6 @@ def _requires_database_name(cls) -> bool: def get_location(cls, cmd, resource_id: str) -> str: return cls._get_location_from_server(cmd, resource_id) - @classmethod - def _get_client_id(cls, cmd, connection_type: 'ConnectionType', app=None, identity_rid=None) -> str: - # TODO does this need to handle managed identities outside the user's sub? - # It will almost surely fail in this case ^ - if connection_type == ConnectionType.MANAGED_IDENTITY_USER_ASSIGNED: - parsed_rid = cls._parse_resource_id(identity_rid) - resource_group_name = parsed_rid["resource_group"] - name = parsed_rid["name"] - client = get_mgmt_service_client(cmd.cli_ctx, ResourceType.MGMT_MSI).user_assigned_identities - identity = client.get(resource_group_name, name) - return identity.client_id - else: - client = graph_client_factory(cmd.cli_ctx) - sp = client.service_principal_get(app.identity.principal_id) - return sp["appId"] - @classmethod def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionType', resource_id, database_name, username=None, password=None, **kwargs) -> str: @@ -278,11 +257,10 @@ def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionTyp server = parsed_rid["name"] if connection_type == ConnectionType.CONNECTION_STRING: return (f"Server={server}.postgres.database.azure.com;Database={database_name};Port=5432;" - f"User Id={username}@{server};Password={password};Ssl Mode=Require;") + f"User Id={username}@{server};Password={password};") else: - client_id = cls._get_client_id(cmd, connection_type, kwargs["app"], kwargs["identity_rid"]) return (f"Server={server}.postgres.database.azure.com;Database={database_name};Port=5432;" - f"User Id={client_id};Ssl Mode=Require;") + f"User Id={username}@{server};") class PgSqlFlexHandler(AbstractDbHandler): @@ -315,7 +293,7 @@ def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionTyp parsed_rid = cls._parse_resource_id(resource_id) server = parsed_rid["name"] return (f"Server={server}.postgres.database.azure.com;Database={database_name};Port=5432;" - f"User Id={username};Password={password};Ssl Mode=Require;") + f"User Id={username};Password={password};") # pylint: disable=line-too-long From e314e1a3a30f88adbaa52bf7c17f45239bff3bc4 Mon Sep 17 00:00:00 2001 From: Silas Strawn Date: Mon, 13 Feb 2023 14:56:21 -0800 Subject: [PATCH 20/27] fix exception on delete --- src/staticwebapp/azext_staticwebapp/_clients.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/staticwebapp/azext_staticwebapp/_clients.py b/src/staticwebapp/azext_staticwebapp/_clients.py index 5429814a28f..ba8567cfa2d 100644 --- a/src/staticwebapp/azext_staticwebapp/_clients.py +++ b/src/staticwebapp/azext_staticwebapp/_clients.py @@ -135,5 +135,4 @@ def delete(cls, cmd, resource_group_name, name, environment, connection_name="de connection_name, api_version) - r = send_raw_request(cmd.cli_ctx, "DELETE", request_url) - return r.json() + send_raw_request(cmd.cli_ctx, "DELETE", request_url) From b754af2ba4fa417484ebdce2268c3f19db78c29b Mon Sep 17 00:00:00 2001 From: Silas Strawn Date: Mon, 13 Feb 2023 15:22:14 -0800 Subject: [PATCH 21/27] update initial release version --- src/staticwebapp/HISTORY.rst | 4 ++-- src/staticwebapp/setup.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/staticwebapp/HISTORY.rst b/src/staticwebapp/HISTORY.rst index f655acc6297..643b5d8ee04 100644 --- a/src/staticwebapp/HISTORY.rst +++ b/src/staticwebapp/HISTORY.rst @@ -3,6 +3,6 @@ Release History =============== -0.1.0 +1.0.0 ++++++ -* Add commands to manage Static Web App database connections: 'az staticwebapp dbconnection create/show/delete' +* Add commands to manage Static Web App database connections: `az staticwebapp dbconnection create/show/delete` diff --git a/src/staticwebapp/setup.py b/src/staticwebapp/setup.py index 3deec9e7af2..e8ec6446ba0 100644 --- a/src/staticwebapp/setup.py +++ b/src/staticwebapp/setup.py @@ -16,7 +16,7 @@ # TODO: Confirm this is the right version number you want and it matches your # HISTORY.rst entry. -VERSION = 'private-test-0.0.1' +VERSION = '1.0.0' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers From d89fb2b0ee2677076e57cc8fddbfc0a4d38645d7 Mon Sep 17 00:00:00 2001 From: Xing Zhou Date: Tue, 14 Mar 2023 15:30:04 +0800 Subject: [PATCH 22/27] Update src/staticwebapp/azext_staticwebapp/_help.py Co-authored-by: Yan Zhu <105691024+yanzhudd@users.noreply.github.com> --- src/staticwebapp/azext_staticwebapp/_help.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/staticwebapp/azext_staticwebapp/_help.py b/src/staticwebapp/azext_staticwebapp/_help.py index 4ec191d512c..6e6ae520773 100644 --- a/src/staticwebapp/azext_staticwebapp/_help.py +++ b/src/staticwebapp/azext_staticwebapp/_help.py @@ -9,7 +9,7 @@ helps['staticwebapp dbconnection'] = """ type: group - short-summary: Manage Static Web App database connections + short-summary: Manage Static Web App database connections. """ helps['staticwebapp dbconnection create'] = """ From 11b3ba39902336e82206de2fe47020ac6d25662e Mon Sep 17 00:00:00 2001 From: Xing Zhou Date: Tue, 14 Mar 2023 15:39:08 +0800 Subject: [PATCH 23/27] Apply suggestions from code review Co-authored-by: Yan Zhu <105691024+yanzhudd@users.noreply.github.com> --- src/staticwebapp/azext_staticwebapp/_params.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/staticwebapp/azext_staticwebapp/_params.py b/src/staticwebapp/azext_staticwebapp/_params.py index 61e9002e6d5..e401ea45f98 100644 --- a/src/staticwebapp/azext_staticwebapp/_params.py +++ b/src/staticwebapp/azext_staticwebapp/_params.py @@ -9,14 +9,14 @@ def load_arguments(self, _): from azure.cli.core.commands.parameters import resource_group_name_type with self.argument_context('staticwebapp dbconnection') as c: - c.argument('name', options_list=['--name', '-n'], help="Name of the Static Web App") + c.argument('name', options_list=['--name', '-n'], help="Name of the Static Web App.") c.argument('resource_group_name', resource_group_name_type) c.argument('environment', help="Name of the environment of Static Web App.", options_list=["--environment", "-e"]) with self.argument_context('staticwebapp dbconnection create') as c: c.argument('db_resource_id', options_list=['--db-resource-id', '-d'], - help="The azure resource ID for the database server/account to connect to e.g. '/subscriptions/MySubId/resourceGroups/MyResourceGroup/providers/Microsoft.Sql/servers/MyServer' for an Azure SQL database") + help="The azure resource ID for the database server/account to connect to e.g. '/subscriptions/MySubId/resourceGroups/MyResourceGroup/providers/Microsoft.Sql/servers/MyServer' for an Azure SQL database.") c.argument('db_name', options_list=['--db-name', '-b'], help="The name of the database to connect to. Not required for CosmosDB.") c.argument('username', options_list=["--username", "-u"], help="The username to use for authentication with the database. Not required for all databases.") c.argument('password', options_list=["--password", "-p"], help="The password to use for authentication with the database. Not required for all databases.") @@ -25,4 +25,4 @@ def load_arguments(self, _): with self.argument_context('staticwebapp dbconnection show') as c: c.argument('detailed', options_list=['--detailed', '-d'], action='store_true', - default=False, help="Get detailed information on database connections") + default=False, help="Get detailed information on database connections.") From 8b80723dd77257c0952207e246f6183f518e5b15 Mon Sep 17 00:00:00 2001 From: Xing Zhou Date: Tue, 14 Mar 2023 15:41:39 +0800 Subject: [PATCH 24/27] Apply suggestions from code review --- src/staticwebapp/azext_staticwebapp/_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/staticwebapp/azext_staticwebapp/_utils.py b/src/staticwebapp/azext_staticwebapp/_utils.py index b00a88ee522..8c3cbd33413 100644 --- a/src/staticwebapp/azext_staticwebapp/_utils.py +++ b/src/staticwebapp/azext_staticwebapp/_utils.py @@ -69,11 +69,11 @@ def _validate(cls, sku: 'Sku', connection_type: 'ConnectionType', database_name, missing_username = not username and cls._requires_username(sku, connection_type) missing_password = not password and cls._requires_password(sku, connection_type) if missing_password and missing_username: - raise RequiredArgumentMissingError("Missing database username and password") + raise RequiredArgumentMissingError("Please provide the missing database username and password") if missing_password: - raise RequiredArgumentMissingError("Missing database password") + raise RequiredArgumentMissingError("Please provide the missing database password") if missing_username: - raise RequiredArgumentMissingError("Missing database username") + raise RequiredArgumentMissingError("Please provide the missing database username") unnecessary_username = username and not cls._requires_username(sku, connection_type) unnecessary_password = password and not cls._requires_password(sku, connection_type) From 00462296ab25f883bea7c90a87829bd75b8f47e5 Mon Sep 17 00:00:00 2001 From: Xing Zhou Date: Tue, 14 Mar 2023 16:08:32 +0800 Subject: [PATCH 25/27] Update src/staticwebapp/azext_staticwebapp/azext_metadata.json --- src/staticwebapp/azext_staticwebapp/azext_metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/staticwebapp/azext_staticwebapp/azext_metadata.json b/src/staticwebapp/azext_staticwebapp/azext_metadata.json index b9632de1b4f..1703199b411 100644 --- a/src/staticwebapp/azext_staticwebapp/azext_metadata.json +++ b/src/staticwebapp/azext_staticwebapp/azext_metadata.json @@ -1,4 +1,4 @@ { "azext.isPreview": true, - "azext.minCliCoreVersion": "2.39" + "azext.minCliCoreVersion": "2.39.0" } \ No newline at end of file From da969a23f2584b964ca85364deef4897f9011b7c Mon Sep 17 00:00:00 2001 From: Silas Strawn Date: Tue, 14 Mar 2023 14:56:20 -0600 Subject: [PATCH 26/27] rerecord failing tests --- ...t_staticwebapp_dbconnection_azure_sql.yaml | 265 ++++++++++-------- ...st_staticwebapp_dbconnection_cosmosdb.yaml | 134 ++++----- .../latest/test_staticwebapp_scenario.py | 4 +- 3 files changed, 224 insertions(+), 179 deletions(-) diff --git a/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_azure_sql.yaml b/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_azure_sql.yaml index a3968d7e73f..95f31db32bf 100644 --- a/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_azure_sql.yaml +++ b/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_azure_sql.yaml @@ -11,9 +11,9 @@ interactions: Connection: - keep-alive ParameterSetName: - - -n -g + - -n -g -l User-Agent: - - AZURECLI/2.44.1 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 response: @@ -29,7 +29,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 30 Jan 2023 23:15:13 GMT + - Tue, 14 Mar 2023 20:46:49 GMT expires: - '-1' pragma: @@ -60,24 +60,24 @@ interactions: Content-Type: - application/json ParameterSetName: - - -n -g + - -n -g -l User-Agent: - - AZURECLI/2.44.1 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central - US","properties":{"defaultHostname":"red-desert-04090d810.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":"20.98.190.171","privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + US","properties":{"defaultHostname":"ambitious-sand-047071c10.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":"20.84.233.22","privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[],"trafficSplitting":null},"sku":{"name":"Free","tier":"Free"}}' headers: cache-control: - no-cache content-length: - - '819' + - '846' content-type: - application/json date: - - Mon, 30 Jan 2023 23:15:16 GMT + - Tue, 14 Mar 2023 20:46:51 GMT expires: - '-1' pragma: @@ -113,24 +113,24 @@ interactions: Connection: - keep-alive ParameterSetName: - - -n -g + - -n -g -l User-Agent: - - AZURECLI/2.44.1 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central - US","properties":{"defaultHostname":"red-desert-04090d810.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":"20.98.190.171","privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + US","properties":{"defaultHostname":"ambitious-sand-047071c10.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":"20.84.233.22","privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[],"trafficSplitting":null},"sku":{"name":"Free","tier":"Free"}}' headers: cache-control: - no-cache content-length: - - '819' + - '846' content-type: - application/json date: - - Mon, 30 Jan 2023 23:15:16 GMT + - Tue, 14 Mar 2023 20:46:52 GMT expires: - '-1' pragma: @@ -164,9 +164,9 @@ interactions: Connection: - keep-alive ParameterSetName: - - -n -g + - -n -g -l User-Agent: - - AZURECLI/2.44.1 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/locations?api-version=2019-11-01 response: @@ -228,8 +228,7 @@ interactions: Pacific\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southeastasiastage\",\"name\":\"southeastasiastage\",\"displayName\":\"Southeast Asia (Stage)\",\"regionalDisplayName\":\"(Asia Pacific) Southeast Asia (Stage)\",\"metadata\":{\"regionType\":\"Logical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia Pacific\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastusstg\",\"name\":\"eastusstg\",\"displayName\":\"East - US STG\",\"regionalDisplayName\":\"(US) East US STG\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-79.8164\",\"latitude\":\"37.3719\",\"physicalLocation\":\"Virginia\",\"pairedRegion\":[{\"name\":\"southcentralusstg\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralusstg\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralusstg\",\"name\":\"southcentralusstg\",\"displayName\":\"South - Central US STG\",\"regionalDisplayName\":\"(US) South Central US STG\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-98.5\",\"latitude\":\"29.4167\",\"physicalLocation\":\"Texas\",\"pairedRegion\":[{\"name\":\"eastusstg\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastusstg\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northcentralus\",\"name\":\"northcentralus\",\"displayName\":\"North + US STG\",\"regionalDisplayName\":\"(US) East US STG\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-79.8164\",\"latitude\":\"37.3719\",\"physicalLocation\":\"Virginia\",\"pairedRegion\":[{\"name\":\"southcentralusstg\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralusstg\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northcentralus\",\"name\":\"northcentralus\",\"displayName\":\"North Central US\",\"regionalDisplayName\":\"(US) North Central US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-87.6278\",\"latitude\":\"41.8819\",\"physicalLocation\":\"Illinois\",\"pairedRegion\":[{\"name\":\"southcentralus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus\",\"name\":\"westus\",\"displayName\":\"West US\",\"regionalDisplayName\":\"(US) West US\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"US\",\"longitude\":\"-122.417\",\"latitude\":\"37.783\",\"physicalLocation\":\"California\",\"pairedRegion\":[{\"name\":\"eastus\",\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus\"}]}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/locations/jioindiawest\",\"name\":\"jioindiawest\",\"displayName\":\"Jio India West\",\"regionalDisplayName\":\"(Asia Pacific) Jio India West\",\"metadata\":{\"regionType\":\"Physical\",\"regionCategory\":\"Other\",\"geographyGroup\":\"Asia @@ -269,11 +268,11 @@ interactions: cache-control: - no-cache content-length: - - '30301' + - '29829' content-type: - application/json; charset=utf-8 date: - - Mon, 30 Jan 2023 23:15:18 GMT + - Tue, 14 Mar 2023 20:46:55 GMT expires: - '-1' pragma: @@ -306,15 +305,15 @@ interactions: ParameterSetName: - -l -g -n -u -p User-Agent: - - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-mgmt-sql/4.0.0b8 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003?api-version=2021-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003?api-version=2022-08-01-preview response: body: - string: '{"operation":"UpsertLogicalServer","startTime":"2023-01-30T23:15:20.787Z"}' + string: '{"operation":"UpsertLogicalServer","startTime":"2023-03-14T20:47:01.773Z"}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/400f42d7-444e-4a9b-892b-80f2a12c74b0?api-version=2021-02-01-preview + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/9f9dee4c-f5a6-4a44-8578-e18fd73dd8cb?api-version=2022-08-01-preview cache-control: - no-cache content-length: @@ -322,11 +321,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 30 Jan 2023 23:15:20 GMT + - Tue, 14 Mar 2023 20:47:00 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverOperationResults/400f42d7-444e-4a9b-892b-80f2a12c74b0?api-version=2021-02-01-preview + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverOperationResults/9f9dee4c-f5a6-4a44-8578-e18fd73dd8cb?api-version=2022-08-01-preview pragma: - no-cache server: @@ -354,12 +353,12 @@ interactions: ParameterSetName: - -l -g -n -u -p User-Agent: - - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-mgmt-sql/4.0.0b8 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/400f42d7-444e-4a9b-892b-80f2a12c74b0?api-version=2021-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/9f9dee4c-f5a6-4a44-8578-e18fd73dd8cb?api-version=2022-08-01-preview response: body: - string: '{"name":"400f42d7-444e-4a9b-892b-80f2a12c74b0","status":"InProgress","startTime":"2023-01-30T23:15:20.787Z"}' + string: '{"name":"9f9dee4c-f5a6-4a44-8578-e18fd73dd8cb","status":"InProgress","startTime":"2023-03-14T20:47:01.773Z"}' headers: cache-control: - no-cache @@ -368,7 +367,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 30 Jan 2023 23:15:21 GMT + - Tue, 14 Mar 2023 20:47:02 GMT expires: - '-1' pragma: @@ -400,12 +399,12 @@ interactions: ParameterSetName: - -l -g -n -u -p User-Agent: - - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-mgmt-sql/4.0.0b8 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/400f42d7-444e-4a9b-892b-80f2a12c74b0?api-version=2021-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/9f9dee4c-f5a6-4a44-8578-e18fd73dd8cb?api-version=2022-08-01-preview response: body: - string: '{"name":"400f42d7-444e-4a9b-892b-80f2a12c74b0","status":"InProgress","startTime":"2023-01-30T23:15:20.787Z"}' + string: '{"name":"9f9dee4c-f5a6-4a44-8578-e18fd73dd8cb","status":"InProgress","startTime":"2023-03-14T20:47:01.773Z"}' headers: cache-control: - no-cache @@ -414,7 +413,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 30 Jan 2023 23:15:22 GMT + - Tue, 14 Mar 2023 20:47:03 GMT expires: - '-1' pragma: @@ -446,12 +445,12 @@ interactions: ParameterSetName: - -l -g -n -u -p User-Agent: - - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-mgmt-sql/4.0.0b8 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/400f42d7-444e-4a9b-892b-80f2a12c74b0?api-version=2021-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/9f9dee4c-f5a6-4a44-8578-e18fd73dd8cb?api-version=2022-08-01-preview response: body: - string: '{"name":"400f42d7-444e-4a9b-892b-80f2a12c74b0","status":"InProgress","startTime":"2023-01-30T23:15:20.787Z"}' + string: '{"name":"9f9dee4c-f5a6-4a44-8578-e18fd73dd8cb","status":"InProgress","startTime":"2023-03-14T20:47:01.773Z"}' headers: cache-control: - no-cache @@ -460,7 +459,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 30 Jan 2023 23:15:23 GMT + - Tue, 14 Mar 2023 20:47:04 GMT expires: - '-1' pragma: @@ -492,12 +491,12 @@ interactions: ParameterSetName: - -l -g -n -u -p User-Agent: - - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-mgmt-sql/4.0.0b8 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/400f42d7-444e-4a9b-892b-80f2a12c74b0?api-version=2021-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/9f9dee4c-f5a6-4a44-8578-e18fd73dd8cb?api-version=2022-08-01-preview response: body: - string: '{"name":"400f42d7-444e-4a9b-892b-80f2a12c74b0","status":"InProgress","startTime":"2023-01-30T23:15:20.787Z"}' + string: '{"name":"9f9dee4c-f5a6-4a44-8578-e18fd73dd8cb","status":"InProgress","startTime":"2023-03-14T20:47:01.773Z"}' headers: cache-control: - no-cache @@ -506,7 +505,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 30 Jan 2023 23:15:25 GMT + - Tue, 14 Mar 2023 20:47:05 GMT expires: - '-1' pragma: @@ -538,12 +537,12 @@ interactions: ParameterSetName: - -l -g -n -u -p User-Agent: - - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-mgmt-sql/4.0.0b8 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/400f42d7-444e-4a9b-892b-80f2a12c74b0?api-version=2021-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/9f9dee4c-f5a6-4a44-8578-e18fd73dd8cb?api-version=2022-08-01-preview response: body: - string: '{"name":"400f42d7-444e-4a9b-892b-80f2a12c74b0","status":"InProgress","startTime":"2023-01-30T23:15:20.787Z"}' + string: '{"name":"9f9dee4c-f5a6-4a44-8578-e18fd73dd8cb","status":"InProgress","startTime":"2023-03-14T20:47:01.773Z"}' headers: cache-control: - no-cache @@ -552,7 +551,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 30 Jan 2023 23:15:26 GMT + - Tue, 14 Mar 2023 20:47:06 GMT expires: - '-1' pragma: @@ -584,12 +583,12 @@ interactions: ParameterSetName: - -l -g -n -u -p User-Agent: - - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-mgmt-sql/4.0.0b8 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/400f42d7-444e-4a9b-892b-80f2a12c74b0?api-version=2021-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/9f9dee4c-f5a6-4a44-8578-e18fd73dd8cb?api-version=2022-08-01-preview response: body: - string: '{"name":"400f42d7-444e-4a9b-892b-80f2a12c74b0","status":"InProgress","startTime":"2023-01-30T23:15:20.787Z"}' + string: '{"name":"9f9dee4c-f5a6-4a44-8578-e18fd73dd8cb","status":"InProgress","startTime":"2023-03-14T20:47:01.773Z"}' headers: cache-control: - no-cache @@ -598,7 +597,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 30 Jan 2023 23:15:46 GMT + - Tue, 14 Mar 2023 20:47:27 GMT expires: - '-1' pragma: @@ -630,12 +629,58 @@ interactions: ParameterSetName: - -l -g -n -u -p User-Agent: - - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-mgmt-sql/4.0.0b8 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/400f42d7-444e-4a9b-892b-80f2a12c74b0?api-version=2021-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/9f9dee4c-f5a6-4a44-8578-e18fd73dd8cb?api-version=2022-08-01-preview response: body: - string: '{"name":"400f42d7-444e-4a9b-892b-80f2a12c74b0","status":"Succeeded","startTime":"2023-01-30T23:15:20.787Z"}' + string: '{"name":"9f9dee4c-f5a6-4a44-8578-e18fd73dd8cb","status":"InProgress","startTime":"2023-03-14T20:47:01.773Z"}' + headers: + cache-control: + - no-cache + content-length: + - '108' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 14 Mar 2023 20:47:47 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - sql server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n -u -p + User-Agent: + - AZURECLI/2.46.0 azsdk-python-mgmt-sql/4.0.0b8 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/serverAzureAsyncOperation/9f9dee4c-f5a6-4a44-8578-e18fd73dd8cb?api-version=2022-08-01-preview + response: + body: + string: '{"name":"9f9dee4c-f5a6-4a44-8578-e18fd73dd8cb","status":"Succeeded","startTime":"2023-03-14T20:47:01.773Z"}' headers: cache-control: - no-cache @@ -644,7 +689,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 30 Jan 2023 23:16:07 GMT + - Tue, 14 Mar 2023 20:48:07 GMT expires: - '-1' pragma: @@ -676,21 +721,21 @@ interactions: ParameterSetName: - -l -g -n -u -p User-Agent: - - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-mgmt-sql/4.0.0b8 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003?api-version=2021-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003?api-version=2022-08-01-preview response: body: - string: '{"kind":"v12.0","properties":{"administratorLogin":"aturing","version":"12.0","state":"Ready","fullyQualifiedDomainName":"cli-test000003.database.windows.net","privateEndpointConnections":[],"publicNetworkAccess":"Enabled","restrictOutboundNetworkAccess":"Disabled"},"location":"westus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003","name":"cli-test000003","type":"Microsoft.Sql/servers"}' + string: '{"kind":"v12.0","properties":{"administratorLogin":"aturing","version":"12.0","state":"Ready","fullyQualifiedDomainName":"cli-test000003.database.windows.net","privateEndpointConnections":[],"publicNetworkAccess":"Enabled","restrictOutboundNetworkAccess":"Disabled","externalGovernanceStatus":"Disabled"},"location":"westus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003","name":"cli-test000003","type":"Microsoft.Sql/servers"}' headers: cache-control: - no-cache content-length: - - '478' + - '516' content-type: - application/json; charset=utf-8 date: - - Mon, 30 Jan 2023 23:16:07 GMT + - Tue, 14 Mar 2023 20:48:07 GMT expires: - '-1' pragma: @@ -722,21 +767,21 @@ interactions: ParameterSetName: - -g -n -s User-Agent: - - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-mgmt-sql/4.0.0b8 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003?api-version=2021-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003?api-version=2022-08-01-preview response: body: - string: '{"kind":"v12.0","properties":{"administratorLogin":"aturing","version":"12.0","state":"Ready","fullyQualifiedDomainName":"cli-test000003.database.windows.net","privateEndpointConnections":[],"publicNetworkAccess":"Enabled","restrictOutboundNetworkAccess":"Disabled"},"location":"westus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003","name":"cli-test000003","type":"Microsoft.Sql/servers"}' + string: '{"kind":"v12.0","properties":{"administratorLogin":"aturing","version":"12.0","state":"Ready","fullyQualifiedDomainName":"cli-test000003.database.windows.net","privateEndpointConnections":[],"publicNetworkAccess":"Enabled","restrictOutboundNetworkAccess":"Disabled","externalGovernanceStatus":"Disabled"},"location":"westus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003","name":"cli-test000003","type":"Microsoft.Sql/servers"}' headers: cache-control: - no-cache content-length: - - '478' + - '516' content-type: - application/json; charset=utf-8 date: - - Mon, 30 Jan 2023 23:16:08 GMT + - Tue, 14 Mar 2023 20:48:08 GMT expires: - '-1' pragma: @@ -768,21 +813,21 @@ interactions: ParameterSetName: - -g -n -s User-Agent: - - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-mgmt-sql/4.0.0b8 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003?api-version=2021-02-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003?api-version=2022-08-01-preview response: body: - string: '{"kind":"v12.0","properties":{"administratorLogin":"aturing","version":"12.0","state":"Ready","fullyQualifiedDomainName":"cli-test000003.database.windows.net","privateEndpointConnections":[],"publicNetworkAccess":"Enabled","restrictOutboundNetworkAccess":"Disabled"},"location":"westus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003","name":"cli-test000003","type":"Microsoft.Sql/servers"}' + string: '{"kind":"v12.0","properties":{"administratorLogin":"aturing","version":"12.0","state":"Ready","fullyQualifiedDomainName":"cli-test000003.database.windows.net","privateEndpointConnections":[],"publicNetworkAccess":"Enabled","restrictOutboundNetworkAccess":"Disabled","externalGovernanceStatus":"Disabled"},"location":"westus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003","name":"cli-test000003","type":"Microsoft.Sql/servers"}' headers: cache-control: - no-cache content-length: - - '478' + - '516' content-type: - application/json; charset=utf-8 date: - - Mon, 30 Jan 2023 23:16:09 GMT + - Tue, 14 Mar 2023 20:48:10 GMT expires: - '-1' pragma: @@ -818,27 +863,27 @@ interactions: ParameterSetName: - -g -n -s User-Agent: - - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-mgmt-sql/4.0.0b8 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003/databases/tables?api-version=2022-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003/databases/tables?api-version=2022-08-01-preview response: body: - string: '{"operation":"CreateLogicalDatabase","startTime":"2023-01-30T23:16:10.16Z"}' + string: '{"operation":"CreateLogicalDatabase","startTime":"2023-03-14T20:48:12.413Z"}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseAzureAsyncOperation/d64e242f-24ec-4627-9c34-b82e2e6d4ffa?api-version=2022-05-01-preview + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseAzureAsyncOperation/f8bae546-952f-40de-938d-81fcb5da5372?api-version=2022-08-01-preview cache-control: - no-cache content-length: - - '75' + - '76' content-type: - application/json; charset=utf-8 date: - - Mon, 30 Jan 2023 23:16:10 GMT + - Tue, 14 Mar 2023 20:48:12 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseOperationResults/d64e242f-24ec-4627-9c34-b82e2e6d4ffa?api-version=2022-05-01-preview + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseOperationResults/f8bae546-952f-40de-938d-81fcb5da5372?api-version=2022-08-01-preview pragma: - no-cache server: @@ -866,21 +911,21 @@ interactions: ParameterSetName: - -g -n -s User-Agent: - - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-mgmt-sql/4.0.0b8 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseAzureAsyncOperation/d64e242f-24ec-4627-9c34-b82e2e6d4ffa?api-version=2022-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseAzureAsyncOperation/f8bae546-952f-40de-938d-81fcb5da5372?api-version=2022-08-01-preview response: body: - string: '{"name":"d64e242f-24ec-4627-9c34-b82e2e6d4ffa","status":"InProgress","startTime":"2023-01-30T23:16:10.16Z"}' + string: '{"name":"f8bae546-952f-40de-938d-81fcb5da5372","status":"InProgress","startTime":"2023-03-14T20:48:12.413Z"}' headers: cache-control: - no-cache content-length: - - '107' + - '108' content-type: - application/json; charset=utf-8 date: - - Mon, 30 Jan 2023 23:16:25 GMT + - Tue, 14 Mar 2023 20:48:26 GMT expires: - '-1' pragma: @@ -912,21 +957,21 @@ interactions: ParameterSetName: - -g -n -s User-Agent: - - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-mgmt-sql/4.0.0b8 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseAzureAsyncOperation/d64e242f-24ec-4627-9c34-b82e2e6d4ffa?api-version=2022-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseAzureAsyncOperation/f8bae546-952f-40de-938d-81fcb5da5372?api-version=2022-08-01-preview response: body: - string: '{"name":"d64e242f-24ec-4627-9c34-b82e2e6d4ffa","status":"InProgress","startTime":"2023-01-30T23:16:10.16Z"}' + string: '{"name":"f8bae546-952f-40de-938d-81fcb5da5372","status":"InProgress","startTime":"2023-03-14T20:48:12.413Z"}' headers: cache-control: - no-cache content-length: - - '107' + - '108' content-type: - application/json; charset=utf-8 date: - - Mon, 30 Jan 2023 23:16:40 GMT + - Tue, 14 Mar 2023 20:48:42 GMT expires: - '-1' pragma: @@ -958,21 +1003,21 @@ interactions: ParameterSetName: - -g -n -s User-Agent: - - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-mgmt-sql/4.0.0b8 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseAzureAsyncOperation/d64e242f-24ec-4627-9c34-b82e2e6d4ffa?api-version=2022-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseAzureAsyncOperation/f8bae546-952f-40de-938d-81fcb5da5372?api-version=2022-08-01-preview response: body: - string: '{"name":"d64e242f-24ec-4627-9c34-b82e2e6d4ffa","status":"InProgress","startTime":"2023-01-30T23:16:10.16Z"}' + string: '{"name":"f8bae546-952f-40de-938d-81fcb5da5372","status":"InProgress","startTime":"2023-03-14T20:48:12.413Z"}' headers: cache-control: - no-cache content-length: - - '107' + - '108' content-type: - application/json; charset=utf-8 date: - - Mon, 30 Jan 2023 23:16:55 GMT + - Tue, 14 Mar 2023 20:48:57 GMT expires: - '-1' pragma: @@ -1004,21 +1049,21 @@ interactions: ParameterSetName: - -g -n -s User-Agent: - - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-mgmt-sql/4.0.0b8 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseAzureAsyncOperation/d64e242f-24ec-4627-9c34-b82e2e6d4ffa?api-version=2022-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/locations/westus/databaseAzureAsyncOperation/f8bae546-952f-40de-938d-81fcb5da5372?api-version=2022-08-01-preview response: body: - string: '{"name":"d64e242f-24ec-4627-9c34-b82e2e6d4ffa","status":"Succeeded","startTime":"2023-01-30T23:16:10.16Z"}' + string: '{"name":"f8bae546-952f-40de-938d-81fcb5da5372","status":"Succeeded","startTime":"2023-03-14T20:48:12.413Z"}' headers: cache-control: - no-cache content-length: - - '106' + - '107' content-type: - application/json; charset=utf-8 date: - - Mon, 30 Jan 2023 23:17:10 GMT + - Tue, 14 Mar 2023 20:49:13 GMT expires: - '-1' pragma: @@ -1050,21 +1095,21 @@ interactions: ParameterSetName: - -g -n -s User-Agent: - - AZURECLI/2.44.1 azsdk-python-mgmt-sql/4.0.0b6 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-mgmt-sql/4.0.0b8 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003/databases/tables?api-version=2022-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003/databases/tables?api-version=2022-08-01-preview response: body: - string: '{"sku":{"name":"GP_Gen5","tier":"GeneralPurpose","family":"Gen5","capacity":2},"kind":"v12.0,user,vcore","properties":{"collation":"SQL_Latin1_General_CP1_CI_AS","maxSizeBytes":34359738368,"status":"Online","databaseId":"37cc4410-5db8-43b7-bffa-72c0e674ce4f","creationDate":"2023-01-30T23:16:54.863Z","currentServiceObjectiveName":"GP_Gen5_2","requestedServiceObjectiveName":"GP_Gen5_2","defaultSecondaryLocation":"eastus","catalogCollation":"SQL_Latin1_General_CP1_CI_AS","zoneRedundant":false,"licenseType":"LicenseIncluded","maxLogSizeBytes":193273528320,"readScale":"Disabled","currentSku":{"name":"GP_Gen5","tier":"GeneralPurpose","family":"Gen5","capacity":2},"currentBackupStorageRedundancy":"Geo","requestedBackupStorageRedundancy":"Geo","maintenanceConfigurationId":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default","isLedgerOn":false,"isInfraEncryptionEnabled":false},"location":"westus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003/databases/tables","name":"tables","type":"Microsoft.Sql/servers/databases"}' + string: '{"sku":{"name":"GP_Gen5","tier":"GeneralPurpose","family":"Gen5","capacity":2},"kind":"v12.0,user,vcore","properties":{"collation":"SQL_Latin1_General_CP1_CI_AS","maxSizeBytes":34359738368,"status":"Online","databaseId":"3467db4c-f088-412c-ba7e-8b8710af6e76","creationDate":"2023-03-14T20:49:05.21Z","currentServiceObjectiveName":"GP_Gen5_2","requestedServiceObjectiveName":"GP_Gen5_2","defaultSecondaryLocation":"eastus","catalogCollation":"SQL_Latin1_General_CP1_CI_AS","zoneRedundant":false,"licenseType":"LicenseIncluded","maxLogSizeBytes":193273528320,"readScale":"Disabled","currentSku":{"name":"GP_Gen5","tier":"GeneralPurpose","family":"Gen5","capacity":2},"currentBackupStorageRedundancy":"Geo","requestedBackupStorageRedundancy":"Geo","maintenanceConfigurationId":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default","isLedgerOn":false,"isInfraEncryptionEnabled":false,"availabilityZone":"NoPreference"},"location":"westus","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003/databases/tables","name":"tables","type":"Microsoft.Sql/servers/databases"}' headers: cache-control: - no-cache content-length: - - '1188' + - '1221' content-type: - application/json; charset=utf-8 date: - - Mon, 30 Jan 2023 23:17:11 GMT + - Tue, 14 Mar 2023 20:49:14 GMT expires: - '-1' pragma: @@ -1096,22 +1141,22 @@ interactions: ParameterSetName: - -n -g -u -p -d -b User-Agent: - - AZURECLI/2.44.1 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central - US","properties":{"defaultHostname":"red-desert-04090d810.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":"20.98.190.171","privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + US","properties":{"defaultHostname":"ambitious-sand-047071c10.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":"20.84.233.22","privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[],"trafficSplitting":null},"sku":{"name":"Free","tier":"Free"}}' headers: cache-control: - no-cache content-length: - - '819' + - '846' content-type: - application/json date: - - Mon, 30 Jan 2023 23:17:12 GMT + - Tue, 14 Mar 2023 20:49:15 GMT expires: - '-1' pragma: @@ -1147,7 +1192,7 @@ interactions: ParameterSetName: - -n -g -u -p -d -b User-Agent: - - python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) AZURECLI/2.44.1 + - python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) AZURECLI/2.46.0 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003?api-version=2021-11-01 response: @@ -1161,7 +1206,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 30 Jan 2023 23:17:13 GMT + - Tue, 14 Mar 2023 20:49:15 GMT expires: - '-1' pragma: @@ -1182,7 +1227,7 @@ interactions: - request: body: '{"properties": {"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Sql/servers/cli-test000003", "connectionIdentity": null, "region": "westus", "connectionString": "Server=tcp:cli-test000003.database.windows.net,1433;Database=tables;User - ID=aturing;Password=thisisapassword123!;Encrypt=true;Connection Timeout=30;"}}' + ID=aturing;Password=thisisapassword123!;"}}' headers: Accept: - '*/*' @@ -1193,13 +1238,13 @@ interactions: Connection: - keep-alive Content-Length: - - '382' + - '347' Content-Type: - application/json ParameterSetName: - -n -g -u -p -d -b User-Agent: - - python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) AZURECLI/2.44.1 + - python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) AZURECLI/2.46.0 method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticsites/cli_test000002/databaseConnections/default?api-version=2022-03-01 response: @@ -1215,7 +1260,7 @@ interactions: content-type: - application/json date: - - Mon, 30 Jan 2023 23:17:15 GMT + - Tue, 14 Mar 2023 20:49:18 GMT expires: - '-1' pragma: diff --git a/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_cosmosdb.yaml b/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_cosmosdb.yaml index 217989da106..7ee04959a0a 100644 --- a/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_cosmosdb.yaml +++ b/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_cosmosdb.yaml @@ -11,9 +11,9 @@ interactions: Connection: - keep-alive ParameterSetName: - - -n -g + - -n -g -l User-Agent: - - AZURECLI/2.44.1 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 response: @@ -29,7 +29,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 30 Jan 2023 23:15:13 GMT + - Tue, 14 Mar 2023 20:52:56 GMT expires: - '-1' pragma: @@ -60,24 +60,24 @@ interactions: Content-Type: - application/json ParameterSetName: - - -n -g + - -n -g -l User-Agent: - - AZURECLI/2.44.1 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central - US","properties":{"defaultHostname":"kind-tree-0d7dc9c10.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":"20.84.233.22","privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + US","properties":{"defaultHostname":"blue-pebble-01433e310.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":"20.98.190.171","privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[],"trafficSplitting":null},"sku":{"name":"Free","tier":"Free"}}' headers: cache-control: - no-cache content-length: - - '817' + - '844' content-type: - application/json date: - - Mon, 30 Jan 2023 23:15:16 GMT + - Tue, 14 Mar 2023 20:52:58 GMT expires: - '-1' pragma: @@ -95,7 +95,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' x-powered-by: - ASP.NET status: @@ -113,24 +113,24 @@ interactions: Connection: - keep-alive ParameterSetName: - - -n -g + - -n -g -l User-Agent: - - AZURECLI/2.44.1 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central - US","properties":{"defaultHostname":"kind-tree-0d7dc9c10.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":"20.84.233.22","privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + US","properties":{"defaultHostname":"blue-pebble-01433e310.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":"20.98.190.171","privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[],"trafficSplitting":null},"sku":{"name":"Free","tier":"Free"}}' headers: cache-control: - no-cache content-length: - - '817' + - '844' content-type: - application/json date: - - Mon, 30 Jan 2023 23:15:16 GMT + - Tue, 14 Mar 2023 20:52:59 GMT expires: - '-1' pragma: @@ -166,12 +166,12 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.44.1 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001","name":"cli_test000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2023-01-30T23:15:08Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001","name":"cli_test000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2023-03-14T20:52:55Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -180,7 +180,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 30 Jan 2023 23:15:17 GMT + - Tue, 14 Mar 2023 20:53:01 GMT expires: - '-1' pragma: @@ -214,30 +214,30 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.44.1 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-mgmt-cosmosdb/9.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003?api-version=2022-08-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003?api-version=2022-11-15 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003","name":"cli-test000003","location":"West - US","type":"Microsoft.DocumentDB/databaseAccounts","kind":"GlobalDocumentDB","tags":{},"systemData":{"createdAt":"2023-01-30T23:15:22.6963118Z"},"properties":{"provisioningState":"Creating","publicNetworkAccess":"Enabled","enableAutomaticFailover":false,"enableMultipleWriteLocations":false,"enablePartitionKeyMonitor":false,"isVirtualNetworkFilterEnabled":false,"virtualNetworkRules":[],"EnabledApiTypes":"Sql","disableKeyBasedMetadataWriteAccess":false,"enableFreeTier":false,"enableAnalyticalStorage":false,"analyticalStorageConfiguration":{"schemaType":"WellDefined"},"instanceId":"5628dcd8-b098-4b95-b5d1-c5f55e061d78","databaseAccountOfferType":"Standard","defaultIdentity":"","networkAclBypass":"None","disableLocalAuth":false,"enablePartitionMerge":false,"consistencyPolicy":{"defaultConsistencyLevel":"Session","maxIntervalInSeconds":5,"maxStalenessPrefix":100},"configurationOverrides":{},"writeLocations":[{"id":"cli-test000003-westus","locationName":"West + US","type":"Microsoft.DocumentDB/databaseAccounts","kind":"GlobalDocumentDB","tags":{},"systemData":{"createdAt":"2023-03-14T20:53:06.5766135Z"},"properties":{"provisioningState":"Creating","publicNetworkAccess":"Enabled","enableAutomaticFailover":false,"enableMultipleWriteLocations":false,"enablePartitionKeyMonitor":false,"isVirtualNetworkFilterEnabled":false,"virtualNetworkRules":[],"EnabledApiTypes":"Sql","disableKeyBasedMetadataWriteAccess":false,"enableFreeTier":false,"enableAnalyticalStorage":false,"analyticalStorageConfiguration":{"schemaType":"WellDefined"},"instanceId":"e8ba36ef-b56b-4455-bc88-2490a142b386","databaseAccountOfferType":"Standard","defaultIdentity":"","networkAclBypass":"None","disableLocalAuth":false,"enablePartitionMerge":false,"minimalTlsVersion":"Tls","consistencyPolicy":{"defaultConsistencyLevel":"Session","maxIntervalInSeconds":5,"maxStalenessPrefix":100},"configurationOverrides":{},"writeLocations":[{"id":"cli-test000003-westus","locationName":"West US","provisioningState":"Creating","failoverPriority":0,"isZoneRedundant":false}],"readLocations":[{"id":"cli-test000003-westus","locationName":"West US","provisioningState":"Creating","failoverPriority":0,"isZoneRedundant":false}],"locations":[{"id":"cli-test000003-westus","locationName":"West US","provisioningState":"Creating","failoverPriority":0,"isZoneRedundant":false}],"failoverPolicies":[{"id":"cli-test000003-westus","locationName":"West - US","failoverPriority":0}],"cors":[],"capabilities":[],"ipRules":[],"backupPolicy":{"type":"Periodic","periodicModeProperties":{"backupIntervalInMinutes":240,"backupRetentionIntervalInHours":8,"backupStorageRedundancy":"Invalid"}},"networkAclBypassResourceIds":[],"keysMetadata":{"primaryMasterKey":{"generationTime":"2023-01-30T23:15:22.6963118Z"},"secondaryMasterKey":{"generationTime":"2023-01-30T23:15:22.6963118Z"},"primaryReadonlyMasterKey":{"generationTime":"2023-01-30T23:15:22.6963118Z"},"secondaryReadonlyMasterKey":{"generationTime":"2023-01-30T23:15:22.6963118Z"}}},"identity":{"type":"None"}}' + US","failoverPriority":0}],"cors":[],"capabilities":[],"ipRules":[],"backupPolicy":{"type":"Periodic","periodicModeProperties":{"backupIntervalInMinutes":240,"backupRetentionIntervalInHours":8,"backupStorageRedundancy":"Invalid"}},"networkAclBypassResourceIds":[],"keysMetadata":{"primaryMasterKey":{"generationTime":"2023-03-14T20:53:06.5766135Z"},"secondaryMasterKey":{"generationTime":"2023-03-14T20:53:06.5766135Z"},"primaryReadonlyMasterKey":{"generationTime":"2023-03-14T20:53:06.5766135Z"},"secondaryReadonlyMasterKey":{"generationTime":"2023-03-14T20:53:06.5766135Z"}}},"identity":{"type":"None"}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westus/operationsStatus/611ff26c-a0b6-40f3-8d18-cfb3e2119754?api-version=2022-08-15 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westus/operationsStatus/b601553f-ad39-48dd-9399-5aecc55d1c2c?api-version=2022-11-15 cache-control: - no-store, no-cache content-length: - - '2216' + - '2242' content-type: - application/json date: - - Mon, 30 Jan 2023 23:15:24 GMT + - Tue, 14 Mar 2023 20:53:08 GMT location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003/operationResults/611ff26c-a0b6-40f3-8d18-cfb3e2119754?api-version=2022-08-15 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003/operationResults/b601553f-ad39-48dd-9399-5aecc55d1c2c?api-version=2022-11-15 pragma: - no-cache server: @@ -271,9 +271,9 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.44.1 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-mgmt-cosmosdb/9.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westus/operationsStatus/611ff26c-a0b6-40f3-8d18-cfb3e2119754?api-version=2022-08-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westus/operationsStatus/b601553f-ad39-48dd-9399-5aecc55d1c2c?api-version=2022-11-15 response: body: string: '{"status":"Dequeued"}' @@ -285,7 +285,7 @@ interactions: content-type: - application/json date: - - Mon, 30 Jan 2023 23:15:55 GMT + - Tue, 14 Mar 2023 20:53:38 GMT pragma: - no-cache server: @@ -317,9 +317,9 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.44.1 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-mgmt-cosmosdb/9.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westus/operationsStatus/611ff26c-a0b6-40f3-8d18-cfb3e2119754?api-version=2022-08-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westus/operationsStatus/b601553f-ad39-48dd-9399-5aecc55d1c2c?api-version=2022-11-15 response: body: string: '{"status":"Dequeued"}' @@ -331,7 +331,7 @@ interactions: content-type: - application/json date: - - Mon, 30 Jan 2023 23:16:25 GMT + - Tue, 14 Mar 2023 20:54:08 GMT pragma: - no-cache server: @@ -363,9 +363,9 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.44.1 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-mgmt-cosmosdb/9.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westus/operationsStatus/611ff26c-a0b6-40f3-8d18-cfb3e2119754?api-version=2022-08-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westus/operationsStatus/b601553f-ad39-48dd-9399-5aecc55d1c2c?api-version=2022-11-15 response: body: string: '{"status":"Dequeued"}' @@ -377,7 +377,7 @@ interactions: content-type: - application/json date: - - Mon, 30 Jan 2023 23:16:55 GMT + - Tue, 14 Mar 2023 20:54:39 GMT pragma: - no-cache server: @@ -409,9 +409,9 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.44.1 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-mgmt-cosmosdb/9.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westus/operationsStatus/611ff26c-a0b6-40f3-8d18-cfb3e2119754?api-version=2022-08-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westus/operationsStatus/b601553f-ad39-48dd-9399-5aecc55d1c2c?api-version=2022-11-15 response: body: string: '{"status":"Succeeded"}' @@ -423,7 +423,7 @@ interactions: content-type: - application/json date: - - Mon, 30 Jan 2023 23:17:26 GMT + - Tue, 14 Mar 2023 20:55:09 GMT pragma: - no-cache server: @@ -455,26 +455,26 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.44.1 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-mgmt-cosmosdb/9.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003?api-version=2022-08-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003?api-version=2022-11-15 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003","name":"cli-test000003","location":"West - US","type":"Microsoft.DocumentDB/databaseAccounts","kind":"GlobalDocumentDB","tags":{},"systemData":{"createdAt":"2023-01-30T23:16:49.5946062Z"},"properties":{"provisioningState":"Succeeded","documentEndpoint":"https://cli-test000003.documents.azure.com:443/","sqlEndpoint":"https://cli-test000003.documents.azure.com:443/","publicNetworkAccess":"Enabled","enableAutomaticFailover":false,"enableMultipleWriteLocations":false,"enablePartitionKeyMonitor":false,"isVirtualNetworkFilterEnabled":false,"virtualNetworkRules":[],"EnabledApiTypes":"Sql","disableKeyBasedMetadataWriteAccess":false,"enableFreeTier":false,"enableAnalyticalStorage":false,"analyticalStorageConfiguration":{"schemaType":"WellDefined"},"instanceId":"5628dcd8-b098-4b95-b5d1-c5f55e061d78","databaseAccountOfferType":"Standard","defaultIdentity":"FirstPartyIdentity","networkAclBypass":"None","disableLocalAuth":false,"enablePartitionMerge":false,"consistencyPolicy":{"defaultConsistencyLevel":"Session","maxIntervalInSeconds":5,"maxStalenessPrefix":100},"configurationOverrides":{},"writeLocations":[{"id":"cli-test000003-westus","locationName":"West + US","type":"Microsoft.DocumentDB/databaseAccounts","kind":"GlobalDocumentDB","tags":{},"systemData":{"createdAt":"2023-03-14T20:54:30.6226076Z"},"properties":{"provisioningState":"Succeeded","documentEndpoint":"https://cli-test000003.documents.azure.com:443/","sqlEndpoint":"https://cli-test000003.documents.azure.com:443/","publicNetworkAccess":"Enabled","enableAutomaticFailover":false,"enableMultipleWriteLocations":false,"enablePartitionKeyMonitor":false,"isVirtualNetworkFilterEnabled":false,"virtualNetworkRules":[],"EnabledApiTypes":"Sql","disableKeyBasedMetadataWriteAccess":false,"enableFreeTier":false,"enableAnalyticalStorage":false,"analyticalStorageConfiguration":{"schemaType":"WellDefined"},"instanceId":"e8ba36ef-b56b-4455-bc88-2490a142b386","databaseAccountOfferType":"Standard","defaultIdentity":"FirstPartyIdentity","networkAclBypass":"None","disableLocalAuth":false,"enablePartitionMerge":false,"minimalTlsVersion":"Tls","consistencyPolicy":{"defaultConsistencyLevel":"Session","maxIntervalInSeconds":5,"maxStalenessPrefix":100},"configurationOverrides":{},"writeLocations":[{"id":"cli-test000003-westus","locationName":"West US","documentEndpoint":"https://cli-test000003-westus.documents.azure.com:443/","provisioningState":"Succeeded","failoverPriority":0,"isZoneRedundant":false}],"readLocations":[{"id":"cli-test000003-westus","locationName":"West US","documentEndpoint":"https://cli-test000003-westus.documents.azure.com:443/","provisioningState":"Succeeded","failoverPriority":0,"isZoneRedundant":false}],"locations":[{"id":"cli-test000003-westus","locationName":"West US","documentEndpoint":"https://cli-test000003-westus.documents.azure.com:443/","provisioningState":"Succeeded","failoverPriority":0,"isZoneRedundant":false}],"failoverPolicies":[{"id":"cli-test000003-westus","locationName":"West - US","failoverPriority":0}],"cors":[],"capabilities":[],"ipRules":[],"backupPolicy":{"type":"Periodic","periodicModeProperties":{"backupIntervalInMinutes":240,"backupRetentionIntervalInHours":8,"backupStorageRedundancy":"Geo"}},"networkAclBypassResourceIds":[],"keysMetadata":{"primaryMasterKey":{"generationTime":"2023-01-30T23:16:49.5946062Z"},"secondaryMasterKey":{"generationTime":"2023-01-30T23:16:49.5946062Z"},"primaryReadonlyMasterKey":{"generationTime":"2023-01-30T23:16:49.5946062Z"},"secondaryReadonlyMasterKey":{"generationTime":"2023-01-30T23:16:49.5946062Z"}}},"identity":{"type":"None"}}' + US","failoverPriority":0}],"cors":[],"capabilities":[],"ipRules":[],"backupPolicy":{"type":"Periodic","periodicModeProperties":{"backupIntervalInMinutes":240,"backupRetentionIntervalInHours":8,"backupStorageRedundancy":"Geo"}},"networkAclBypassResourceIds":[],"keysMetadata":{"primaryMasterKey":{"generationTime":"2023-03-14T20:54:30.6226076Z"},"secondaryMasterKey":{"generationTime":"2023-03-14T20:54:30.6226076Z"},"primaryReadonlyMasterKey":{"generationTime":"2023-03-14T20:54:30.6226076Z"},"secondaryReadonlyMasterKey":{"generationTime":"2023-03-14T20:54:30.6226076Z"}}},"identity":{"type":"None"}}' headers: cache-control: - no-store, no-cache content-length: - - '2595' + - '2621' content-type: - application/json date: - - Mon, 30 Jan 2023 23:17:26 GMT + - Tue, 14 Mar 2023 20:55:09 GMT pragma: - no-cache server: @@ -506,26 +506,26 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.44.1 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-mgmt-cosmosdb/9.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003?api-version=2022-08-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003?api-version=2022-11-15 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003","name":"cli-test000003","location":"West - US","type":"Microsoft.DocumentDB/databaseAccounts","kind":"GlobalDocumentDB","tags":{},"systemData":{"createdAt":"2023-01-30T23:16:49.5946062Z"},"properties":{"provisioningState":"Succeeded","documentEndpoint":"https://cli-test000003.documents.azure.com:443/","sqlEndpoint":"https://cli-test000003.documents.azure.com:443/","publicNetworkAccess":"Enabled","enableAutomaticFailover":false,"enableMultipleWriteLocations":false,"enablePartitionKeyMonitor":false,"isVirtualNetworkFilterEnabled":false,"virtualNetworkRules":[],"EnabledApiTypes":"Sql","disableKeyBasedMetadataWriteAccess":false,"enableFreeTier":false,"enableAnalyticalStorage":false,"analyticalStorageConfiguration":{"schemaType":"WellDefined"},"instanceId":"5628dcd8-b098-4b95-b5d1-c5f55e061d78","databaseAccountOfferType":"Standard","defaultIdentity":"FirstPartyIdentity","networkAclBypass":"None","disableLocalAuth":false,"enablePartitionMerge":false,"consistencyPolicy":{"defaultConsistencyLevel":"Session","maxIntervalInSeconds":5,"maxStalenessPrefix":100},"configurationOverrides":{},"writeLocations":[{"id":"cli-test000003-westus","locationName":"West + US","type":"Microsoft.DocumentDB/databaseAccounts","kind":"GlobalDocumentDB","tags":{},"systemData":{"createdAt":"2023-03-14T20:54:30.6226076Z"},"properties":{"provisioningState":"Succeeded","documentEndpoint":"https://cli-test000003.documents.azure.com:443/","sqlEndpoint":"https://cli-test000003.documents.azure.com:443/","publicNetworkAccess":"Enabled","enableAutomaticFailover":false,"enableMultipleWriteLocations":false,"enablePartitionKeyMonitor":false,"isVirtualNetworkFilterEnabled":false,"virtualNetworkRules":[],"EnabledApiTypes":"Sql","disableKeyBasedMetadataWriteAccess":false,"enableFreeTier":false,"enableAnalyticalStorage":false,"analyticalStorageConfiguration":{"schemaType":"WellDefined"},"instanceId":"e8ba36ef-b56b-4455-bc88-2490a142b386","databaseAccountOfferType":"Standard","defaultIdentity":"FirstPartyIdentity","networkAclBypass":"None","disableLocalAuth":false,"enablePartitionMerge":false,"minimalTlsVersion":"Tls","consistencyPolicy":{"defaultConsistencyLevel":"Session","maxIntervalInSeconds":5,"maxStalenessPrefix":100},"configurationOverrides":{},"writeLocations":[{"id":"cli-test000003-westus","locationName":"West US","documentEndpoint":"https://cli-test000003-westus.documents.azure.com:443/","provisioningState":"Succeeded","failoverPriority":0,"isZoneRedundant":false}],"readLocations":[{"id":"cli-test000003-westus","locationName":"West US","documentEndpoint":"https://cli-test000003-westus.documents.azure.com:443/","provisioningState":"Succeeded","failoverPriority":0,"isZoneRedundant":false}],"locations":[{"id":"cli-test000003-westus","locationName":"West US","documentEndpoint":"https://cli-test000003-westus.documents.azure.com:443/","provisioningState":"Succeeded","failoverPriority":0,"isZoneRedundant":false}],"failoverPolicies":[{"id":"cli-test000003-westus","locationName":"West - US","failoverPriority":0}],"cors":[],"capabilities":[],"ipRules":[],"backupPolicy":{"type":"Periodic","periodicModeProperties":{"backupIntervalInMinutes":240,"backupRetentionIntervalInHours":8,"backupStorageRedundancy":"Geo"}},"networkAclBypassResourceIds":[],"keysMetadata":{"primaryMasterKey":{"generationTime":"2023-01-30T23:16:49.5946062Z"},"secondaryMasterKey":{"generationTime":"2023-01-30T23:16:49.5946062Z"},"primaryReadonlyMasterKey":{"generationTime":"2023-01-30T23:16:49.5946062Z"},"secondaryReadonlyMasterKey":{"generationTime":"2023-01-30T23:16:49.5946062Z"}}},"identity":{"type":"None"}}' + US","failoverPriority":0}],"cors":[],"capabilities":[],"ipRules":[],"backupPolicy":{"type":"Periodic","periodicModeProperties":{"backupIntervalInMinutes":240,"backupRetentionIntervalInHours":8,"backupStorageRedundancy":"Geo"}},"networkAclBypassResourceIds":[],"keysMetadata":{"primaryMasterKey":{"generationTime":"2023-03-14T20:54:30.6226076Z"},"secondaryMasterKey":{"generationTime":"2023-03-14T20:54:30.6226076Z"},"primaryReadonlyMasterKey":{"generationTime":"2023-03-14T20:54:30.6226076Z"},"secondaryReadonlyMasterKey":{"generationTime":"2023-03-14T20:54:30.6226076Z"}}},"identity":{"type":"None"}}' headers: cache-control: - no-store, no-cache content-length: - - '2595' + - '2621' content-type: - application/json date: - - Mon, 30 Jan 2023 23:17:26 GMT + - Tue, 14 Mar 2023 20:55:09 GMT pragma: - no-cache server: @@ -557,22 +557,22 @@ interactions: ParameterSetName: - -n -g -d User-Agent: - - AZURECLI/2.44.1 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-azure-mgmt-web/7.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002?api-version=2022-03-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticSites/cli_test000002","name":"cli_test000002","type":"Microsoft.Web/staticSites","location":"Central - US","properties":{"defaultHostname":"kind-tree-0d7dc9c10.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":"20.84.233.22","privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[]},"sku":{"name":"Free","tier":"Free"}}' + US","properties":{"defaultHostname":"blue-pebble-01433e310.2.azurestaticapps.net","repositoryUrl":null,"branch":null,"customDomains":[],"stableInboundIP":"20.98.190.171","privateEndpointConnections":[],"stagingEnvironmentPolicy":"Enabled","allowConfigFileUpdates":true,"contentDistributionEndpoint":"https://content-dm1.infrastructure.2.azurestaticapps.net","keyVaultReferenceIdentity":"SystemAssigned","userProvidedFunctionApps":null,"linkedBackends":[],"provider":"None","enterpriseGradeCdnStatus":"Disabled","publicNetworkAccess":null,"databaseConnections":[],"trafficSplitting":null},"sku":{"name":"Free","tier":"Free"}}' headers: cache-control: - no-cache content-length: - - '817' + - '844' content-type: - application/json date: - - Mon, 30 Jan 2023 23:17:27 GMT + - Tue, 14 Mar 2023 20:55:10 GMT expires: - '-1' pragma: @@ -608,13 +608,13 @@ interactions: ParameterSetName: - -n -g -d User-Agent: - - python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) AZURECLI/2.44.1 + - python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) AZURECLI/2.46.0 method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003?api-version=2021-10-15 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003","name":"cli-test000003","location":"West - US","type":"Microsoft.DocumentDB/databaseAccounts","kind":"GlobalDocumentDB","tags":{},"systemData":{"createdAt":"2023-01-30T23:16:49.5946062Z"},"properties":{"provisioningState":"Succeeded","documentEndpoint":"https://cli-test000003.documents.azure.com:443/","sqlEndpoint":"https://cli-test000003.documents.azure.com:443/","publicNetworkAccess":"Enabled","enableAutomaticFailover":false,"enableMultipleWriteLocations":false,"enablePartitionKeyMonitor":false,"isVirtualNetworkFilterEnabled":false,"virtualNetworkRules":[],"EnabledApiTypes":"Sql","disableKeyBasedMetadataWriteAccess":false,"enableFreeTier":false,"enableAnalyticalStorage":false,"analyticalStorageConfiguration":{"schemaType":"WellDefined"},"instanceId":"5628dcd8-b098-4b95-b5d1-c5f55e061d78","databaseAccountOfferType":"Standard","defaultIdentity":"FirstPartyIdentity","networkAclBypass":"None","disableLocalAuth":false,"consistencyPolicy":{"defaultConsistencyLevel":"Session","maxIntervalInSeconds":5,"maxStalenessPrefix":100},"configurationOverrides":{},"writeLocations":[{"id":"cli-test000003-westus","locationName":"West + US","type":"Microsoft.DocumentDB/databaseAccounts","kind":"GlobalDocumentDB","tags":{},"systemData":{"createdAt":"2023-03-14T20:54:30.6226076Z"},"properties":{"provisioningState":"Succeeded","documentEndpoint":"https://cli-test000003.documents.azure.com:443/","sqlEndpoint":"https://cli-test000003.documents.azure.com:443/","publicNetworkAccess":"Enabled","enableAutomaticFailover":false,"enableMultipleWriteLocations":false,"enablePartitionKeyMonitor":false,"isVirtualNetworkFilterEnabled":false,"virtualNetworkRules":[],"EnabledApiTypes":"Sql","disableKeyBasedMetadataWriteAccess":false,"enableFreeTier":false,"enableAnalyticalStorage":false,"analyticalStorageConfiguration":{"schemaType":"WellDefined"},"instanceId":"e8ba36ef-b56b-4455-bc88-2490a142b386","databaseAccountOfferType":"Standard","defaultIdentity":"FirstPartyIdentity","networkAclBypass":"None","disableLocalAuth":false,"consistencyPolicy":{"defaultConsistencyLevel":"Session","maxIntervalInSeconds":5,"maxStalenessPrefix":100},"configurationOverrides":{},"writeLocations":[{"id":"cli-test000003-westus","locationName":"West US","documentEndpoint":"https://cli-test000003-westus.documents.azure.com:443/","provisioningState":"Succeeded","failoverPriority":0,"isZoneRedundant":false}],"readLocations":[{"id":"cli-test000003-westus","locationName":"West US","documentEndpoint":"https://cli-test000003-westus.documents.azure.com:443/","provisioningState":"Succeeded","failoverPriority":0,"isZoneRedundant":false}],"locations":[{"id":"cli-test000003-westus","locationName":"West US","documentEndpoint":"https://cli-test000003-westus.documents.azure.com:443/","provisioningState":"Succeeded","failoverPriority":0,"isZoneRedundant":false}],"failoverPolicies":[{"id":"cli-test000003-westus","locationName":"West @@ -627,7 +627,7 @@ interactions: content-type: - application/json date: - - Mon, 30 Jan 2023 23:17:27 GMT + - Tue, 14 Mar 2023 20:55:11 GMT pragma: - no-cache server: @@ -661,15 +661,15 @@ interactions: ParameterSetName: - -n -g -d User-Agent: - - AZURECLI/2.44.1 azsdk-python-mgmt-cosmosdb/8.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) + - AZURECLI/2.46.0 azsdk-python-mgmt-cosmosdb/9.0.0 Python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003/listConnectionStrings?api-version=2022-08-15 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003/listConnectionStrings?api-version=2022-11-15 response: body: - string: '{"connectionStrings":[{"connectionString":"AccountEndpoint=https://cli-test000003.documents.azure.com:443/;AccountKey=HGKZ5CGuqNGC73qUqisWXUzGaZY2qrjzzX4hegOBd6NhioqhfmeB326oq7byTTQB6uNOZlBhbFwRACDbzOpYIQ==;","description":"Primary - SQL Connection String"},{"connectionString":"AccountEndpoint=https://cli-test000003.documents.azure.com:443/;AccountKey=ATpa8kvWwBorRriQXorWVJkC5UgWR1hIhzfFVKOhI3xjZogaSXNkR83S3mo1YHTQFkIXIIMq7uadACDb4IICdQ==;","description":"Secondary - SQL Connection String"},{"connectionString":"AccountEndpoint=https://cli-test000003.documents.azure.com:443/;AccountKey=SrKLig43VNZJ9hhvhkxzLlmq52RwnNIKfkkSQ1HyJ7rlWJuV7HGb2KO7yeLlTJJkueRkgGVhl3TrACDbc6smUg==;","description":"Primary - Read-Only SQL Connection String"},{"connectionString":"AccountEndpoint=https://cli-test000003.documents.azure.com:443/;AccountKey=9GGM0uIgI608Ogju7YmYw7mQampbASwotNCwMprIXJRInCBHh7a4TZrPkIs1khxshkGSlHvyVR4BACDbF9kK9g==;","description":"Secondary + string: '{"connectionStrings":[{"connectionString":"AccountEndpoint=https://cli-test000003.documents.azure.com:443/;AccountKey=7JUJNUxVDVyjFq0FLOhDQWUWGo63iQcXOMTleLFDimQz8oYJEbkfitAnUnBVw8MPrnZmnzWM7JqLACDbbsgG7w==;","description":"Primary + SQL Connection String"},{"connectionString":"AccountEndpoint=https://cli-test000003.documents.azure.com:443/;AccountKey=VJqaCpEg8UhK48ePvH19500zFyLfkQOrkTIkg1GACxsePhjTroM6a4VTMg5u6Nm2t1fDBZUr3ysjACDbU7Jmlw==;","description":"Secondary + SQL Connection String"},{"connectionString":"AccountEndpoint=https://cli-test000003.documents.azure.com:443/;AccountKey=hhTjcquKnMiyirxNovLzcD01eVZq6EsuLANtzqRdjGgaV0PkP3R5SJAJ4GCoU4XqE4y9Yug3Q4rsACDbREmiEA==;","description":"Primary + Read-Only SQL Connection String"},{"connectionString":"AccountEndpoint=https://cli-test000003.documents.azure.com:443/;AccountKey=crePmwq6xUqVAv0viCDXhqeua18JbY63FCtOxM04VnSOHuSyNoYIPQZk3lA5To0Bl3gr5rRZ0U0dACDbBbuScA==;","description":"Secondary Read-Only SQL Connection String"}]}' headers: cache-control: @@ -679,7 +679,7 @@ interactions: content-type: - application/json date: - - Mon, 30 Jan 2023 23:17:29 GMT + - Tue, 14 Mar 2023 20:55:11 GMT pragma: - no-cache server: @@ -701,7 +701,7 @@ interactions: message: Ok - request: body: '{"properties": {"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.DocumentDB/databaseAccounts/cli-test000003", - "connectionIdentity": null, "region": "West US", "connectionString": "AccountEndpoint=https://cli-test000003.documents.azure.com:443/;AccountKey=HGKZ5CGuqNGC73qUqisWXUzGaZY2qrjzzX4hegOBd6NhioqhfmeB326oq7byTTQB6uNOZlBhbFwRACDbzOpYIQ==;"}}' + "connectionIdentity": null, "region": "West US", "connectionString": "AccountEndpoint=https://cli-test000003.documents.azure.com:443/;AccountKey=7JUJNUxVDVyjFq0FLOhDQWUWGo63iQcXOMTleLFDimQz8oYJEbkfitAnUnBVw8MPrnZmnzWM7JqLACDbbsgG7w==;"}}' headers: Accept: - '*/*' @@ -718,7 +718,7 @@ interactions: ParameterSetName: - -n -g -d User-Agent: - - python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) AZURECLI/2.44.1 + - python/3.8.13 (macOS-12.6.3-x86_64-i386-64bit) AZURECLI/2.46.0 method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test000001/providers/Microsoft.Web/staticsites/cli_test000002/databaseConnections/default?api-version=2022-03-01 response: @@ -734,7 +734,7 @@ interactions: content-type: - application/json date: - - Mon, 30 Jan 2023 23:17:30 GMT + - Tue, 14 Mar 2023 20:55:13 GMT expires: - '-1' pragma: @@ -752,7 +752,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' x-powered-by: - ASP.NET status: diff --git a/src/staticwebapp/azext_staticwebapp/tests/latest/test_staticwebapp_scenario.py b/src/staticwebapp/azext_staticwebapp/tests/latest/test_staticwebapp_scenario.py index 1ee1163a2bf..39a4ca1f432 100644 --- a/src/staticwebapp/azext_staticwebapp/tests/latest/test_staticwebapp_scenario.py +++ b/src/staticwebapp/azext_staticwebapp/tests/latest/test_staticwebapp_scenario.py @@ -25,7 +25,7 @@ def test_staticwebapp_dbconnection_azure_sql(self, resource_group): location = "West US" db_name = "tables" - self.cmd(f"staticwebapp create -n {name} -g {resource_group}") + self.cmd(f"staticwebapp create -n {name} -g {resource_group} -l centralus") server_id = self.cmd(f"sql server create -l '{location}' -g {resource_group} -n {server} -u {username} -p {password}").get_output_in_json()["id"] self.cmd(f"sql db create -g {resource_group} -n {db_name} -s {server}") @@ -39,7 +39,7 @@ def test_staticwebapp_dbconnection_cosmosdb(self, resource_group): server = self.create_random_name("cli-test", length=20) location = "West US" - self.cmd(f"staticwebapp create -n {name} -g {resource_group}") + self.cmd(f"staticwebapp create -n {name} -g {resource_group} -l centralus") server_id = self.cmd(f"cosmosdb create -n {server} -g {resource_group}").get_output_in_json()["id"] self.cmd(f"staticwebapp dbconnection create -n {name} -g {resource_group} -d {server_id}", From 6e62dcc96b8f6b59f14387ad801e8be06931df68 Mon Sep 17 00:00:00 2001 From: Silas Strawn Date: Tue, 14 Mar 2023 15:18:18 -0600 Subject: [PATCH 27/27] add confirmation to delete command; inform user of the supported connection types on validation error --- src/staticwebapp/azext_staticwebapp/_utils.py | 21 ++++++++++++------- .../azext_staticwebapp/commands.py | 2 +- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/staticwebapp/azext_staticwebapp/_utils.py b/src/staticwebapp/azext_staticwebapp/_utils.py index 8c3cbd33413..f090f065867 100644 --- a/src/staticwebapp/azext_staticwebapp/_utils.py +++ b/src/staticwebapp/azext_staticwebapp/_utils.py @@ -19,14 +19,14 @@ class ConnectionType(Enum): - CONNECTION_STRING = auto() - MANAGED_IDENTITY_USER_ASSIGNED = auto() - MANAGED_IDENTITY_SYSTEM_ASSIGNED = auto() + CONNECTION_STRING = "connection string" + MANAGED_IDENTITY_USER_ASSIGNED = "user assigned identity" + MANAGED_IDENTITY_SYSTEM_ASSIGNED = "system assigned identity" class Sku(Enum): - FREE = auto() - STANDARD = auto() + FREE = "Free" + STANDARD = "Standard" class AbstractDbHandler: @@ -60,11 +60,18 @@ def _get_connection_string(cls, cmd, sku: 'Sku', connection_type: 'ConnectionTyp def _parse_resource_id(cls, resource_id: str) -> dict: return parse_resource_id(resource_id) + @classmethod + def _get_supported_connection_types(cls, sku: 'Sku'): + connection_types = [ConnectionType.CONNECTION_STRING, ConnectionType.MANAGED_IDENTITY_SYSTEM_ASSIGNED, + ConnectionType.MANAGED_IDENTITY_USER_ASSIGNED] + return [c.value for c in connection_types if cls._is_supported(sku, c)] + @classmethod def _validate(cls, sku: 'Sku', connection_type: 'ConnectionType', database_name, username, password): if not cls._is_supported(sku, connection_type): - raise ValidationError(f"Authentication type '{connection_type}' is not supported for " - f"sku '{sku}' and database type '{cls.DB_TYPE_NAME}'") + raise ValidationError(f"Authentication type '{connection_type.value}' is not supported for " + f"sku '{sku.value}' and database type '{cls.DB_TYPE_NAME}'. Please use one of the " + f"following connection types: {cls._get_supported_connection_types(sku)}") missing_username = not username and cls._requires_username(sku, connection_type) missing_password = not password and cls._requires_password(sku, connection_type) diff --git a/src/staticwebapp/azext_staticwebapp/commands.py b/src/staticwebapp/azext_staticwebapp/commands.py index f3d8cadda18..3c9bab0df4c 100644 --- a/src/staticwebapp/azext_staticwebapp/commands.py +++ b/src/staticwebapp/azext_staticwebapp/commands.py @@ -8,4 +8,4 @@ def load_command_table(self, _): with self.command_group('staticwebapp dbconnection', is_preview=True) as g: g.custom_command('create', 'create_dbconnection') g.custom_show_command('show', 'show_dbconnection') - g.custom_command('delete', 'delete_dbconnection') + g.custom_command('delete', 'delete_dbconnection', confirmation=True)