Comments (13)
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.
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.
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.
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.
Please fully fill out the issue template. Without additional information, we will have to close the issue.
from bicep-types-az.
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:
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.
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.
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.
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.
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.
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.
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.
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:
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: |
|
Milestone: | - |
from bicep-types-az.
Related Issues (20)
- add tags to new subscription bicep not allowed
- Microsoft.DataProtection/backupVaults not able to set SystemAssigned Identity HOT 1
- Error while deploying Azure Container App with bicep: ContainerAppInvalidResourceTotal HOT 1
- Microsoft.Web/connections@2018-07-01-preview and Microsoft.Web/connections/accessPolicies@2018-07-01-preview
- Azure Container Apps - KEDA scale (managed identity) HOT 5
- MySQL Flexible deployment fails when properties.maintenanceWindow is set HOT 2
- Microsoft.Web/sites@2021-03-01 ipSecurityRestrictionsDefaultAction
- deployment ignores condition and is validating module
- [Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers]: compositeIndexes type issue
- [Microsoft.PowerPlatform/enterprisePolicies]: Virtual Networks Object structure is incorrect
- Microsoft.ContainerRegistry/registries@2023-07-01: The property "{...}" is not allowed on objects of type "RegistryProperties"
- [Microsoft.Fabric]: The specified "object" declaration is missing the following required properties: "state"
- Second HCI deployment brokes the vm network interface HOT 1
- remoteGateways not included in Microsoft.Network/virtualNetworks/virtualNetworkPeerings@2024-01-01 resource HOT 1
- Error with creating an enterprise policy for power platform subnet injection HOT 2
- Microsoft.Web/sites/extensions: onedeploy properties are valid
- virtualMachineScaleSets health probe reference id
- Microsoft.PowerPlatform/enterprisePolicies: Problem with Microsoft provided bicep template and work around (that has 'type' issue) HOT 1
- 'Microsoft.Fabric/capacities@2023-11-01': Warning for a missing property `State` while it is actually Read-Only
- [Microsoft.Sql/servers/databases]: Doesn't recognize maxCapacity for serverless
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bicep-types-az.