diff --git a/src/azure-cli/azure/cli/command_modules/appservice/_params.py b/src/azure-cli/azure/cli/command_modules/appservice/_params.py index e848226bdb9..f66c0010202 100644 --- a/src/azure-cli/azure/cli/command_modules/appservice/_params.py +++ b/src/azure-cli/azure/cli/command_modules/appservice/_params.py @@ -15,7 +15,7 @@ from ._completers import get_hostname_completion_list from ._constants import FUNCTIONS_VERSIONS_FUNCTIONAPP, RUNTIME_TO_IMAGE_FUNCTIONAPP from ._validators import (validate_timeout_value, validate_site_create, validate_asp_create, - validate_add_vnet, validate_front_end_scale_factor, validate_ase_create) + validate_add_vnet, validate_front_end_scale_factor, validate_ase_create, validate_ip_address) AUTH_TYPES = { @@ -556,7 +556,7 @@ def load_arguments(self, _): c.argument('description', help='Description of the access restriction rule') c.argument('action', arg_type=get_enum_type(ACCESS_RESTRICTION_ACTION_TYPES), help="Allow or deny access") - c.argument('ip_address', help="IP address or CIDR range") + c.argument('ip_address', help="IP address or CIDR range", validator=validate_ip_address) c.argument('vnet_name', help="vNet name") c.argument('subnet', help="Subnet name (requires vNet name) or subnet resource id") c.argument('ignore_missing_vnet_service_endpoint', @@ -570,7 +570,7 @@ def load_arguments(self, _): c.argument('name', arg_type=webapp_name_arg_type) c.argument('rule_name', options_list=['--rule-name', '-r'], help='Name of the access restriction to remove') - c.argument('ip_address', help="IP address or CIDR range") + c.argument('ip_address', help="IP address or CIDR range", validator=validate_ip_address) c.argument('vnet_name', help="vNet name") c.argument('subnet', help="Subnet name (requires vNet name) or subnet resource id") c.argument('scm_site', help='True if access restriction should be removed from scm site', diff --git a/src/azure-cli/azure/cli/command_modules/appservice/_validators.py b/src/azure-cli/azure/cli/command_modules/appservice/_validators.py index 6f56f7f0438..80b4e65921e 100644 --- a/src/azure-cli/azure/cli/command_modules/appservice/_validators.py +++ b/src/azure-cli/azure/cli/command_modules/appservice/_validators.py @@ -162,3 +162,23 @@ def validate_asp_sku(cmd, namespace): if res.get('properties').get('hostingEnvironment') is not None: raise CLIError("Only pricing tier 'Isolated' is allowed in this app service plan. Use this link to " "learn more: https://docs.microsoft.com/en-us/azure/app-service/overview-hosting-plans") + + +def validate_ip_address(namespace): + if namespace.ip_address is not None: + # IPv6 + if ':' in namespace.ip_address: + if namespace.ip_address.count(':') > 1: + if '/' not in namespace.ip_address: + namespace.ip_address = namespace.ip_address + '/128' + return + return + # IPv4 + elif '.' in namespace.ip_address: + if namespace.ip_address.count('.') == 3: + if '/' not in namespace.ip_address: + namespace.ip_address = namespace.ip_address + '/32' + return + return + + raise CLIError('Invalid IP address') diff --git a/src/azure-cli/azure/cli/command_modules/appservice/access_restrictions.py b/src/azure-cli/azure/cli/command_modules/appservice/access_restrictions.py index 0cee7ad32cb..78010bdff69 100644 --- a/src/azure-cli/azure/cli/command_modules/appservice/access_restrictions.py +++ b/src/azure-cli/azure/cli/command_modules/appservice/access_restrictions.py @@ -38,7 +38,7 @@ def add_webapp_access_restriction( configs = get_site_configs(cmd, resource_group_name, name, slot) if (ip_address and subnet) or (not ip_address and not subnet): - raise CLIError('Usage error: --subnet | --ip_address') + raise CLIError('Usage error: --subnet | --ip-address') # get rules list access_rules = configs.scm_ip_security_restrictions if scm_site else configs.ip_security_restrictions diff --git a/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/recordings/test_functionapp_access_restriction_add_ip_address_validation.yaml b/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/recordings/test_functionapp_access_restriction_add_ip_address_validation.yaml new file mode 100644 index 00000000000..1b1b0c82e42 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/recordings/test_functionapp_access_restriction_add_ip_address_validation.yaml @@ -0,0 +1,772 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - functionapp create + Connection: + - keep-alive + ParameterSetName: + - -g -n --consumption-plan-location -s + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-web/0.44.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions?sku=Dynamic&api-version=2019-08-01 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/Central + US","name":"Central US","type":"Microsoft.Web/geoRegions","properties":{"name":"Central + US","description":null,"sortOrder":0,"displayName":"Central US","orgDomain":"PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;DSERIES;LINUX;LINUXDSERIES;ELASTICPREMIUM;LINUXFREE"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/North + Europe","name":"North Europe","type":"Microsoft.Web/geoRegions","properties":{"name":"North + Europe","description":"","sortOrder":1,"displayName":"North Europe","orgDomain":"PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;DSERIES;LINUX;LINUXDSERIES;XENON;ELASTICPREMIUM;LINUXFREE;ELASTICLINUX;LINUXDYNAMIC"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/West + Europe","name":"West Europe","type":"Microsoft.Web/geoRegions","properties":{"name":"West + Europe","description":null,"sortOrder":2,"displayName":"West Europe","orgDomain":"PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;LINUX;DSERIES;LINUXDSERIES;XENON;SFCONTAINERS;LINUXDYNAMIC;ELASTICPREMIUM;ELASTICLINUX;LINUXFREE"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/Southeast + Asia","name":"Southeast Asia","type":"Microsoft.Web/geoRegions","properties":{"name":"Southeast + Asia","description":"","sortOrder":3,"displayName":"Southeast Asia","orgDomain":"PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;LINUX;DSERIES;LINUXDSERIES;XENON;ELASTICPREMIUM;LINUXFREE;ELASTICLINUX;LINUXDYNAMIC"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/East + Asia","name":"East Asia","type":"Microsoft.Web/geoRegions","properties":{"name":"East + Asia","description":null,"sortOrder":4,"displayName":"East Asia","orgDomain":"PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;LINUX;DSERIES;LINUXDSERIES;SFCONTAINERS;LINUXDYNAMIC;ELASTICPREMIUM;LINUXFREE"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/West + US","name":"West US","type":"Microsoft.Web/geoRegions","properties":{"name":"West + US","description":null,"sortOrder":5,"displayName":"West US","orgDomain":"PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;LINUX;DSERIES;LINUXDSERIES;XENON;ELASTICPREMIUM;LINUXFREE;ELASTICLINUX;LINUXDYNAMIC"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/East + US","name":"East US","type":"Microsoft.Web/geoRegions","properties":{"name":"East + US","description":null,"sortOrder":6,"displayName":"East US","orgDomain":"PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;LINUX;DSERIES;FAKEORG;LINUXDSERIES;XENON;SFCONTAINERS;LINUXDYNAMIC;LINUXFREE;ELASTICLINUX;ELASTICPREMIUM"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/Japan + West","name":"Japan West","type":"Microsoft.Web/geoRegions","properties":{"name":"Japan + West","description":null,"sortOrder":7,"displayName":"Japan West","orgDomain":"PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;LINUX;DSERIES;LINUXDSERIES;ELASTICPREMIUM;LINUXFREE"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/Japan + East","name":"Japan East","type":"Microsoft.Web/geoRegions","properties":{"name":"Japan + East","description":null,"sortOrder":8,"displayName":"Japan East","orgDomain":"PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;LINUX;DSERIES;LINUXDSERIES;LINUXFREE;ELASTICLINUX;ELASTICPREMIUM"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/East + US 2","name":"East US 2","type":"Microsoft.Web/geoRegions","properties":{"name":"East + US 2","description":"","sortOrder":9,"displayName":"East US 2","orgDomain":"PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;DSERIES;LINUX;LINUXDSERIES;ELASTICPREMIUM;LINUXFREE;LINUXDYNAMIC"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/North + Central US","name":"North Central US","type":"Microsoft.Web/geoRegions","properties":{"name":"North + Central US","description":null,"sortOrder":10,"displayName":"North Central + US","orgDomain":"PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;LINUX;DSERIES;LINUXDSERIES;LINUXFREE;ELASTICPREMIUM"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/South + Central US","name":"South Central US","type":"Microsoft.Web/geoRegions","properties":{"name":"South + Central US","description":null,"sortOrder":11,"displayName":"South Central + US","orgDomain":"PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;DSERIES;LINUX;LINUXDSERIES;ELASTICPREMIUM;LINUXFREE;LINUXDYNAMIC;ELASTICLINUX"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/Brazil + South","name":"Brazil South","type":"Microsoft.Web/geoRegions","properties":{"name":"Brazil + South","description":"","sortOrder":12,"displayName":"Brazil South","orgDomain":"PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;LINUX;DSERIES;LINUXDSERIES;LINUXFREE;ELASTICPREMIUM;LINUXDYNAMIC"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/Australia + East","name":"Australia East","type":"Microsoft.Web/geoRegions","properties":{"name":"Australia + East","description":"","sortOrder":13,"displayName":"Australia East","orgDomain":"PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;LINUX;DSERIES;LINUXDSERIES;XENON;ELASTICPREMIUM;LINUXFREE;LINUXDYNAMIC"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/Australia + Southeast","name":"Australia Southeast","type":"Microsoft.Web/geoRegions","properties":{"name":"Australia + Southeast","description":null,"sortOrder":14,"displayName":"Australia Southeast","orgDomain":"PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;DSERIES;LINUX;LINUXDSERIES;ELASTICPREMIUM;LINUXFREE;ELASTICLINUX"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/East + Asia (Stage)","name":"East Asia (Stage)","type":"Microsoft.Web/geoRegions","properties":{"name":"East + Asia (Stage)","description":null,"sortOrder":2147483647,"displayName":"East + Asia (Stage)","orgDomain":"MSFTINT;DSERIES;ELASTICPREMIUM;FUNCTIONS;DYNAMIC;XENON;LINUX;LINUXFREE;LINUXDYNAMIC"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/Central + India","name":"Central India","type":"Microsoft.Web/geoRegions","properties":{"name":"Central + India","description":null,"sortOrder":2147483647,"displayName":"Central India","orgDomain":"PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;LINUX;DSERIES;LINUXDSERIES"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/West + India","name":"West India","type":"Microsoft.Web/geoRegions","properties":{"name":"West + India","description":"","sortOrder":2147483647,"displayName":"West India","orgDomain":"PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;LINUX;DSERIES;LINUXDSERIES;ELASTICPREMIUM;LINUXDYNAMIC"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/South + India","name":"South India","type":"Microsoft.Web/geoRegions","properties":{"name":"South + India","description":null,"sortOrder":2147483647,"displayName":"South India","orgDomain":"PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;DSERIES;LINUX;LINUXDSERIES;ELASTICPREMIUM"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/Canada + Central","name":"Canada Central","type":"Microsoft.Web/geoRegions","properties":{"name":"Canada + Central","description":null,"sortOrder":2147483647,"displayName":"Canada Central","orgDomain":"PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;DSERIES;LINUX;LINUXDSERIES;ELASTICPREMIUM;LINUXFREE"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/Canada + East","name":"Canada East","type":"Microsoft.Web/geoRegions","properties":{"name":"Canada + East","description":null,"sortOrder":2147483647,"displayName":"Canada East","orgDomain":"PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;LINUX;DSERIES;LINUXDSERIES"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/West + Central US","name":"West Central US","type":"Microsoft.Web/geoRegions","properties":{"name":"West + Central US","description":null,"sortOrder":2147483647,"displayName":"West + Central US","orgDomain":"PUBLIC;FUNCTIONS;DYNAMIC;LINUX;DSERIES;LINUXDSERIES"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/West + US 2","name":"West US 2","type":"Microsoft.Web/geoRegions","properties":{"name":"West + US 2","description":null,"sortOrder":2147483647,"displayName":"West US 2","orgDomain":"PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;LINUX;DSERIES;LINUXDSERIES;LINUXFREE;LINUXDYNAMIC;ELASTICPREMIUM"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/UK + West","name":"UK West","type":"Microsoft.Web/geoRegions","properties":{"name":"UK + West","description":null,"sortOrder":2147483647,"displayName":"UK West","orgDomain":"PUBLIC;MSFTPUBLIC;FUNCTIONS;DYNAMIC;DSERIES;LINUX;LINUXDSERIES;ELASTICPREMIUM"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/UK + South","name":"UK South","type":"Microsoft.Web/geoRegions","properties":{"name":"UK + South","description":null,"sortOrder":2147483647,"displayName":"UK South","orgDomain":"PUBLIC;MSFTPUBLIC;DYNAMIC;DSERIES;LINUX;LINUXDSERIES;LINUXFREE;LINUXDYNAMIC;ELASTICPREMIUM"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/East + US 2 EUAP","name":"East US 2 EUAP","type":"Microsoft.Web/geoRegions","properties":{"name":"East + US 2 EUAP","description":null,"sortOrder":2147483647,"displayName":"East US + 2 EUAP","orgDomain":"EUAP;XENON;DSERIES;ELASTICPREMIUM;FUNCTIONS;DYNAMIC"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/Central + US EUAP","name":"Central US EUAP","type":"Microsoft.Web/geoRegions","properties":{"name":"Central + US EUAP","description":null,"sortOrder":2147483647,"displayName":"Central + US EUAP","orgDomain":"EUAP;LINUX;DSERIES;ELASTICPREMIUM;LINUXFREE;ELASTICLINUX;LINUXDYNAMIC;DYNAMIC"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/Korea + Central","name":"Korea Central","type":"Microsoft.Web/geoRegions","properties":{"name":"Korea + Central","description":null,"sortOrder":2147483647,"displayName":"Korea Central","orgDomain":"PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;LINUX;LINUXDSERIES;ELASTICPREMIUM;LINUXFREE;DSERIES;LINUXDYNAMIC"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/France + Central","name":"France Central","type":"Microsoft.Web/geoRegions","properties":{"name":"France + Central","description":null,"sortOrder":2147483647,"displayName":"France Central","orgDomain":"PUBLIC;MSFTPUBLIC;DSERIES;DYNAMIC;LINUX;LINUXDSERIES;ELASTICPREMIUM;LINUXFREE;LINUXDYNAMIC"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/Australia + Central 2","name":"Australia Central 2","type":"Microsoft.Web/geoRegions","properties":{"name":"Australia + Central 2","description":null,"sortOrder":2147483647,"displayName":"Australia + Central 2","orgDomain":"PUBLIC;FUNCTIONS;DYNAMIC;DSERIES;LINUX;LINUXDSERIES;LINUXFREE;ELASTICPREMIUM"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/Australia + Central","name":"Australia Central","type":"Microsoft.Web/geoRegions","properties":{"name":"Australia + Central","description":null,"sortOrder":2147483647,"displayName":"Australia + Central","orgDomain":"PUBLIC;FUNCTIONS;DYNAMIC;DSERIES;LINUX;LINUXDSERIES;LINUXFREE;ELASTICPREMIUM"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/South + Africa North","name":"South Africa North","type":"Microsoft.Web/geoRegions","properties":{"name":"South + Africa North","description":null,"sortOrder":2147483647,"displayName":"South + Africa North","orgDomain":"PUBLIC;MSFTPUBLIC;FUNCTIONS;DYNAMIC;LINUX;LINUXDSERIES;DSERIES"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/Switzerland + North","name":"Switzerland North","type":"Microsoft.Web/geoRegions","properties":{"name":"Switzerland + North","description":null,"sortOrder":2147483647,"displayName":"Switzerland + North","orgDomain":"PUBLIC;DSERIES;FUNCTIONS;DYNAMIC;DSERIES"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/geoRegions/Germany + West Central","name":"Germany West Central","type":"Microsoft.Web/geoRegions","properties":{"name":"Germany + West Central","description":null,"sortOrder":2147483647,"displayName":"Germany + West Central","orgDomain":"PUBLIC;DSERIES;ELASTICPREMIUM;FUNCTIONS;DYNAMIC"}}],"nextLink":null,"id":null}' + headers: + cache-control: + - no-cache + content-length: + - '13069' + content-type: + - application/json + date: + - Fri, 21 Feb 2020 15:38:24 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: + - functionapp create + Connection: + - keep-alive + ParameterSetName: + - -g -n --consumption-plan-location -s + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-storage/7.1.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/clitest000002?api-version=2019-06-01 + response: + body: + string: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/clitest000002","name":"clitest000002","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-02-21T15:38:02.4324015Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-02-21T15:38:02.4324015Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-02-21T15:38:02.3542665Z","primaryEndpoints":{"blob":"https://clitest000002.blob.core.windows.net/","queue":"https://clitest000002.queue.core.windows.net/","table":"https://clitest000002.table.core.windows.net/","file":"https://clitest000002.file.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available"}}' + headers: + cache-control: + - no-cache + content-length: + - '1240' + content-type: + - application/json + date: + - Fri, 21 Feb 2020 15:38:25 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 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: + - functionapp create + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -n --consumption-plan-location -s + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-storage/7.1.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/clitest000002/listKeys?api-version=2019-06-01 + response: + body: + string: '{"keys":[{"keyName":"key1","value":"veryFakedStorageAccountKey==","permissions":"FULL"},{"keyName":"key2","value":"veryFakedStorageAccountKey==","permissions":"FULL"}]}' + headers: + cache-control: + - no-cache + content-length: + - '288' + content-type: + - application/json + date: + - Fri, 21 Feb 2020 15:38:26 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 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-resource-requests: + - '11999' + status: + code: 200 + message: OK +- request: + body: 'b''{"kind": "functionapp", "location": "westus", "properties": {"reserved": + false, "isXenon": false, "hyperV": false, "siteConfig": {"netFrameworkVersion": + "v4.6", "appSettings": [{"name": "FUNCTIONS_EXTENSION_VERSION", "value": "~2"}, + {"name": "AzureWebJobsStorage", "value": "DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=clitest000002;AccountKey=veryFakedStorageAccountKey=="}, + {"name": "AzureWebJobsDashboard", "value": "DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=clitest000002;AccountKey=veryFakedStorageAccountKey=="}, + {"name": "WEBSITE_NODE_DEFAULT_VERSION", "value": "~10"}, {"name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING", + "value": "DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=clitest000002;AccountKey=veryFakedStorageAccountKey=="}, + {"name": "WEBSITE_CONTENTSHARE", "value": "cli-funcapp-nwr000003"}], "localMySqlEnabled": + false, "http20Enabled": true}, "scmSiteAlsoStopped": false}}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - functionapp create + Connection: + - keep-alive + Content-Length: + - '1202' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n --consumption-plan-location -s + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-web/0.44.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-funcapp-nwr000003?api-version=2019-08-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-funcapp-nwr000003","name":"cli-funcapp-nwr000003","type":"Microsoft.Web/sites","kind":"functionapp","location":"westus","properties":{"name":"cli-funcapp-nwr000003","state":"Running","hostNames":["cli-funcapp-nwr000003.azurewebsites.net"],"webSpace":"clitest.rg000001-WestUSwebspace","selfLink":"https://waws-prod-bay-043.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/clitest.rg000001-WestUSwebspace/sites/cli-funcapp-nwr000003","repositorySiteName":"cli-funcapp-nwr000003","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["cli-funcapp-nwr000003.azurewebsites.net","cli-funcapp-nwr000003.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[{"name":"LinuxFxVersion","value":""},{"name":"WindowsFxVersion","value":null}],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"cli-funcapp-nwr000003.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"cli-funcapp-nwr000003.scm.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Repository"}],"computeMode":null,"serverFarm":null,"serverFarmId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/WestUSPlan","reserved":false,"isXenon":false,"hyperV":false,"lastModifiedTimeUtc":"2020-02-21T15:38:38.17","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":null,"deploymentId":"cli-funcapp-nwr000003","trafficManagerHostNames":null,"sku":"Dynamic","scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"clientAffinityEnabled":false,"clientCertEnabled":false,"clientCertExclusionPaths":null,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"customDomainVerificationId":"170C52C1A315D53ED5B16A634987B36339622AEA95E507726F878C71E5CE4F1D","kind":"functionapp","inboundIpAddress":"104.40.92.107","possibleInboundIpAddresses":"104.40.92.107,40.112.243.23","outboundIpAddresses":"104.40.88.152,104.40.87.132,104.40.95.34,104.40.88.78","possibleOutboundIpAddresses":"104.40.88.152,104.40.87.132,104.40.95.34,104.40.88.78,13.93.199.41,13.93.207.234,13.93.207.237,13.93.207.141,13.93.207.166","containerSize":1536,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-bay-043","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"clitest.rg000001","defaultHostName":"cli-funcapp-nwr000003.azurewebsites.net","slotSwapStatus":null,"httpsOnly":false,"redundancyMode":"None","inProgressOperationId":null,"geoDistributions":null,"privateEndpointConnections":null,"buildVersion":null,"targetBuildVersion":null}}' + headers: + cache-control: + - no-cache + content-length: + - '3617' + content-type: + - application/json + date: + - Fri, 21 Feb 2020 15:39:12 GMT + etag: + - '"1D5E8CCFCE3FD30"' + 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-resource-requests: + - '499' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "kind": "web", "properties": {"Application_Type": + "web"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - functionapp create + Connection: + - keep-alive + Content-Length: + - '80' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n --consumption-plan-location -s + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-applicationinsights/0.1.1 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/cli-funcapp-nwr000003?api-version=2015-05-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/cli-funcapp-nwr000003","name":"cli-funcapp-nwr000003","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"web","etag":"\"6e00f90c-0000-0700-0000-5e4ff9a90000\"","properties":{"Ver":"v2","ApplicationId":"cli-funcapp-nwr000003","AppId":"cccb93f6-6357-4d70-be8f-c9e026fe0bf0","Application_Type":"web","Flow_Type":null,"Request_Source":null,"InstrumentationKey":"af633fb1-f616-45b7-84a1-d35ec54c375b","ConnectionString":"InstrumentationKey=af633fb1-f616-45b7-84a1-d35ec54c375b","Name":"cli-funcapp-nwr000003","CreationDate":"2020-02-21T15:39:21.632143+00:00","TenantId":"a6f7834d-3304-4890-82af-ec04cb382539","provisioningState":"Succeeded","SamplingPercentage":null}}' + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '891' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 21 Feb 2020 15:39:24 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + server: + - Microsoft-IIS/10.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' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - functionapp create + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -n --consumption-plan-location -s + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-web/0.44.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-funcapp-nwr000003/config/appsettings/list?api-version=2019-08-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-funcapp-nwr000003/config/appsettings","name":"appsettings","type":"Microsoft.Web/sites/config","location":"West + US","properties":{"FUNCTIONS_EXTENSION_VERSION":"~2","AzureWebJobsStorage":"DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=clitest000002;AccountKey=veryFakedStorageAccountKey==","AzureWebJobsDashboard":"DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=clitest000002;AccountKey=veryFakedStorageAccountKey==","WEBSITE_NODE_DEFAULT_VERSION":"~10","WEBSITE_CONTENTAZUREFILECONNECTIONSTRING":"DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=clitest000002;AccountKey=veryFakedStorageAccountKey==","WEBSITE_CONTENTSHARE":"cli-funcapp-nwr000003"}}' + headers: + cache-control: + - no-cache + content-length: + - '1135' + content-type: + - application/json + date: + - Fri, 21 Feb 2020 15:39:25 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-resource-requests: + - '11999' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: 'b''{"kind": "", "properties": {"FUNCTIONS_EXTENSION_VERSION": + "~2", "AzureWebJobsStorage": "DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=clitest000002;AccountKey=veryFakedStorageAccountKey==", + "AzureWebJobsDashboard": "DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=clitest000002;AccountKey=veryFakedStorageAccountKey==", + "WEBSITE_NODE_DEFAULT_VERSION": "~10", "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": + "DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=clitest000002;AccountKey=veryFakedStorageAccountKey==", + "WEBSITE_CONTENTSHARE": "cli-funcapp-nwr000003", "APPINSIGHTS_INSTRUMENTATIONKEY": + "af633fb1-f616-45b7-84a1-d35ec54c375b"}}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - functionapp create + Connection: + - keep-alive + Content-Length: + - '944' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n --consumption-plan-location -s + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-web/0.44.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-funcapp-nwr000003/config/appsettings?api-version=2019-08-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-funcapp-nwr000003/config/appsettings","name":"appsettings","type":"Microsoft.Web/sites/config","location":"West + US","properties":{"FUNCTIONS_EXTENSION_VERSION":"~2","AzureWebJobsStorage":"DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=clitest000002;AccountKey=veryFakedStorageAccountKey==","AzureWebJobsDashboard":"DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=clitest000002;AccountKey=veryFakedStorageAccountKey==","WEBSITE_NODE_DEFAULT_VERSION":"~10","WEBSITE_CONTENTAZUREFILECONNECTIONSTRING":"DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=clitest000002;AccountKey=veryFakedStorageAccountKey==","WEBSITE_CONTENTSHARE":"cli-funcapp-nwr000003","APPINSIGHTS_INSTRUMENTATIONKEY":"af633fb1-f616-45b7-84a1-d35ec54c375b"}}' + headers: + cache-control: + - no-cache + content-length: + - '1207' + content-type: + - application/json + date: + - Fri, 21 Feb 2020 15:39:28 GMT + etag: + - '"1D5E8CD19BE2890"' + 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: + - functionapp config access-restriction add + Connection: + - keep-alive + ParameterSetName: + - -g -n --rule-name --action --ip-address --priority + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-web/0.44.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-funcapp-nwr000003/config/web?api-version=2019-08-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-funcapp-nwr000003/config/web","name":"cli-funcapp-nwr000003","type":"Microsoft.Web/sites/config","location":"West + US","properties":{"numberOfWorkers":1,"defaultDocuments":["Default.htm","Default.html","Default.asp","index.htm","index.html","iisstart.htm","default.aspx","index.php"],"netFrameworkVersion":"v4.0","phpVersion":"5.6","pythonVersion":"","nodeVersion":"","linuxFxVersion":"","windowsFxVersion":null,"requestTracingEnabled":false,"remoteDebuggingEnabled":false,"remoteDebuggingVersion":null,"httpLoggingEnabled":false,"azureMonitorLogCategories":null,"logsDirectorySizeLimit":35,"detailedErrorLoggingEnabled":false,"publishingUsername":"$cli-funcapp-nwr000003","publishingPassword":null,"appSettings":null,"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":"None","use32BitWorkerProcess":true,"webSocketsEnabled":false,"alwaysOn":false,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":"","managedPipelineMode":"Integrated","virtualApplications":[{"virtualPath":"/","physicalPath":"site\\wwwroot","preloadEnabled":false,"virtualDirectories":null}],"winAuthAdminState":0,"winAuthTenantState":0,"customAppPoolIdentityAdminState":false,"customAppPoolIdentityTenantState":false,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":"LeastRequests","routingRules":[],"experiments":{"rampUpRules":[]},"limits":null,"autoHealEnabled":false,"autoHealRules":null,"tracingOptions":null,"vnetName":"","siteAuthEnabled":false,"siteAuthSettings":{"enabled":null,"unauthenticatedClientAction":null,"tokenStoreEnabled":null,"allowedExternalRedirectUrls":null,"defaultProvider":null,"clientId":null,"clientSecret":null,"clientSecretCertificateThumbprint":null,"issuer":null,"allowedAudiences":null,"additionalLoginParams":null,"isAadAutoProvisioned":false,"googleClientId":null,"googleClientSecret":null,"googleOAuthScopes":null,"facebookAppId":null,"facebookAppSecret":null,"facebookOAuthScopes":null,"twitterConsumerKey":null,"twitterConsumerSecret":null,"microsoftAccountClientId":null,"microsoftAccountClientSecret":null,"microsoftAccountOAuthScopes":null},"cors":{"allowedOrigins":["https://functions.azure.com","https://functions-staging.azure.com","https://functions-next.azure.com"],"supportCredentials":false},"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":false,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow + all","description":"Allow all access"}],"scmIpSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow + all","description":"Allow all access"}],"scmIpSecurityRestrictionsUseMain":false,"http20Enabled":true,"minTlsVersion":"1.2","ftpsState":"AllAllowed","preWarmedInstanceCount":0,"healthCheckPath":null,"fileChangeAuditEnabled":false,"functionsRuntimeScaleMonitoringEnabled":false,"websiteTimeZone":null}}' + headers: + cache-control: + - no-cache + content-length: + - '3212' + content-type: + - application/json + date: + - Fri, 21 Feb 2020 15:39:31 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"properties": {"numberOfWorkers": 1, "defaultDocuments": ["Default.htm", + "Default.html", "Default.asp", "index.htm", "index.html", "iisstart.htm", "default.aspx", + "index.php"], "netFrameworkVersion": "v4.0", "phpVersion": "5.6", "pythonVersion": + "", "nodeVersion": "", "linuxFxVersion": "", "requestTracingEnabled": false, + "remoteDebuggingEnabled": false, "httpLoggingEnabled": false, "logsDirectorySizeLimit": + 35, "detailedErrorLoggingEnabled": false, "publishingUsername": "$cli-funcapp-nwr000003", + "scmType": "None", "use32BitWorkerProcess": true, "webSocketsEnabled": false, + "alwaysOn": false, "appCommandLine": "", "managedPipelineMode": "Integrated", + "virtualApplications": [{"virtualPath": "/", "physicalPath": "site\\wwwroot", + "preloadEnabled": false}], "loadBalancing": "LeastRequests", "experiments": + {"rampUpRules": []}, "autoHealEnabled": false, "vnetName": "", "cors": {"allowedOrigins": + ["https://functions.azure.com", "https://functions-staging.azure.com", "https://functions-next.azure.com"], + "supportCredentials": false}, "localMySqlEnabled": false, "ipSecurityRestrictions": + [{"ipAddress": "Any", "action": "Allow", "priority": 1, "name": "Allow all", + "description": "Allow all access"}, {"ipAddress": "130.220.0.0/32", "action": + "Allow", "tag": "Default", "priority": 200, "name": "ipv4"}], "scmIpSecurityRestrictions": + [{"ipAddress": "Any", "action": "Allow", "priority": 1, "name": "Allow all", + "description": "Allow all access"}], "scmIpSecurityRestrictionsUseMain": false, + "http20Enabled": true, "minTlsVersion": "1.2", "ftpsState": "AllAllowed", "preWarmedInstanceCount": + 0}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - functionapp config access-restriction add + Connection: + - keep-alive + Content-Length: + - '1603' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n --rule-name --action --ip-address --priority + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-web/0.44.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-funcapp-nwr000003/config/web?api-version=2019-08-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-funcapp-nwr000003","name":"cli-funcapp-nwr000003","type":"Microsoft.Web/sites","location":"West + US","properties":{"numberOfWorkers":1,"defaultDocuments":["Default.htm","Default.html","Default.asp","index.htm","index.html","iisstart.htm","default.aspx","index.php"],"netFrameworkVersion":"v4.0","phpVersion":"5.6","pythonVersion":"","nodeVersion":"","linuxFxVersion":"","windowsFxVersion":null,"requestTracingEnabled":false,"remoteDebuggingEnabled":false,"remoteDebuggingVersion":"VS2019","httpLoggingEnabled":false,"azureMonitorLogCategories":null,"logsDirectorySizeLimit":35,"detailedErrorLoggingEnabled":false,"publishingUsername":"$cli-funcapp-nwr000003","publishingPassword":null,"appSettings":null,"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":"None","use32BitWorkerProcess":true,"webSocketsEnabled":false,"alwaysOn":false,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":"","managedPipelineMode":"Integrated","virtualApplications":[{"virtualPath":"/","physicalPath":"site\\wwwroot","preloadEnabled":false,"virtualDirectories":null}],"winAuthAdminState":0,"winAuthTenantState":0,"customAppPoolIdentityAdminState":false,"customAppPoolIdentityTenantState":false,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":"LeastRequests","routingRules":[],"experiments":{"rampUpRules":[]},"limits":null,"autoHealEnabled":false,"autoHealRules":null,"tracingOptions":null,"vnetName":"","siteAuthEnabled":false,"siteAuthSettings":{"enabled":null,"unauthenticatedClientAction":null,"tokenStoreEnabled":null,"allowedExternalRedirectUrls":null,"defaultProvider":null,"clientId":null,"clientSecret":null,"clientSecretCertificateThumbprint":null,"issuer":null,"allowedAudiences":null,"additionalLoginParams":null,"isAadAutoProvisioned":false,"googleClientId":null,"googleClientSecret":null,"googleOAuthScopes":null,"facebookAppId":null,"facebookAppSecret":null,"facebookOAuthScopes":null,"twitterConsumerKey":null,"twitterConsumerSecret":null,"microsoftAccountClientId":null,"microsoftAccountClientSecret":null,"microsoftAccountOAuthScopes":null},"cors":{"allowedOrigins":["https://functions.azure.com","https://functions-staging.azure.com","https://functions-next.azure.com"],"supportCredentials":false},"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":false,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"130.220.0.0/32","action":"Allow","tag":"Default","priority":200,"name":"ipv4"},{"ipAddress":"Any","action":"Deny","priority":2147483647,"name":"Deny + all","description":"Deny all access"}],"scmIpSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow + all","description":"Allow all access"}],"scmIpSecurityRestrictionsUseMain":false,"http20Enabled":true,"minTlsVersion":"1.2","ftpsState":"AllAllowed","preWarmedInstanceCount":0,"healthCheckPath":null,"fileChangeAuditEnabled":false,"functionsRuntimeScaleMonitoringEnabled":false,"websiteTimeZone":null}}' + headers: + cache-control: + - no-cache + content-length: + - '3297' + content-type: + - application/json + date: + - Fri, 21 Feb 2020 15:39:35 GMT + etag: + - '"1D5E8CD19BE2890"' + 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: + - functionapp config access-restriction add + Connection: + - keep-alive + ParameterSetName: + - -g -n --rule-name --action --ip-address --priority + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-web/0.44.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-funcapp-nwr000003/config/web?api-version=2019-08-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-funcapp-nwr000003/config/web","name":"cli-funcapp-nwr000003","type":"Microsoft.Web/sites/config","location":"West + US","properties":{"numberOfWorkers":1,"defaultDocuments":["Default.htm","Default.html","Default.asp","index.htm","index.html","iisstart.htm","default.aspx","index.php"],"netFrameworkVersion":"v4.0","phpVersion":"5.6","pythonVersion":"","nodeVersion":"","linuxFxVersion":"","windowsFxVersion":null,"requestTracingEnabled":false,"remoteDebuggingEnabled":false,"remoteDebuggingVersion":"VS2019","httpLoggingEnabled":false,"azureMonitorLogCategories":null,"logsDirectorySizeLimit":35,"detailedErrorLoggingEnabled":false,"publishingUsername":"$cli-funcapp-nwr000003","publishingPassword":null,"appSettings":null,"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":"None","use32BitWorkerProcess":true,"webSocketsEnabled":false,"alwaysOn":false,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":"","managedPipelineMode":"Integrated","virtualApplications":[{"virtualPath":"/","physicalPath":"site\\wwwroot","preloadEnabled":false,"virtualDirectories":null}],"winAuthAdminState":0,"winAuthTenantState":0,"customAppPoolIdentityAdminState":false,"customAppPoolIdentityTenantState":false,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":"LeastRequests","routingRules":[],"experiments":{"rampUpRules":[]},"limits":null,"autoHealEnabled":false,"autoHealRules":null,"tracingOptions":null,"vnetName":"","siteAuthEnabled":false,"siteAuthSettings":{"enabled":null,"unauthenticatedClientAction":null,"tokenStoreEnabled":null,"allowedExternalRedirectUrls":null,"defaultProvider":null,"clientId":null,"clientSecret":null,"clientSecretCertificateThumbprint":null,"issuer":null,"allowedAudiences":null,"additionalLoginParams":null,"isAadAutoProvisioned":false,"googleClientId":null,"googleClientSecret":null,"googleOAuthScopes":null,"facebookAppId":null,"facebookAppSecret":null,"facebookOAuthScopes":null,"twitterConsumerKey":null,"twitterConsumerSecret":null,"microsoftAccountClientId":null,"microsoftAccountClientSecret":null,"microsoftAccountOAuthScopes":null},"cors":{"allowedOrigins":["https://functions.azure.com","https://functions-staging.azure.com","https://functions-next.azure.com"],"supportCredentials":false},"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":false,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"130.220.0.0/32","action":"Allow","tag":"Default","priority":200,"name":"ipv4"},{"ipAddress":"Any","action":"Deny","priority":2147483647,"name":"Deny + all","description":"Deny all access"}],"scmIpSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow + all","description":"Allow all access"}],"scmIpSecurityRestrictionsUseMain":false,"http20Enabled":true,"minTlsVersion":"1.2","ftpsState":"AllAllowed","preWarmedInstanceCount":0,"healthCheckPath":null,"fileChangeAuditEnabled":false,"functionsRuntimeScaleMonitoringEnabled":false,"websiteTimeZone":null}}' + headers: + cache-control: + - no-cache + content-length: + - '3315' + content-type: + - application/json + date: + - Fri, 21 Feb 2020 15:39:37 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": {"numberOfWorkers": 1, "defaultDocuments": ["Default.htm", + "Default.html", "Default.asp", "index.htm", "index.html", "iisstart.htm", "default.aspx", + "index.php"], "netFrameworkVersion": "v4.0", "phpVersion": "5.6", "pythonVersion": + "", "nodeVersion": "", "linuxFxVersion": "", "requestTracingEnabled": false, + "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2019", "httpLoggingEnabled": + false, "logsDirectorySizeLimit": 35, "detailedErrorLoggingEnabled": false, "publishingUsername": + "$cli-funcapp-nwr000003", "scmType": "None", "use32BitWorkerProcess": true, + "webSocketsEnabled": false, "alwaysOn": false, "appCommandLine": "", "managedPipelineMode": + "Integrated", "virtualApplications": [{"virtualPath": "/", "physicalPath": "site\\wwwroot", + "preloadEnabled": false}], "loadBalancing": "LeastRequests", "experiments": + {"rampUpRules": []}, "autoHealEnabled": false, "vnetName": "", "cors": {"allowedOrigins": + ["https://functions.azure.com", "https://functions-staging.azure.com", "https://functions-next.azure.com"], + "supportCredentials": false}, "localMySqlEnabled": false, "ipSecurityRestrictions": + [{"ipAddress": "130.220.0.0/32", "action": "Allow", "tag": "Default", "priority": + 200, "name": "ipv4"}, {"ipAddress": "Any", "action": "Deny", "priority": 2147483647, + "name": "Deny all", "description": "Deny all access"}, {"ipAddress": "2004::1000/128", + "action": "Allow", "tag": "Default", "priority": 200, "name": "ipv6"}], "scmIpSecurityRestrictions": + [{"ipAddress": "Any", "action": "Allow", "priority": 1, "name": "Allow all", + "description": "Allow all access"}], "scmIpSecurityRestrictionsUseMain": false, + "http20Enabled": true, "minTlsVersion": "1.2", "ftpsState": "AllAllowed", "preWarmedInstanceCount": + 0}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - functionapp config access-restriction add + Connection: + - keep-alive + Content-Length: + - '1748' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n --rule-name --action --ip-address --priority + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 + azure-mgmt-web/0.44.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-funcapp-nwr000003/config/web?api-version=2019-08-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-funcapp-nwr000003","name":"cli-funcapp-nwr000003","type":"Microsoft.Web/sites","location":"West + US","properties":{"numberOfWorkers":1,"defaultDocuments":["Default.htm","Default.html","Default.asp","index.htm","index.html","iisstart.htm","default.aspx","index.php"],"netFrameworkVersion":"v4.0","phpVersion":"5.6","pythonVersion":"","nodeVersion":"","linuxFxVersion":"","windowsFxVersion":null,"requestTracingEnabled":false,"remoteDebuggingEnabled":false,"remoteDebuggingVersion":"VS2019","httpLoggingEnabled":false,"azureMonitorLogCategories":null,"logsDirectorySizeLimit":35,"detailedErrorLoggingEnabled":false,"publishingUsername":"$cli-funcapp-nwr000003","publishingPassword":null,"appSettings":null,"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":"None","use32BitWorkerProcess":true,"webSocketsEnabled":false,"alwaysOn":false,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":"","managedPipelineMode":"Integrated","virtualApplications":[{"virtualPath":"/","physicalPath":"site\\wwwroot","preloadEnabled":false,"virtualDirectories":null}],"winAuthAdminState":0,"winAuthTenantState":0,"customAppPoolIdentityAdminState":false,"customAppPoolIdentityTenantState":false,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":"LeastRequests","routingRules":[],"experiments":{"rampUpRules":[]},"limits":null,"autoHealEnabled":false,"autoHealRules":null,"tracingOptions":null,"vnetName":"","siteAuthEnabled":false,"siteAuthSettings":{"enabled":null,"unauthenticatedClientAction":null,"tokenStoreEnabled":null,"allowedExternalRedirectUrls":null,"defaultProvider":null,"clientId":null,"clientSecret":null,"clientSecretCertificateThumbprint":null,"issuer":null,"allowedAudiences":null,"additionalLoginParams":null,"isAadAutoProvisioned":false,"googleClientId":null,"googleClientSecret":null,"googleOAuthScopes":null,"facebookAppId":null,"facebookAppSecret":null,"facebookOAuthScopes":null,"twitterConsumerKey":null,"twitterConsumerSecret":null,"microsoftAccountClientId":null,"microsoftAccountClientSecret":null,"microsoftAccountOAuthScopes":null},"cors":{"allowedOrigins":["https://functions.azure.com","https://functions-staging.azure.com","https://functions-next.azure.com"],"supportCredentials":false},"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":false,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"130.220.0.0/32","action":"Allow","tag":"Default","priority":200,"name":"ipv4"},{"ipAddress":"2004::1000/128","action":"Allow","tag":"Default","priority":200,"name":"ipv6"},{"ipAddress":"Any","action":"Deny","priority":2147483647,"name":"Deny + all","description":"Deny all access"}],"scmIpSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow + all","description":"Allow all access"}],"scmIpSecurityRestrictionsUseMain":false,"http20Enabled":true,"minTlsVersion":"1.2","ftpsState":"AllAllowed","preWarmedInstanceCount":0,"healthCheckPath":null,"fileChangeAuditEnabled":false,"functionsRuntimeScaleMonitoringEnabled":false,"websiteTimeZone":null}}' + headers: + cache-control: + - no-cache + content-length: + - '3390' + content-type: + - application/json + date: + - Fri, 21 Feb 2020 15:39:41 GMT + etag: + - '"1D5E8CD1E0EE510"' + 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/azure-cli/azure/cli/command_modules/appservice/tests/latest/recordings/test_webapp_access_restriction_add_ip_address_validation.yaml b/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/recordings/test_webapp_access_restriction_add_ip_address_validation.yaml new file mode 100644 index 00000000000..54f11f59077 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/recordings/test_webapp_access_restriction_add_ip_address_validation.yaml @@ -0,0 +1,798 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - appservice plan create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 + azure-mgmt-resource/8.0.1 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-02-21T16:12:33Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '428' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 21 Feb 2020 16:12:39 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-plan-nwr000003", "type": "Microsoft.Web/serverfarms", "location": + "westus", "properties": {"skuName": "B1", "capacity": 1}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - appservice plan create + Connection: + - keep-alive + Content-Length: + - '143' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 + azure-mgmt-web/0.44.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/validate?api-version=2019-08-01 + response: + body: + string: '{"status":"Success","error":null}' + headers: + cache-control: + - no-cache + content-length: + - '33' + content-type: + - application/json + date: + - Fri, 21 Feb 2020 16:12:40 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: + - appservice plan create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 + azure-mgmt-resource/8.0.1 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-02-21T16:12:33Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '428' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 21 Feb 2020 16:12:40 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": {"perSiteScaling": false, "isXenon": + false}, "sku": {"name": "B1", "tier": "BASIC", "capacity": 1}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - appservice plan create + Connection: + - keep-alive + Content-Length: + - '136' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 + azure-mgmt-web/0.44.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/cli-plan-nwr000003?api-version=2019-08-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/cli-plan-nwr000003","name":"cli-plan-nwr000003","type":"Microsoft.Web/serverfarms","kind":"app","location":"West + US","properties":{"serverFarmId":14177,"name":"cli-plan-nwr000003","workerSize":"Default","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Default","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"clitest.rg000001-WestUSwebspace","subscription":"a6f7834d-3304-4890-82af-ec04cb382539","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":3,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Dedicated","siteMode":null,"geoRegion":"West + US","perSiteScaling":false,"maximumElasticWorkerCount":1,"numberOfSites":0,"hostingEnvironmentId":null,"isSpot":false,"spotExpirationTime":null,"freeOfferExpirationTime":null,"tags":null,"kind":"app","resourceGroup":"clitest.rg000001","reserved":false,"isXenon":false,"hyperV":false,"mdmId":"waws-prod-bay-137_14177","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded","webSiteId":null,"existingServerFarmIds":null},"sku":{"name":"B1","tier":"Basic","size":"B1","family":"B","capacity":1}}' + headers: + cache-control: + - no-cache + content-length: + - '1524' + content-type: + - application/json + date: + - Fri, 21 Feb 2020 16:12:53 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: + - '1197' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - webapp create + Connection: + - keep-alive + ParameterSetName: + - -g -n --plan + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 + azure-mgmt-web/0.44.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/cli-plan-nwr000003?api-version=2019-08-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/cli-plan-nwr000003","name":"cli-plan-nwr000003","type":"Microsoft.Web/serverfarms","kind":"app","location":"West + US","properties":{"serverFarmId":14177,"name":"cli-plan-nwr000003","workerSize":"Default","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Default","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"clitest.rg000001-WestUSwebspace","subscription":"a6f7834d-3304-4890-82af-ec04cb382539","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":3,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Dedicated","siteMode":null,"geoRegion":"West + US","perSiteScaling":false,"maximumElasticWorkerCount":1,"numberOfSites":0,"hostingEnvironmentId":null,"isSpot":false,"spotExpirationTime":null,"freeOfferExpirationTime":null,"tags":null,"kind":"app","resourceGroup":"clitest.rg000001","reserved":false,"isXenon":false,"hyperV":false,"mdmId":"waws-prod-bay-137_14177","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded","webSiteId":null,"existingServerFarmIds":null},"sku":{"name":"B1","tier":"Basic","size":"B1","family":"B","capacity":1}}' + headers: + cache-control: + - no-cache + content-length: + - '1524' + content-type: + - application/json + date: + - Fri, 21 Feb 2020 16:12:54 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: 'b''{"name": "cli-webapp-nwr000002", "type": "Microsoft.Web/sites", "location": + "West US", "properties": {"serverFarmId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/cli-plan-nwr000003"}}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - webapp create + Connection: + - keep-alive + Content-Length: + - '329' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n --plan + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 + azure-mgmt-web/0.44.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/validate?api-version=2019-08-01 + response: + body: + string: '{"status":"Success","error":null}' + headers: + cache-control: + - no-cache + content-length: + - '33' + content-type: + - application/json + date: + - Fri, 21 Feb 2020 16:12:54 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: + - webapp create + Connection: + - keep-alive + ParameterSetName: + - -g -n --plan + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 + azure-mgmt-web/0.44.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/cli-plan-nwr000003?api-version=2019-08-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/cli-plan-nwr000003","name":"cli-plan-nwr000003","type":"Microsoft.Web/serverfarms","kind":"app","location":"West + US","properties":{"serverFarmId":14177,"name":"cli-plan-nwr000003","workerSize":"Default","workerSizeId":0,"workerTierName":null,"numberOfWorkers":1,"currentWorkerSize":"Default","currentWorkerSizeId":0,"currentNumberOfWorkers":1,"status":"Ready","webSpace":"clitest.rg000001-WestUSwebspace","subscription":"a6f7834d-3304-4890-82af-ec04cb382539","adminSiteName":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"maximumNumberOfWorkers":3,"planName":"VirtualDedicatedPlan","adminRuntimeSiteName":null,"computeMode":"Dedicated","siteMode":null,"geoRegion":"West + US","perSiteScaling":false,"maximumElasticWorkerCount":1,"numberOfSites":0,"hostingEnvironmentId":null,"isSpot":false,"spotExpirationTime":null,"freeOfferExpirationTime":null,"tags":null,"kind":"app","resourceGroup":"clitest.rg000001","reserved":false,"isXenon":false,"hyperV":false,"mdmId":"waws-prod-bay-137_14177","targetWorkerCount":0,"targetWorkerSizeId":0,"provisioningState":"Succeeded","webSiteId":null,"existingServerFarmIds":null},"sku":{"name":"B1","tier":"Basic","size":"B1","family":"B","capacity":1}}' + headers: + cache-control: + - no-cache + content-length: + - '1524' + content-type: + - application/json + date: + - Fri, 21 Feb 2020 16:12:55 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: 'b''{"location": "West US", "properties": {"serverFarmId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/cli-plan-nwr000003", + "reserved": false, "isXenon": false, "hyperV": false, "siteConfig": {"netFrameworkVersion": + "v4.6", "appSettings": [{"name": "WEBSITE_NODE_DEFAULT_VERSION", "value": "10.14"}], + "localMySqlEnabled": false, "http20Enabled": true}, "scmSiteAlsoStopped": false, + "httpsOnly": false}}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - webapp create + Connection: + - keep-alive + Content-Length: + - '540' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n --plan + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 + azure-mgmt-web/0.44.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-webapp-nwr000002?api-version=2019-08-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-webapp-nwr000002","name":"cli-webapp-nwr000002","type":"Microsoft.Web/sites","kind":"app","location":"West + US","properties":{"name":"cli-webapp-nwr000002","state":"Running","hostNames":["cli-webapp-nwr000002.azurewebsites.net"],"webSpace":"clitest.rg000001-WestUSwebspace","selfLink":"https://waws-prod-bay-137.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/clitest.rg000001-WestUSwebspace/sites/cli-webapp-nwr000002","repositorySiteName":"cli-webapp-nwr000002","owner":null,"usageState":"Normal","enabled":true,"adminEnabled":true,"enabledHostNames":["cli-webapp-nwr000002.azurewebsites.net","cli-webapp-nwr000002.scm.azurewebsites.net"],"siteProperties":{"metadata":null,"properties":[{"name":"LinuxFxVersion","value":""},{"name":"WindowsFxVersion","value":null}],"appSettings":null},"availabilityState":"Normal","sslCertificates":null,"csrs":[],"cers":null,"siteMode":null,"hostNameSslStates":[{"name":"cli-webapp-nwr000002.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Standard"},{"name":"cli-webapp-nwr000002.scm.azurewebsites.net","sslState":"Disabled","ipBasedSslResult":null,"virtualIP":null,"thumbprint":null,"toUpdate":null,"toUpdateIpBasedSsl":null,"ipBasedSslState":"NotConfigured","hostType":"Repository"}],"computeMode":null,"serverFarm":null,"serverFarmId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/serverfarms/cli-plan-nwr000003","reserved":false,"isXenon":false,"hyperV":false,"lastModifiedTimeUtc":"2020-02-21T16:13:00.09","storageRecoveryDefaultState":"Running","contentAvailabilityState":"Normal","runtimeAvailabilityState":"Normal","siteConfig":null,"deploymentId":"cli-webapp-nwr000002","trafficManagerHostNames":null,"sku":"Basic","scmSiteAlsoStopped":false,"targetSwapSlot":null,"hostingEnvironment":null,"hostingEnvironmentProfile":null,"clientAffinityEnabled":true,"clientCertEnabled":false,"clientCertExclusionPaths":null,"hostNamesDisabled":false,"domainVerificationIdentifiers":null,"customDomainVerificationId":"EFA957C50443DBB4536213E2E5D52CDD8FAA04F188EEE70E44439F0701C2AF7C","kind":"app","inboundIpAddress":"40.112.243.6","possibleInboundIpAddresses":"40.112.243.6","outboundIpAddresses":"40.112.243.6,13.93.220.248,13.93.221.96,13.93.221.41,13.93.220.182","possibleOutboundIpAddresses":"40.112.243.6,13.93.220.248,13.93.221.96,13.93.221.41,13.93.220.182,13.93.221.147,13.93.220.112,13.91.111.88,13.93.220.5,13.93.220.231","containerSize":0,"dailyMemoryTimeQuota":0,"suspendedTill":null,"siteDisabledReason":0,"functionExecutionUnitsCache":null,"maxNumberOfWorkers":null,"homeStamp":"waws-prod-bay-137","cloningInfo":null,"hostingEnvironmentId":null,"tags":null,"resourceGroup":"clitest.rg000001","defaultHostName":"cli-webapp-nwr000002.azurewebsites.net","slotSwapStatus":null,"httpsOnly":false,"redundancyMode":"None","inProgressOperationId":null,"geoDistributions":null,"privateEndpointConnections":null,"buildVersion":null,"targetBuildVersion":null}}' + headers: + cache-control: + - no-cache + content-length: + - '3618' + content-type: + - application/json + date: + - Fri, 21 Feb 2020 16:13:17 GMT + etag: + - '"1D5E8D1C9A1D715"' + 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-resource-requests: + - '499' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{}' + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + CommandName: + - webapp create + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n --plan + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 + azure-mgmt-web/0.44.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-webapp-nwr000002/publishxml?api-version=2019-08-01 + response: + body: + string: + headers: + cache-control: + - no-cache + content-length: + - '1730' + content-type: + - application/xml + date: + - Fri, 21 Feb 2020 16:13:17 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - webapp config access-restriction add + Connection: + - keep-alive + ParameterSetName: + - -g -n --rule-name --action --ip-address --priority + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 + azure-mgmt-web/0.44.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-webapp-nwr000002/config/web?api-version=2019-08-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-webapp-nwr000002/config/web","name":"cli-webapp-nwr000002","type":"Microsoft.Web/sites/config","location":"West + US","properties":{"numberOfWorkers":1,"defaultDocuments":["Default.htm","Default.html","Default.asp","index.htm","index.html","iisstart.htm","default.aspx","index.php","hostingstart.html"],"netFrameworkVersion":"v4.0","phpVersion":"5.6","pythonVersion":"","nodeVersion":"","linuxFxVersion":"","windowsFxVersion":null,"requestTracingEnabled":false,"remoteDebuggingEnabled":false,"remoteDebuggingVersion":null,"httpLoggingEnabled":false,"azureMonitorLogCategories":null,"logsDirectorySizeLimit":35,"detailedErrorLoggingEnabled":false,"publishingUsername":"$cli-webapp-nwr000002","publishingPassword":null,"appSettings":null,"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":"None","use32BitWorkerProcess":true,"webSocketsEnabled":false,"alwaysOn":false,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":"","managedPipelineMode":"Integrated","virtualApplications":[{"virtualPath":"/","physicalPath":"site\\wwwroot","preloadEnabled":false,"virtualDirectories":null}],"winAuthAdminState":0,"winAuthTenantState":0,"customAppPoolIdentityAdminState":false,"customAppPoolIdentityTenantState":false,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":"LeastRequests","routingRules":[],"experiments":{"rampUpRules":[]},"limits":null,"autoHealEnabled":false,"autoHealRules":null,"tracingOptions":null,"vnetName":"","siteAuthEnabled":false,"siteAuthSettings":{"enabled":null,"unauthenticatedClientAction":null,"tokenStoreEnabled":null,"allowedExternalRedirectUrls":null,"defaultProvider":null,"clientId":null,"clientSecret":null,"clientSecretCertificateThumbprint":null,"issuer":null,"allowedAudiences":null,"additionalLoginParams":null,"isAadAutoProvisioned":false,"googleClientId":null,"googleClientSecret":null,"googleOAuthScopes":null,"facebookAppId":null,"facebookAppSecret":null,"facebookOAuthScopes":null,"twitterConsumerKey":null,"twitterConsumerSecret":null,"microsoftAccountClientId":null,"microsoftAccountClientSecret":null,"microsoftAccountOAuthScopes":null},"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":false,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow + all","description":"Allow all access"}],"scmIpSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow + all","description":"Allow all access"}],"scmIpSecurityRestrictionsUseMain":false,"http20Enabled":true,"minTlsVersion":"1.2","ftpsState":"AllAllowed","preWarmedInstanceCount":0,"healthCheckPath":null,"fileChangeAuditEnabled":false,"functionsRuntimeScaleMonitoringEnabled":false,"websiteTimeZone":null}}' + headers: + cache-control: + - no-cache + content-length: + - '3086' + content-type: + - application/json + date: + - Fri, 21 Feb 2020 16:13: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-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"properties": {"numberOfWorkers": 1, "defaultDocuments": ["Default.htm", + "Default.html", "Default.asp", "index.htm", "index.html", "iisstart.htm", "default.aspx", + "index.php", "hostingstart.html"], "netFrameworkVersion": "v4.0", "phpVersion": + "5.6", "pythonVersion": "", "nodeVersion": "", "linuxFxVersion": "", "requestTracingEnabled": + false, "remoteDebuggingEnabled": false, "httpLoggingEnabled": false, "logsDirectorySizeLimit": + 35, "detailedErrorLoggingEnabled": false, "publishingUsername": "$cli-webapp-nwr000002", + "scmType": "None", "use32BitWorkerProcess": true, "webSocketsEnabled": false, + "alwaysOn": false, "appCommandLine": "", "managedPipelineMode": "Integrated", + "virtualApplications": [{"virtualPath": "/", "physicalPath": "site\\wwwroot", + "preloadEnabled": false}], "loadBalancing": "LeastRequests", "experiments": + {"rampUpRules": []}, "autoHealEnabled": false, "vnetName": "", "localMySqlEnabled": + false, "ipSecurityRestrictions": [{"ipAddress": "Any", "action": "Allow", "priority": + 1, "name": "Allow all", "description": "Allow all access"}, {"ipAddress": "130.220.0.0/32", + "action": "Allow", "tag": "Default", "priority": 200, "name": "ipv4"}], "scmIpSecurityRestrictions": + [{"ipAddress": "Any", "action": "Allow", "priority": 1, "name": "Allow all", + "description": "Allow all access"}], "scmIpSecurityRestrictionsUseMain": false, + "http20Enabled": true, "minTlsVersion": "1.2", "ftpsState": "AllAllowed", "preWarmedInstanceCount": + 0}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - webapp config access-restriction add + Connection: + - keep-alive + Content-Length: + - '1459' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n --rule-name --action --ip-address --priority + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 + azure-mgmt-web/0.44.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-webapp-nwr000002/config/web?api-version=2019-08-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-webapp-nwr000002","name":"cli-webapp-nwr000002","type":"Microsoft.Web/sites","location":"West + US","properties":{"numberOfWorkers":1,"defaultDocuments":["Default.htm","Default.html","Default.asp","index.htm","index.html","iisstart.htm","default.aspx","index.php","hostingstart.html"],"netFrameworkVersion":"v4.0","phpVersion":"5.6","pythonVersion":"","nodeVersion":"","linuxFxVersion":"","windowsFxVersion":null,"requestTracingEnabled":false,"remoteDebuggingEnabled":false,"remoteDebuggingVersion":"VS2019","httpLoggingEnabled":false,"azureMonitorLogCategories":null,"logsDirectorySizeLimit":35,"detailedErrorLoggingEnabled":false,"publishingUsername":"$cli-webapp-nwr000002","publishingPassword":null,"appSettings":null,"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":"None","use32BitWorkerProcess":true,"webSocketsEnabled":false,"alwaysOn":false,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":"","managedPipelineMode":"Integrated","virtualApplications":[{"virtualPath":"/","physicalPath":"site\\wwwroot","preloadEnabled":false,"virtualDirectories":null}],"winAuthAdminState":0,"winAuthTenantState":0,"customAppPoolIdentityAdminState":false,"customAppPoolIdentityTenantState":false,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":"LeastRequests","routingRules":[],"experiments":{"rampUpRules":[]},"limits":null,"autoHealEnabled":false,"autoHealRules":null,"tracingOptions":null,"vnetName":"","siteAuthEnabled":false,"siteAuthSettings":{"enabled":null,"unauthenticatedClientAction":null,"tokenStoreEnabled":null,"allowedExternalRedirectUrls":null,"defaultProvider":null,"clientId":null,"clientSecret":null,"clientSecretCertificateThumbprint":null,"issuer":null,"allowedAudiences":null,"additionalLoginParams":null,"isAadAutoProvisioned":false,"googleClientId":null,"googleClientSecret":null,"googleOAuthScopes":null,"facebookAppId":null,"facebookAppSecret":null,"facebookOAuthScopes":null,"twitterConsumerKey":null,"twitterConsumerSecret":null,"microsoftAccountClientId":null,"microsoftAccountClientSecret":null,"microsoftAccountOAuthScopes":null},"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":false,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"130.220.0.0/32","action":"Allow","tag":"Default","priority":200,"name":"ipv4"},{"ipAddress":"Any","action":"Deny","priority":2147483647,"name":"Deny + all","description":"Deny all access"}],"scmIpSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow + all","description":"Allow all access"}],"scmIpSecurityRestrictionsUseMain":false,"http20Enabled":true,"minTlsVersion":"1.2","ftpsState":"AllAllowed","preWarmedInstanceCount":0,"healthCheckPath":null,"fileChangeAuditEnabled":false,"functionsRuntimeScaleMonitoringEnabled":false,"websiteTimeZone":null}}' + headers: + cache-control: + - no-cache + content-length: + - '3171' + content-type: + - application/json + date: + - Fri, 21 Feb 2020 16:13:20 GMT + etag: + - '"1D5E8D1C9A1D715"' + 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: + - '1197' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - webapp config access-restriction add + Connection: + - keep-alive + ParameterSetName: + - -g -n --rule-name --action --ip-address --priority + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 + azure-mgmt-web/0.44.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-webapp-nwr000002/config/web?api-version=2019-08-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-webapp-nwr000002/config/web","name":"cli-webapp-nwr000002","type":"Microsoft.Web/sites/config","location":"West + US","properties":{"numberOfWorkers":1,"defaultDocuments":["Default.htm","Default.html","Default.asp","index.htm","index.html","iisstart.htm","default.aspx","index.php","hostingstart.html"],"netFrameworkVersion":"v4.0","phpVersion":"5.6","pythonVersion":"","nodeVersion":"","linuxFxVersion":"","windowsFxVersion":null,"requestTracingEnabled":false,"remoteDebuggingEnabled":false,"remoteDebuggingVersion":"VS2019","httpLoggingEnabled":false,"azureMonitorLogCategories":null,"logsDirectorySizeLimit":35,"detailedErrorLoggingEnabled":false,"publishingUsername":"$cli-webapp-nwr000002","publishingPassword":null,"appSettings":null,"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":"None","use32BitWorkerProcess":true,"webSocketsEnabled":false,"alwaysOn":false,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":"","managedPipelineMode":"Integrated","virtualApplications":[{"virtualPath":"/","physicalPath":"site\\wwwroot","preloadEnabled":false,"virtualDirectories":null}],"winAuthAdminState":0,"winAuthTenantState":0,"customAppPoolIdentityAdminState":false,"customAppPoolIdentityTenantState":false,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":"LeastRequests","routingRules":[],"experiments":{"rampUpRules":[]},"limits":null,"autoHealEnabled":false,"autoHealRules":null,"tracingOptions":null,"vnetName":"","siteAuthEnabled":false,"siteAuthSettings":{"enabled":null,"unauthenticatedClientAction":null,"tokenStoreEnabled":null,"allowedExternalRedirectUrls":null,"defaultProvider":null,"clientId":null,"clientSecret":null,"clientSecretCertificateThumbprint":null,"issuer":null,"allowedAudiences":null,"additionalLoginParams":null,"isAadAutoProvisioned":false,"googleClientId":null,"googleClientSecret":null,"googleOAuthScopes":null,"facebookAppId":null,"facebookAppSecret":null,"facebookOAuthScopes":null,"twitterConsumerKey":null,"twitterConsumerSecret":null,"microsoftAccountClientId":null,"microsoftAccountClientSecret":null,"microsoftAccountOAuthScopes":null},"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":false,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"130.220.0.0/32","action":"Allow","tag":"Default","priority":200,"name":"ipv4"},{"ipAddress":"Any","action":"Deny","priority":2147483647,"name":"Deny + all","description":"Deny all access"}],"scmIpSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow + all","description":"Allow all access"}],"scmIpSecurityRestrictionsUseMain":false,"http20Enabled":true,"minTlsVersion":"1.2","ftpsState":"AllAllowed","preWarmedInstanceCount":0,"healthCheckPath":null,"fileChangeAuditEnabled":false,"functionsRuntimeScaleMonitoringEnabled":false,"websiteTimeZone":null}}' + headers: + cache-control: + - no-cache + content-length: + - '3189' + content-type: + - application/json + date: + - Fri, 21 Feb 2020 16:13:21 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"properties": {"numberOfWorkers": 1, "defaultDocuments": ["Default.htm", + "Default.html", "Default.asp", "index.htm", "index.html", "iisstart.htm", "default.aspx", + "index.php", "hostingstart.html"], "netFrameworkVersion": "v4.0", "phpVersion": + "5.6", "pythonVersion": "", "nodeVersion": "", "linuxFxVersion": "", "requestTracingEnabled": + false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2019", + "httpLoggingEnabled": false, "logsDirectorySizeLimit": 35, "detailedErrorLoggingEnabled": + false, "publishingUsername": "$cli-webapp-nwr000002", "scmType": "None", "use32BitWorkerProcess": + true, "webSocketsEnabled": false, "alwaysOn": false, "appCommandLine": "", "managedPipelineMode": + "Integrated", "virtualApplications": [{"virtualPath": "/", "physicalPath": "site\\wwwroot", + "preloadEnabled": false}], "loadBalancing": "LeastRequests", "experiments": + {"rampUpRules": []}, "autoHealEnabled": false, "vnetName": "", "localMySqlEnabled": + false, "ipSecurityRestrictions": [{"ipAddress": "130.220.0.0/32", "action": + "Allow", "tag": "Default", "priority": 200, "name": "ipv4"}, {"ipAddress": "Any", + "action": "Deny", "priority": 2147483647, "name": "Deny all", "description": + "Deny all access"}, {"ipAddress": "2004::1000/128", "action": "Allow", "tag": + "Default", "priority": 200, "name": "ipv6"}], "scmIpSecurityRestrictions": [{"ipAddress": + "Any", "action": "Allow", "priority": 1, "name": "Allow all", "description": + "Allow all access"}], "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": + true, "minTlsVersion": "1.2", "ftpsState": "AllAllowed", "preWarmedInstanceCount": + 0}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - webapp config access-restriction add + Connection: + - keep-alive + Content-Length: + - '1604' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n --rule-name --action --ip-address --priority + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.2 + azure-mgmt-web/0.44.0 Azure-SDK-For-Python AZURECLI/2.1.0 + accept-language: + - en-US + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-webapp-nwr000002/config/web?api-version=2019-08-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Web/sites/cli-webapp-nwr000002","name":"cli-webapp-nwr000002","type":"Microsoft.Web/sites","location":"West + US","properties":{"numberOfWorkers":1,"defaultDocuments":["Default.htm","Default.html","Default.asp","index.htm","index.html","iisstart.htm","default.aspx","index.php","hostingstart.html"],"netFrameworkVersion":"v4.0","phpVersion":"5.6","pythonVersion":"","nodeVersion":"","linuxFxVersion":"","windowsFxVersion":null,"requestTracingEnabled":false,"remoteDebuggingEnabled":false,"remoteDebuggingVersion":"VS2019","httpLoggingEnabled":false,"azureMonitorLogCategories":null,"logsDirectorySizeLimit":35,"detailedErrorLoggingEnabled":false,"publishingUsername":"$cli-webapp-nwr000002","publishingPassword":null,"appSettings":null,"metadata":null,"connectionStrings":null,"machineKey":null,"handlerMappings":null,"documentRoot":null,"scmType":"None","use32BitWorkerProcess":true,"webSocketsEnabled":false,"alwaysOn":false,"javaVersion":null,"javaContainer":null,"javaContainerVersion":null,"appCommandLine":"","managedPipelineMode":"Integrated","virtualApplications":[{"virtualPath":"/","physicalPath":"site\\wwwroot","preloadEnabled":false,"virtualDirectories":null}],"winAuthAdminState":0,"winAuthTenantState":0,"customAppPoolIdentityAdminState":false,"customAppPoolIdentityTenantState":false,"runtimeADUser":null,"runtimeADUserPassword":null,"loadBalancing":"LeastRequests","routingRules":[],"experiments":{"rampUpRules":[]},"limits":null,"autoHealEnabled":false,"autoHealRules":null,"tracingOptions":null,"vnetName":"","siteAuthEnabled":false,"siteAuthSettings":{"enabled":null,"unauthenticatedClientAction":null,"tokenStoreEnabled":null,"allowedExternalRedirectUrls":null,"defaultProvider":null,"clientId":null,"clientSecret":null,"clientSecretCertificateThumbprint":null,"issuer":null,"allowedAudiences":null,"additionalLoginParams":null,"isAadAutoProvisioned":false,"googleClientId":null,"googleClientSecret":null,"googleOAuthScopes":null,"facebookAppId":null,"facebookAppSecret":null,"facebookOAuthScopes":null,"twitterConsumerKey":null,"twitterConsumerSecret":null,"microsoftAccountClientId":null,"microsoftAccountClientSecret":null,"microsoftAccountOAuthScopes":null},"cors":null,"push":null,"apiDefinition":null,"apiManagementConfig":null,"autoSwapSlotName":null,"localMySqlEnabled":false,"managedServiceIdentityId":null,"xManagedServiceIdentityId":null,"ipSecurityRestrictions":[{"ipAddress":"130.220.0.0/32","action":"Allow","tag":"Default","priority":200,"name":"ipv4"},{"ipAddress":"2004::1000/128","action":"Allow","tag":"Default","priority":200,"name":"ipv6"},{"ipAddress":"Any","action":"Deny","priority":2147483647,"name":"Deny + all","description":"Deny all access"}],"scmIpSecurityRestrictions":[{"ipAddress":"Any","action":"Allow","priority":1,"name":"Allow + all","description":"Allow all access"}],"scmIpSecurityRestrictionsUseMain":false,"http20Enabled":true,"minTlsVersion":"1.2","ftpsState":"AllAllowed","preWarmedInstanceCount":0,"healthCheckPath":null,"fileChangeAuditEnabled":false,"functionsRuntimeScaleMonitoringEnabled":false,"websiteTimeZone":null}}' + headers: + cache-control: + - no-cache + content-length: + - '3264' + content-type: + - application/json + date: + - Fri, 21 Feb 2020 16:13:23 GMT + etag: + - '"1D5E8D1D58E1B4B"' + 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: + - '1195' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_access_restriction_commands.py b/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_access_restriction_commands.py index 9d35ba965e3..40a54928963 100644 --- a/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_access_restriction_commands.py +++ b/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_access_restriction_commands.py @@ -96,6 +96,34 @@ def test_functionapp_access_restriction_add(self, resource_group, location): JMESPathCheck('[1].action', 'Deny') ]) + @ResourceGroupPreparer(parameter_name_for_location='location') + @StorageAccountPreparer() + def test_functionapp_access_restriction_add_ip_address_validation(self, resource_group, location): + self.kwargs.update({ + 'app_name': self.create_random_name(prefix='cli-funcapp-nwr', length=24), + 'loc': location + }) + + self.cmd('functionapp create -g {rg} -n {app_name} --consumption-plan-location {loc} -s {sa}', checks=[ + JMESPathCheck('state', 'Running') + ]) + + self.cmd('functionapp config access-restriction add -g {rg} -n {app_name} --rule-name ipv4 --action Allow --ip-address 130.220.0.0 --priority 200', checks=[ + JMESPathCheck('length(@)', 2), + JMESPathCheck('[0].name', 'ipv4'), + JMESPathCheck('[0].action', 'Allow'), + JMESPathCheck('[0].ipAddress', '130.220.0.0/32'), + JMESPathCheck('[1].name', 'Deny all'), + JMESPathCheck('[1].action', 'Deny') + ]) + + self.cmd('functionapp config access-restriction add -g {rg} -n {app_name} --rule-name ipv6 --action Allow --ip-address 2004::1000 --priority 200', checks=[ + JMESPathCheck('length(@)', 3), + JMESPathCheck('[1].name', 'ipv6'), + JMESPathCheck('[1].action', 'Allow'), + JMESPathCheck('[1].ipAddress', '2004::1000/128') + ]) + @ResourceGroupPreparer(parameter_name_for_location='location') @StorageAccountPreparer() def test_functionapp_access_restriction_add_service_endpoint(self, resource_group, location): diff --git a/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_access_restriction_commands.py b/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_access_restriction_commands.py index b25fe8aa050..d5c17b4ea7a 100644 --- a/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_access_restriction_commands.py +++ b/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_access_restriction_commands.py @@ -96,6 +96,34 @@ def test_webapp_access_restriction_add(self, resource_group): JMESPathCheck('[1].action', 'Deny') ]) + @ResourceGroupPreparer(parameter_name_for_location='location') + def test_webapp_access_restriction_add_ip_address_validation(self, resource_group, location): + self.kwargs.update({ + 'app_name': self.create_random_name(prefix='cli-webapp-nwr', length=24), + 'plan_name': self.create_random_name(prefix='cli-plan-nwr', length=24) + }) + + self.cmd('appservice plan create -g {rg} -n {plan_name}') + self.cmd('webapp create -g {rg} -n {app_name} --plan {plan_name}', checks=[ + JMESPathCheck('state', 'Running') + ]) + + self.cmd('webapp config access-restriction add -g {rg} -n {app_name} --rule-name ipv4 --action Allow --ip-address 130.220.0.0 --priority 200', checks=[ + JMESPathCheck('length(@)', 2), + JMESPathCheck('[0].name', 'ipv4'), + JMESPathCheck('[0].action', 'Allow'), + JMESPathCheck('[0].ipAddress', '130.220.0.0/32'), + JMESPathCheck('[1].name', 'Deny all'), + JMESPathCheck('[1].action', 'Deny') + ]) + + self.cmd('webapp config access-restriction add -g {rg} -n {app_name} --rule-name ipv6 --action Allow --ip-address 2004::1000 --priority 200', checks=[ + JMESPathCheck('length(@)', 3), + JMESPathCheck('[1].name', 'ipv6'), + JMESPathCheck('[1].action', 'Allow'), + JMESPathCheck('[1].ipAddress', '2004::1000/128') + ]) + @ResourceGroupPreparer() def test_webapp_access_restriction_add_service_endpoint(self, resource_group): self.kwargs.update({