'Creates AzContract for createServerGroup.
To verify the operation, we just check that the spinnaker security group
for the given application was created.
This will create a Network Security Group in a Resource Group on your azure Subscription'

def create_a_security_group(self):

    rules = [{'access': 'Allow', 'destinationAddressPrefix': '*', 'destinationPortRange': '80-80', 'direction': 'InBound', 'endPort': 80, 'name': self.TEST_SECURITY_GROUP_RULE_1, 'priority': 100, 'protocol': 'tcp', 'sourceAddressPrefix': '*', 'sourcePortRange': '*', 'startPort': 80}]
    job = [{'provider': 'azure', 'application': self.bindings['TEST_APP'], 'appName': self.bindings['TEST_APP'], 'region': self.bindings['TEST_AZURE_RG_LOCATION'], 'stack': self.bindings['TEST_STACK'], 'description': 'Test    -    create    security    group    for    {app}'.format(app=self.bindings['TEST_APP']), 'detail': '', 'credentials': self.bindings['SPINNAKER_AZURE_ACCOUNT'], 'securityRules': rules, 'name': self.TEST_SECURITY_GROUP, 'securityGroupName': self.TEST_SECURITY_GROUP, 'cloudProvider': 'azure', 'type': 'upsertSecurityGroup', 'user': '[anonymous]'}]
    builder = az.AzContractBuilder(self.az_observer)
    builder.new_clause_builder('Security    Group    Created', retryable_for_secs=30).collect_resources(az_resource='network', command='nsg', args=['show', '--name', self.TEST_SECURITY_GROUP, '--resource-group', self.TEST_SECURITY_GROUP_RG]).EXPECT(ov_factory.error_list_contains(jp.ExceptionMatchesPredicate(klass=st.CliAgentRunError, regex='(?:.*    operation:    Cannot    find    .*)|(?:.*\\(.*NotFound\\).*)'))).OR(ov_factory.value_list_contains(jp.DICT_MATCHES({'name': jp.STR_SUBSTR(self.TEST_SECURITY_GROUP), 'securityRules': jp.LIST_MATCHES([jp.DICT_MATCHES({'protocol': jp.STR_EQ('tcp'), 'name': jp.STR_EQ(self.TEST_SECURITY_GROUP_RULE_1)})], strict=True)})))
    payload = self.agent.make_json_payload_from_kwargs(job=job, description='    Test    -    create    security    group    for    {app}'.format(app=self.bindings['TEST_APP']), application=self.bindings['TEST_APP'])
    return st.OperationContract(self.new_post_operation(title='create_security_group', data=payload, path='applications/{app}/tasks'.format(app=self.bindings['TEST_APP'])), contract=builder.build())
