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
Getting cannot parse the request exceptions when trying to create an NSG #788
Comments
Hi @piter50 I tried exactly your parameters, and I'm not able to reproduce it (on Also, CloudError has a FYI @annatisch |
The message attribute is also azure-mgmt-network (0.30.0rc6) |
I copied/pasted your code and called it this way: security_list=[]
source_subnet = '10.1.2.0/24'
destination_subnet = '10.2.0.0/16'
security_rule_creation(security_list, "Allow-subnet-Out", source_subnet,
destination_subnet, "*", "Outbound", "*", "Allow", 101)
network_security_group_create(
self.network_client,
'westus',
self.group_name, "NSGName", security_list) and I am still unable to reproduce it :( |
The error you got is a denied from the RestAPI, so this is unlikely a Python problem, but it does not mean I can't help you to figure out the problem :) If you follow all instructions (naming convention, conflict, etc.). You might have just a bad error message from the RestAPI for a simple problem. |
The NSG name is unique per the subscription (which is a new Subscription), no funny characters. I even tested changing the name of the NSG and security rules to short all caps names and still the error persists. The API access as mentioned is Network Contributor. location is northeurope. |
I figured it out. In my create security rule function, I was doing id=name, but should have been doing name=name. Once I amended that it created right away. |
I have been trying to create an NSG with the API, but for some reason, I am getting the CloudError: cannot parse the request.
I have a function to read and display existing NSGs in the subscription which works fine so I know it's not an authentication issue.
My API user has the Network Contributor role, but I also tested with it as owner so I don't think it's a permissions issue.
First i set up some security rules and append them to a list:
The subnets used whilst i test are just CIDR notated strings like "10.10.10.0/24".
A security rule example looks like
Then I try to create the NSG:
I'm currently doing a try except to get a better idea of the headers which seem to look ok.
The Request body using example IPs looks like this:
The Request URL:
Am I doing it wrong?
The text was updated successfully, but these errors were encountered: