diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a6230da4edb..d3d6881ea61 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -244,6 +244,8 @@ /src/fleet/ @pdaru +/src/staticwebapp/ @strawnsc + /src/traffic-collector/ @rmodh @japani @kukulkarni1 /src/nginx/ @liftr-nginx diff --git a/src/staticwebapp/HISTORY.rst b/src/staticwebapp/HISTORY.rst new file mode 100644 index 00000000000..643b5d8ee04 --- /dev/null +++ b/src/staticwebapp/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +1.0.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..34913fb394d --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/_client_factory.py @@ -0,0 +1,4 @@ +# -------------------------------------------------------------------------------------------- +# 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..ba8567cfa2d --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/_clients.py @@ -0,0 +1,138 @@ +# -------------------------------------------------------------------------------------------- +# 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" + + +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) + 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, "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) + 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" + + 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) + 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" + + 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) + 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) + + send_raw_request(cmd.cli_ctx, "DELETE", request_url) diff --git a/src/staticwebapp/azext_staticwebapp/_help.py b/src/staticwebapp/azext_staticwebapp/_help.py new file mode 100644 index 00000000000..6e6ae520773 --- /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..e401ea45f98 --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/_params.py @@ -0,0 +1,28 @@ +# -------------------------------------------------------------------------------------------- +# 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.", + 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.") + 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.") + 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 new file mode 100644 index 00000000000..f090f065867 --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/_utils.py @@ -0,0 +1,320 @@ +# -------------------------------------------------------------------------------------------- +# 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 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.command_modules.cosmosdb._client_factory import cf_db_accounts + + +logger = get_logger(__name__) + + +class ConnectionType(Enum): + CONNECTION_STRING = "connection string" + MANAGED_IDENTITY_USER_ASSIGNED = "user assigned identity" + MANAGED_IDENTITY_SYSTEM_ASSIGNED = "system assigned identity" + + +class Sku(Enum): + FREE = "Free" + STANDARD = "Standard" + + +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 _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 + @classmethod + @lru_cache(maxsize=100) + 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.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) + if missing_password and missing_username: + raise RequiredArgumentMissingError("Please provide the missing database username and password") + if missing_password: + raise RequiredArgumentMissingError("Please provide the missing database password") + if missing_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) + 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.") + + 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 + 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 = {} + 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, database_name, + username=None, password=None, **kwargs) -> str: + 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): + 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 _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"] + name = parsed_rid["name"] + client = cf_db_accounts(cmd.cli_ctx, None) + + if connection_type == ConnectionType.CONNECTION_STRING: + return client.list_connection_strings(resource_group, name).connection_strings[0].connection_string + else: + return f"AccountEndpoint={client.get(resource_group, name).document_endpoint};" + + +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 + + @classmethod + def _requires_password(cls, sku: 'Sku', connection_type: 'ConnectionType') -> bool: + return sku == Sku.FREE or connection_type == connection_type.CONNECTION_STRING + + @classmethod + 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_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={database_name};" + f"User ID={username};Password={password};") + else: + return f"Server=tcp:{name}.database.windows.net,1433;Database={database_name};" + + +class MySqlFlexHandler(AbstractDbHandler): + DB_TYPE_NAME = "MySQL Flex" + API_VERSION = "2021-05-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 _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"] + # only connection string auth supported + 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: + return cls._get_location_from_server(cmd, resource_id) + + +class PgSqlSingleHandler(AbstractDbHandler): + DB_TYPE_NAME = "PostgreSQL Single" + API_VERSION = "2017-12-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 connection_type == connection_type.CONNECTION_STRING + + @classmethod + 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) + + @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"] + 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};") + else: + return (f"Server={server}.postgres.database.azure.com;Database={database_name};Port=5432;" + f"User Id={username}@{server};") + + +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 _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, database_name, + username=None, password=None, **kwargs) -> str: + 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};") + + +# 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/[^/]+$": 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/_validators.py b/src/staticwebapp/azext_staticwebapp/_validators.py new file mode 100644 index 00000000000..34913fb394d --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/_validators.py @@ -0,0 +1,4 @@ +# -------------------------------------------------------------------------------------------- +# 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..1703199b411 --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.39.0" +} \ 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..3c9bab0df4c --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/commands.py @@ -0,0 +1,11 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +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', confirmation=True) diff --git a/src/staticwebapp/azext_staticwebapp/custom.py b/src/staticwebapp/azext_staticwebapp/custom.py new file mode 100644 index 00000000000..38d45d0cefc --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/custom.py @@ -0,0 +1,58 @@ +# -------------------------------------------------------------------------------------------- +# 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, 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 + + +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") + + 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_SYSTEM_ASSIGNED + + app = show_staticsite(cmd, name, resource_group_name) + sku = Sku.FREE if app.sku.name.lower() == "free" else Sku.STANDARD + db_type = get_database_type(db_resource_id) + region = db_type.get_location(cmd, db_resource_id) + + 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: + identity = mi_user_assigned + elif mi_system_assigned: + identity = "SystemAssigned" + + connection = DbConnection + connection["properties"]["resourceId"] = db_resource_id + connection["properties"]["connectionIdentity"] = identity + 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=None): + 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/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..95f31db32bf --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_azure_sql.yaml @@ -0,0 +1,1287 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - staticwebapp create + Connection: + - keep-alive + ParameterSetName: + - -n -g -l + User-Agent: + - 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: '{"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: + - Tue, 14 Mar 2023 20:46:49 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 -l + User-Agent: + - 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":"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: + - '846' + content-type: + - application/json + date: + - Tue, 14 Mar 2023 20:46:51 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 -l + User-Agent: + - 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":"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: + - '846' + content-type: + - application/json + date: + - Tue, 14 Mar 2023 20:46:52 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 -l + User-Agent: + - 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: + 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\":[]}},{\"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: + - '29829' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 14 Mar 2023 20:46:55 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.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=2022-08-01-preview + response: + body: + 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/9f9dee4c-f5a6-4a44-8578-e18fd73dd8cb?api-version=2022-08-01-preview + cache-control: + - no-cache + content-length: + - '74' + content-type: + - application/json; charset=utf-8 + date: + - 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/9f9dee4c-f5a6-4a44-8578-e18fd73dd8cb?api-version=2022-08-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.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":"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: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: 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":"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: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: + - '*/*' + 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":"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: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 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":"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: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: 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":"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: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.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":"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:27 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":"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 + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 14 Mar 2023 20:48:07 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/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","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: + - '516' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 14 Mar 2023 20:48:07 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.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=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","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: + - '516' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 14 Mar 2023 20:48:08 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.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=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","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: + - '516' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 14 Mar 2023 20:48:10 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.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-08-01-preview + response: + body: + 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/f8bae546-952f-40de-938d-81fcb5da5372?api-version=2022-08-01-preview + cache-control: + - no-cache + content-length: + - '76' + content-type: + - application/json; charset=utf-8 + date: + - 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/f8bae546-952f-40de-938d-81fcb5da5372?api-version=2022-08-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.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/f8bae546-952f-40de-938d-81fcb5da5372?api-version=2022-08-01-preview + response: + body: + string: '{"name":"f8bae546-952f-40de-938d-81fcb5da5372","status":"InProgress","startTime":"2023-03-14T20:48:12.413Z"}' + headers: + cache-control: + - no-cache + content-length: + - '108' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 14 Mar 2023 20:48: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 db create + Connection: + - keep-alive + ParameterSetName: + - -g -n -s + 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/databaseAzureAsyncOperation/f8bae546-952f-40de-938d-81fcb5da5372?api-version=2022-08-01-preview + response: + body: + string: '{"name":"f8bae546-952f-40de-938d-81fcb5da5372","status":"InProgress","startTime":"2023-03-14T20:48:12.413Z"}' + headers: + cache-control: + - no-cache + content-length: + - '108' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 14 Mar 2023 20:48: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 db create + Connection: + - keep-alive + ParameterSetName: + - -g -n -s + 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/databaseAzureAsyncOperation/f8bae546-952f-40de-938d-81fcb5da5372?api-version=2022-08-01-preview + response: + body: + string: '{"name":"f8bae546-952f-40de-938d-81fcb5da5372","status":"InProgress","startTime":"2023-03-14T20:48:12.413Z"}' + headers: + cache-control: + - no-cache + content-length: + - '108' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 14 Mar 2023 20:48:57 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.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/f8bae546-952f-40de-938d-81fcb5da5372?api-version=2022-08-01-preview + response: + body: + string: '{"name":"f8bae546-952f-40de-938d-81fcb5da5372","status":"Succeeded","startTime":"2023-03-14T20:48:12.413Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 14 Mar 2023 20:49:13 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.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-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":"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: + - '1221' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 14 Mar 2023 20:49:14 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.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":"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: + - '846' + content-type: + - application/json + date: + - Tue, 14 Mar 2023 20:49: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 -u -p -d -b + User-Agent: + - 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: + 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: + - Tue, 14 Mar 2023 20:49:15 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!;"}}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - staticwebapp dbconnection create + Connection: + - keep-alive + Content-Length: + - '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.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: + body: + 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: + - '443' + content-type: + - application/json + date: + - Tue, 14 Mar 2023 20:49: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_cosmosdb.yaml b/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_cosmosdb.yaml new file mode 100644 index 00000000000..7ee04959a0a --- /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 -l + User-Agent: + - 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: '{"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: + - Tue, 14 Mar 2023 20:52:56 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 -l + User-Agent: + - 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":"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: + - '844' + content-type: + - application/json + date: + - Tue, 14 Mar 2023 20:52:58 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 -l + User-Agent: + - 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":"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: + - '844' + content-type: + - application/json + date: + - Tue, 14 Mar 2023 20:52:59 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.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-03-14T20:52:55Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '306' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 14 Mar 2023 20:53:01 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.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-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-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-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/b601553f-ad39-48dd-9399-5aecc55d1c2c?api-version=2022-11-15 + cache-control: + - no-store, no-cache + content-length: + - '2242' + content-type: + - application/json + date: + - 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/b601553f-ad39-48dd-9399-5aecc55d1c2c?api-version=2022-11-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.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/b601553f-ad39-48dd-9399-5aecc55d1c2c?api-version=2022-11-15 + response: + body: + string: '{"status":"Dequeued"}' + headers: + cache-control: + - no-store, no-cache + content-length: + - '21' + content-type: + - application/json + date: + - Tue, 14 Mar 2023 20:53:38 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.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/b601553f-ad39-48dd-9399-5aecc55d1c2c?api-version=2022-11-15 + response: + body: + string: '{"status":"Dequeued"}' + headers: + cache-control: + - no-store, no-cache + content-length: + - '21' + content-type: + - application/json + date: + - Tue, 14 Mar 2023 20:54:08 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.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/b601553f-ad39-48dd-9399-5aecc55d1c2c?api-version=2022-11-15 + response: + body: + string: '{"status":"Dequeued"}' + headers: + cache-control: + - no-store, no-cache + content-length: + - '21' + content-type: + - application/json + date: + - Tue, 14 Mar 2023 20:54:39 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.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/b601553f-ad39-48dd-9399-5aecc55d1c2c?api-version=2022-11-15 + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-store, no-cache + content-length: + - '22' + content-type: + - application/json + date: + - Tue, 14 Mar 2023 20:55:09 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.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-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-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-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: + - '2621' + content-type: + - application/json + date: + - Tue, 14 Mar 2023 20:55:09 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.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-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-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-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: + - '2621' + content-type: + - application/json + date: + - Tue, 14 Mar 2023 20:55:09 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.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":"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: + - '844' + content-type: + - application/json + date: + - Tue, 14 Mar 2023 20:55:10 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.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-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 + 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: + - '2253' + content-type: + - application/json + date: + - Tue, 14 Mar 2023 20:55:11 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.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-11-15 + response: + body: + 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: + - no-store, no-cache + content-length: + - '983' + content-type: + - application/json + date: + - Tue, 14 Mar 2023 20:55:11 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=7JUJNUxVDVyjFq0FLOhDQWUWGo63iQcXOMTleLFDimQz8oYJEbkfitAnUnBVw8MPrnZmnzWM7JqLACDbbsgG7w==;"}}' + 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.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: + body: + 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: + - '459' + content-type: + - application/json + date: + - Tue, 14 Mar 2023 20:55:13 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 +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..151f583e25e --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/tests/latest/recordings/test_staticwebapp_dbconnection_pgsql_single.yaml @@ -0,0 +1,916 @@ +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.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: '{"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: + - Mon, 30 Jan 2023 23:15:13 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.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":"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: + - '820' + content-type: + - application/json + date: + - Mon, 30 Jan 2023 23:15:17 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.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":"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: + - '820' + content-type: + - application/json + date: + - Mon, 30 Jan 2023 23:15:17 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.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: + 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\":[]}},{\"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/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 + 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: + - '30301' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Jan 2023 23:15:21 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.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: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 30 Jan 2023 23:15:20 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.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":"2023-01-30T23:15:08Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '306' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Jan 2023 23:15:21 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.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: + body: + string: '{"nameAvailable":true,"message":""}' + headers: + cache-control: + - no-cache + content-length: + - '35' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Jan 2023 23:15:24 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.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":"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/cf434d22-0200-4a09-8ccc-3af6a6268c32?api-version=2017-12-01 + cache-control: + - no-cache + content-length: + - '74' + content-type: + - application/json; charset=utf-8 + date: + - 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/cf434d22-0200-4a09-8ccc-3af6a6268c32?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.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/cf434d22-0200-4a09-8ccc-3af6a6268c32?api-version=2017-12-01 + response: + body: + string: '{"name":"cf434d22-0200-4a09-8ccc-3af6a6268c32","status":"InProgress","startTime":"2023-01-30T23:15:25.763Z"}' + headers: + cache-control: + - no-cache + content-length: + - '108' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Jan 2023 23:16: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: + - postgres server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n -u -p + User-Agent: + - 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/cf434d22-0200-4a09-8ccc-3af6a6268c32?api-version=2017-12-01 + response: + body: + string: '{"name":"cf434d22-0200-4a09-8ccc-3af6a6268c32","status":"Succeeded","startTime":"2023-01-30T23:15:25.763Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Jan 2023 23:17:27 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.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":"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: + - '917' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Jan 2023 23:17: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.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":"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/8c757d37-25bf-4510-a321-71e967ef8f24?api-version=2017-12-01 + cache-control: + - no-cache + content-length: + - '82' + content-type: + - application/json; charset=utf-8 + date: + - 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/8c757d37-25bf-4510-a321-71e967ef8f24?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.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/8c757d37-25bf-4510-a321-71e967ef8f24?api-version=2017-12-01 + response: + body: + string: '{"name":"8c757d37-25bf-4510-a321-71e967ef8f24","status":"Succeeded","startTime":"2023-01-30T23:17:29.337Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Jan 2023 23:17: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: + - postgres db create + Connection: + - keep-alive + ParameterSetName: + - -g -n -s + User-Agent: + - 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: + 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: + - Mon, 30 Jan 2023 23:17: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.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":"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: + - '820' + content-type: + - application/json + date: + - Mon, 30 Jan 2023 23:17: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.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":"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: + - '917' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Jan 2023 23:17: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: '{"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.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/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/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: + - '455' + content-type: + - application/json + date: + - Mon, 30 Jan 2023 23:17: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 new file mode 100644 index 00000000000..39a4ca1f432 --- /dev/null +++ b/src/staticwebapp/azext_staticwebapp/tests/latest/test_staticwebapp_scenario.py @@ -0,0 +1,120 @@ +# -------------------------------------------------------------------------------------------- +# 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 unittest import mock + +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 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} -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}") + + 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} -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}", + 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 + + 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) 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..e8ec6446ba0 --- /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 = '1.0.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']}, +)