Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

webapp: --ip-address accepts only cidr not ip4 #12010

Closed
onstwedder opened this issue Jan 31, 2020 — with docs.microsoft.com · 7 comments · Fixed by #12312
Closed

webapp: --ip-address accepts only cidr not ip4 #12010

onstwedder opened this issue Jan 31, 2020 — with docs.microsoft.com · 7 comments · Fixed by #12312
Labels
Service Attention This issue is responsible by Azure service team. Web Apps az webapp

Comments

Copy link

e.g. just tried the following:
az webapp config access-restriction add -g <resourcegroupname> -n <Webappname> --action Allow --description 'Outgoing ip' --ip-address 50.69.29.185 --rule-name 'webplan' --priority 505

which resulted in:
Operation returned an invalid status code 'Bad Request'

However when i tried this:
az webapp config access-restriction add -g <resourcegroupname> -n <Webappname> --action Allow --description 'Outgoing ip' --ip-address 50.69.29.185/32 --rule-name 'webplan' --priority 505
It worked correctly.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@yonzhan yonzhan added the Web Apps az webapp label Jan 31, 2020
@yonzhan yonzhan added the Service Attention This issue is responsible by Azure service team. label Jan 31, 2020
@ghost
Copy link

ghost commented Jan 31, 2020

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AzureAppServiceCLI @antcp

@panchagnula
Copy link
Contributor

@madsd I haven't tried to repro this but wanted to check with you if this was by design. Thanks!

@panchagnula panchagnula changed the title --ip-address accepts only cidr not ip4 webapp: --ip-address accepts only cidr not ip4 Feb 17, 2020
@madsd
Copy link
Contributor

madsd commented Feb 17, 2020

@madsd I haven't tried to repro this but wanted to check with you if this was by design. Thanks!

Hi @panchagnula, this was by design, but that could be changed :-) Perhaps something as simple as checking for '.' or ':' (to know if it is ipv4 or ipv6) and then add respectively /32 and /128. Would that make sense?

@panchagnula
Copy link
Contributor

Thanks @madsd - Hmm not sure what the reasoning was for this to be ByDesign since on Portal we do support Ipv4 and IpV6.

@madsd
Copy link
Contributor

madsd commented Feb 18, 2020

@panchagnula the command does support both ipv4 and ipv6 today - but for both ipv4 and ipv6 you have to specify the subnet range - that is the /xx. So even if you just want a single IP, you need to specify /32. What is being asked here (as I read it), is that if you just want a single IP, we would automatically add the /32 or /128.

@onstwedder
Copy link
Author

@madsd True.
In the documentation page ( https://docs.microsoft.com/en-us/cli/azure/webapp/config/access-restriction?view=azure-cli-latest#az-webapp-config-access-restriction-add ) it states:

--ip-address
IP address or CIDR range.

I would expect an ip address to be without /32 and a cidr of 1 ip to be with a /32.
e.g. My first try to add an ip to the access restriction was to use it without a /32.

Anyway. when not specifying a subnet range on an ip, automatically adding a /32 would work fine. (or /128 for ip6)

@madsd
Copy link
Contributor

madsd commented Feb 23, 2020

Created PR with a fix for it and a scenario test to capture it for future changes. @panchagnula could you review it. @onstwedder, thank you for reporting it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Service Attention This issue is responsible by Azure service team. Web Apps az webapp
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants