Deployment failed: Bad Request: HTTP request payload failed validation against API specification with one or more errors.

Maggie Gibson 0 Reputation points
2023-12-04T18:27:48.44+00:00

Trying to deploy Bing Custom Search and get error. I don't know how to resolve this. Any assistance would be appreciated. Below are details of error:

{"code":"HttpRequestPayloadAPISpecValidationFailed","target":"Microsoft.Bing/accounts/Website Search","message":"HTTP request payload failed validation against API specification with one or more errors. Please see details for more information.","details":[{"code":"Pattern","message":"String does not match pattern ^[a-zA-Z0-9][a-zA-Z0-9_.-]*$: Website Search. Paths in payload: '.path.accountName'"}]}

ERROR DETAILS

  • String does not match pattern ^[a-zA-Z0-9][a-zA-Z0-9_.-]*$: Website Search. Paths in payload: '.path.accountName' (Code: Pattern)

Screen Shot 2023-12-04 at 1.17.23 PM

Bing Custom Search
Bing Custom Search
An easy-to-use, ad-free, commercial-grade search tool that lets you deliver the results you want.
89 questions
{count} votes

2 answers

Sort by: Most helpful
  1. YutongTie-MSFT 52,596 Reputation points
    2023-12-05T02:44:29.88+00:00

    @Maggie Gibson

    Maggie,

    The error message you're seeing indicates that there's an issue with the format of the account name you're using for your Bing Custom Search deployment. The error details suggest that the account name does not match the required pattern as specified by the API.

    The pattern ^[a-zA-Z0-9][a-zA-Z0-9_.-]*$ means that the account name must:

    1. Start with an alphanumeric character (a-z, A-Z, 0-9).
    2. Follow with any number of alphanumeric characters or special characters like underscores (_), periods (.), or hyphens (-).

    Your current account name "Website Search" contains a space, which is not allowed based on the regex pattern provided in the error message. To fix the issue, you'll need to remove the space and ensure that the account name only contains allowed characters.

    Here's how you can resolve this:

    1. Go to the configuration where you're setting the account name for your Bing Custom Search deployment.
    2. Change the account name from "Website Search" to a valid name without spaces, such as "WebsiteSearch" or "Website_Search".
    3. Save the changes and attempt the deployment again.

    Keep in mind that the account name should start with an alphanumeric character and should not begin with an underscore, period, or hyphen.

    Once you've updated the account name to match the pattern, the deployment should proceed without this particular validation error. If you encounter further issues, the error messages provided should guide you towards the next steps for troubleshooting.

    Please let us know if you have any further questions.

    Regards,

    Yutong

    -Please kindly accept the answer if you feel helpful to support the community, thanks a lot.

    2 people found this answer helpful.

  2. William Leveson-Gower 20 Reputation points
    2024-09-30T20:02:29.98+00:00

    Hi Yutong,

    I am having the same issue, even after following your instructions. I have tried several times. Please help

    User's image


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.