Giter Site home page Giter Site logo

[Microsoft.Automation/automationAccounts/jobSchedules]: Poor error message if resource name incorrectly formatted about bicep-types-az HOT 13 OPEN

joanteixi avatar joanteixi commented on July 29, 2024
[Microsoft.Automation/automationAccounts/jobSchedules]: Poor error message if resource name incorrectly formatted

from bicep-types-az.

Comments (13)

miqm avatar miqm commented on July 29, 2024 4

I think I found what's wrong.

It seems like name of the jobSchedules must be a guid - you cannot put any name you want.

Following code worked for me:

resource startstop0600 'Microsoft.Automation/automationAccounts/jobSchedules@2019-06-01' = {
  name: guid('start-0600')
  parent: automation
  properties: {
    schedule: {      
      name: daily_6.name
    }
    runbook: {
      name:  startstopRunbook.name
    }
    parameters: {
      action: 'start'
      rg: rg
      tagname: 'start-stop'
    }
  }
}

This is probably something to improve in REST api specs, that name must be a guid format.

from bicep-types-az.

miqm avatar miqm commented on July 29, 2024 1

If you know where to give feedback on ARM Template Runtime issues, please let me know.

I think this is the best place for ARM issues. I agree that it's not a bicep as a compiler issue, but it's still a bicep ecosystem one. Bicep Team is this same team that works on ARM.

As for this particular error, the 404 was not returned from ARM runtime but from the RP itself - notice that 404 is in the error body, while the error code is BadRequest - which indicates that the payload is malformed.

For type inaccuracies Bicep Teams track it under Azure/bicep#784. You can also submit issue in https://github.com/Azure/azure-rest-api-specs or via your Support Plan.

from bicep-types-az.

tang2087 avatar tang2087 commented on July 29, 2024 1

I think I found what's wrong.

It seems like name of the jobSchedules must be a guid - you cannot put any name you want.

Following code worked for me:

resource startstop0600 'Microsoft.Automation/automationAccounts/jobSchedules@2019-06-01' = {
  name: guid('start-0600')
  parent: automation
  properties: {
    schedule: {      
      name: daily_6.name
    }
    runbook: {
      name:  startstopRunbook.name
    }
    parameters: {
      action: 'start'
      rg: rg
      tagname: 'start-stop'
    }
  }
}

This is probably something to improve in REST api specs, that name must be a guid format.

I got the same error and I think Microsoft should actually add more details about documentation for this.

from bicep-types-az.

anthony-c-martin avatar anthony-c-martin commented on July 29, 2024 1

Moved to Azure types repo, renamed, and re-opened. We will follow up with the provider to improve the error message.

from bicep-types-az.

majastrz avatar majastrz commented on July 29, 2024

Please fully fill out the issue template. Without additional information, we will have to close the issue.

from bicep-types-az.

joanteixi avatar joanteixi commented on July 29, 2024

Bicep version
Bicep CLI version 0.3.255

Describe the bug

I'm trying to create an automation account + runbook + schedules + link runbook and schedules. Every thing goes well but when I add automationAccounts/jobSchedules resource, I get a 404 error:

image

Here is the bicep file, that works perfect except when I add the jobSchedules resource:

https://raw.githubusercontent.com/joanteixi/az-bicep/master/start-stop-vm/automation.bicep

Thanks!

from bicep-types-az.

miqm avatar miqm commented on July 29, 2024

Use either parent keyword, ${account.name}/ in the sub-resources name or explicitly put dependsOn.

Without them, ARM tries to deploy all resources at once - there's no logical link between account and jobs.

from bicep-types-az.

joanteixi avatar joanteixi commented on July 29, 2024

Thanks for your help, I didn't know about parent/dependsOn keyword... but it didn't work. Now I understand better the order that the ARM templates are being deployed but it's still returning a 404 error:

resource startstop0600 'Microsoft.Automation/automationAccounts/jobSchedules@2020-01-13-preview' = {
  name: 'start-0600'
  parent: automation
  dependsOn: [
    daily_6
    startstopRunbook
  ]
  properties: {
    schedule: {
      name: '${daily_6.name}'
    }
    runbook: {
      name: '${startstopRunbook.name}'
    }

    parameters: {
      'action': 'start'
      'rg': rg
      'tagname': 'start-stop'
    }
  }
}

new bicep file at https://raw.githubusercontent.com/joanteixi/az-bicep/master/start-stop-vm/automation.bicep

Thanks for your help!

from bicep-types-az.

miqm avatar miqm commented on July 29, 2024

The dependsOn in the startstop0600 is unnecessary since you're using references to those objects, but it should not break anything.

Could you use bicep build command (or copy it from resource group deployments section in Azure Portal) and paste the generated json?

from bicep-types-az.

takekazuomi avatar takekazuomi commented on July 29, 2024

It is a problem of ARM Template Runtime that the validation information of the string part is not provided in the schema. So at this point, it's not a bicep issue. Also, RP's poor error messages take my time. These are the reasons for the reduced productivity of the biceps.

I also lost time the other day due to poor RP error messages. Azure/bicep#2206

If you know where to give feedback on ARM Template Runtime issues, please let me know.

from bicep-types-az.

joanteixi avatar joanteixi commented on July 29, 2024

Hi,

Thanks for bring me the solution... it's true that a jobSchedule don't have any string name and I remove the dependsOn array from the jobScheduler.

I'm gonna a close this issue, as it has been fixed.

Thanks you very much!

from bicep-types-az.

kenchon avatar kenchon commented on July 29, 2024

I've experienced the same error with uninformative message:

ERROR: {"status":"Failed","error":{"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"Conflict","message":"{\r\n  \"status\": \"Failed\",\r\n  \"error\": {\r\n    \"code\": \"ResourceDeploymentFailure\",\r\n    \"message\": \"The 'AzureAsyncOperationWaiting' resource operation completed with terminal provisioning state 'Failed'.\",\r\n    \"details\": [\r\n      {\r\n        \"code\": \"DeploymentFailed\",\r\n        \"message\": \"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.\",\r\n        \"details\": [\r\n          {\r\n            \"code\": \"NotFound\",\r\n            \"message\": \"{\\r\\n  \\\"error\\\": {\\r\\n    \\\"code\\\": \\\"BadRequest\\\",\\r\\n    \\\"message\\\": \\\"\\\"\\r\\n  }\\r\\n}\"\r\n          }\r\n        ]\r\n      }\r\n    ]\r\n  }\r\n}"}]}}

The error was finally solved by using guid() as mentioned above.

I want maintainer to improve error message and documentation.

from bicep-types-az.

 avatar commented on July 29, 2024

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @jaspkaur28. Please see https://aka.ms/biceptypesinfo for troubleshooting help.

Issue Details

Bicep version
Bicep CLI version 0.3.255

Describe the bug

I'm trying to create an automation account + runbook + schedules + link runbook and schedules. Every thing goes well but when I add automationAccounts/jobSchedules resource, I get a 404 error:

image

Here is the bicep file, that works perfect except when I add the jobSchedules resource:

https://raw.githubusercontent.com/joanteixi/az-bicep/master/start-stop-vm/automation.bicep

Thanks!

Author: joanteixi
Assignees: -
Labels:

inaccuracy, RP: Microsoft.Automation, Service Attention, Automation

Milestone: -

from bicep-types-az.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.