Skip to content

Commit

Permalink
Revert "fix: hashicorp#6343 use d.GetOk to get qname_runtime_endpoint"
Browse files Browse the repository at this point in the history
This reverts commit 304c19a.
  • Loading branch information
johejo committed Apr 4, 2020
1 parent 04c9872 commit d5b9c45
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ func resourceArmCognitiveAccountCreate(d *schema.ResourceData, meta interface{})
Location: utils.String(azure.NormalizeLocation(d.Get("location").(string))),
Sku: sku,
Properties: &cognitiveservices.AccountProperties{
APIProperties: &cognitiveservices.AccountAPIProperties{},
APIProperties: &cognitiveservices.AccountAPIProperties{
QnaRuntimeEndpoint: utils.String(d.Get("qna_runtime_endpoint").(string)),
},
},
Tags: tags.Expand(d.Get("tags").(map[string]interface{})),
}
Expand All @@ -167,11 +169,6 @@ func resourceArmCognitiveAccountCreate(d *schema.ResourceData, meta interface{})
return fmt.Errorf("the QnAMaker runtime endpoint `qna_runtime_endpoint` is required when kind is set to `QnAMaker`")
}

qnaRuntimeEndpoint, exists := d.GetOk("qna_runtime_endpoint")
if exists {
props.Properties.APIProperties.QnaRuntimeEndpoint = utils.String(qnaRuntimeEndpoint.(string))
}

if _, err := client.Create(ctx, resourceGroup, name, props); err != nil {
return fmt.Errorf("Error creating Cognitive Services Account %q (Resource Group %q): %+v", name, resourceGroup, err)
}
Expand Down

0 comments on commit d5b9c45

Please sign in to comment.