`az webapp vnet-integration add` fails when there are multiple vnets & subnets with same name in different resource groups.
This is autogenerated. Please review and update as needed.
Describe the bug
Command Name
az webapp vnet-integration add
Errors:
Operation returned an invalid status code 'Conflict'
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
- Put any pre-requisite steps here...
az webapp vnet-integration add -g some-resource-group -n some-resource-name --vnet some-vnet-name --subnet some-subnet-name
Expected Behavior
Environment Summary
Darwin-19.0.0-x86_64-i386-64bit
Python 3.7.5
Shell: bash
azure-cli 2.0.77
azure-cli-iot-ext 0.8.6
Extensions:
azure-cli-iot-ext 0.8.6
Additional Context
If there are multiple vnets with same name, and same subnet names, the az webapp vnet-integration add command fails with "Conflict", as it does not select the correct vnet for the integration. This might be random behaviour, as I suspect that it depends on which vnet appears first or second in the list of vnets the command finds.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AzureAppServiceCLI @antcp
@nilsga thanks for reporting can you ask you run this command with --debug flag & share the trace excluding any sensitive information? I am trying to get the full error from the API if possible. Thanks.
@ammanifold can you try if this repros for you & fix as needed. Thanks!
@nilsga can you please provide the trace after running --debug flag?
I don't have the setup anymore, but it should be easily reproducible by creating two resource groups, and then give the vnets and subnets the same names in each resource group.
I've run into the same error, but it was due to trying to add multiple app services / functions to the same subnet.
Same issue, az webapp vnet-integration add do not respect the --resource-group parameter
linux$ az webapp vnet-integration add -g djelk
-n lambdaville-kibana
--vnet es-net
--subnet lambdaville-subnet
--debug
msrest.http_logger : Response content:
msrest.http_logger : {"id":"/subscriptions/<subscription-id>/resourceGroups/djelk/providers/Microsoft.Web/sites/lambdaville-kibana/config/virtualNetwork","name":"virtualNetwork","type":"Microsoft.Web/sites/config","location":"North Europe","properties":{"subnetResourceId":null,"swiftSupported":true}}
adal-python : 6c569f56-553c-4acf-8a92-f95bbf0ecbd8 - Authority:Performing instance discovery: ...
adal-python : 6c569f56-553c-4acf-8a92-f95bbf0ecbd8 - Authority:Performing static instance discovery
adal-python : 6c569f56-553c-4acf-8a92-f95bbf0ecbd8 - Authority:Authority validated via static instance discovery
adal-python : 6c569f56-553c-4acf-8a92-f95bbf0ecbd8 - TokenRequest:Getting token from cache with refresh if necessary.
adal-python : 6c569f56-553c-4acf-8a92-f95bbf0ecbd8 - CacheDriver:finding with query keys: {'_clientId': '...', 'userId': '...'}
adal-python : 6c569f56-553c-4acf-8a92-f95bbf0ecbd8 - CacheDriver:Looking for potential cache entries: {'_clientId': '...', 'userId': '...'}
adal-python : 6c569f56-553c-4acf-8a92-f95bbf0ecbd8 - CacheDriver:Found 2 potential entries.
adal-python : 6c569f56-553c-4acf-8a92-f95bbf0ecbd8 - CacheDriver:Resource specific token found.
adal-python : 6c569f56-553c-4acf-8a92-f95bbf0ecbd8 - CacheDriver:Returning token from cache lookup, AccessTokenId: b'<token>', RefreshTokenId: b'<token>'
msrest.http_logger : Request URL: 'https://management.azure.com/subscriptions/<subscription-id>/resourceGroups/ertlog/providers/Microsoft.Network/virtualNetworks/es-net/subnets/lambdaville-subnet?api-version=2019-09-01'
msrest.http_logger : Request method: 'GET'
msrest.http_logger : Request headers:
msrest.http_logger : 'Accept': 'application/json'
msrest.http_logger : 'accept-language': 'en-US'
msrest.http_logger : 'User-Agent': 'python/3.6.5 (Linux-5.3.0-26-generic-x86_64-with-debian-buster-sid) msrest/0.6.9 msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python AZURECLI/2.0.80'
msrest.http_logger : Request body:
msrest.http_logger : None
msrest.universal_http : Configuring redirects: allow=True, max=30
msrest.universal_http : Configuring request: timeout=100, verify=True, cert=None
msrest.universal_http : Configuring proxies: ''
msrest.universal_http : Evaluate proxies against ENV settings: True
urllib3.connectionpool : https://management.azure.com:443 "GET /subscriptions/<subscription-id>/resourceGroups/ertlog/providers/Microsoft.Network/virtualNetworks/es-net/subnets/lambdaville-subnet?api-version=2019-09-01 HTTP/1.1" 404 262
msrest.http_logger : Response status: 404
msrest.http_logger : Response headers:
msrest.http_logger : 'Cache-Control': 'no-cache'
msrest.http_logger : 'Pragma': 'no-cache'
msrest.http_logger : 'Content-Length': '262'
msrest.http_logger : 'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger : 'Expires': '-1'
msrest.http_logger : 'x-ms-request-id': '36b065b3-5f38-4411-8c19-7e0554127f42'
msrest.http_logger : 'x-ms-correlation-request-id': 'ccf74d0c-30f5-45ef-b35b-4d0ab7b63784'
msrest.http_logger : 'x-ms-arm-service-request-id': '4662d701-445b-469b-b135-3cecd646a6ae'
msrest.http_logger : 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
msrest.http_logger : 'Server': 'Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0'
msrest.http_logger : 'x-ms-ratelimit-remaining-subscription-reads': '11994'
msrest.http_logger : 'x-ms-routing-request-id': 'NORTHEUROPE:20200122T104426Z:ccf74d0c-30f5-45ef-b35b-4d0ab7b63784'
msrest.http_logger : 'X-Content-Type-Options': 'nosniff'
msrest.http_logger : 'Date': 'Wed, 22 Jan 2020 10:44:26 GMT'
msrest.http_logger : Response content:
msrest.http_logger : {
"error": {
"code": "NotFound",
"message": "Resource /subscriptions/<subscription-id>/resourceGroups/ertlog/providers/Microsoft.Network/virtualNetworks/es-net/subnets/lambdaville-subnet not found.",
"details": []
}
}
msrest.exceptions : Resource /subscriptions/<subscription-id>/resourceGroups/ertlog/providers/Microsoft.Network/virtualNetworks/es-net/subnets/lambdaville-subnet not found.
cli.azure.cli.core.util : Resource /subscriptions/<subscription-id>/resourceGroups/ertlog/providers/Microsoft.Network/virtualNetworks/es-net/subnets/lambdaville-subnet not found.
Resource /subscriptions/<subscription-id>/resourceGroups/ertlog/providers/Microsoft.Network/virtualNetworks/es-net/subnets/lambdaville-subnet not found.
az_command_data_logger : exit code: 1
telemetry.save : Save telemetry record of length 2526 in cache
command ran in 2.438 seconds.
We can see that the resource group called is djelk, but later the subnet is searched for in ertlog which is another resource group with a vnet also named es-net.
Hope you can fix this issue soon :smiley:
move to S166.
move to S167.
are your vnet and webapps in the same resource group? i tried running this but it just errors saying the app and vnet need to be in the same region. i dont even have vnets with the same name so not sure how it is getting confused
@KyleHammackRS this command is strictly for regional vnet integration which does require the app service plan and vnet to be in the same region.
@KyleHammackRS this command is strictly for regional vnet integration which does require the app service plan and vnet to be in the same region.
i understand that its for regional vnet integration and that is what i am trying to enable, however as mentioned above, when i ran this the command it told me they need to be
Moving to S169
@ThejaChoudary can you check if you can repro this scenario. If so we can discuss the fix for this. Thank you.
taking a look in to this.
able to repro the issue. working on the fix.
move to S170
@calvinsID with the ventresourceID change you are making I am hoping this experience would be a lot better. Can you check? Thanks!
Sounds good, working on a fix