Azure / bicep

Bicep is a declarative language for describing and deploying Azure resources
MIT License
3.23k stars 748 forks source link

Microsoft.Automation/automationAccounts/configurations require location property however Bicep does not include ti #5631

Open nazakathussain opened 2 years ago

nazakathussain commented 2 years ago

Bicep version Bicep CLI version 0.4.1124 (66c84c8ee5)

Describe the bug To deploy Microsoft.Automation/automationAccounts/configurations a number of properties are required including location, even though it is a read only property. Bicep does not support the property however in ARM this is a property and during deployment this is expected.

Example code:

resource automationAccountsConfiguration 'Microsoft.Automation/automationAccounts/configurations@2019-06-01' = { parent: automationAccounts name: 'ExampleDSCConfiguration' }

Error on the portal:

{ "status": "Failed", "error": { "code": "LocationRequired", "message": "The location property is required for this definition." } }

To Reproduce Deploy the below code using Bicep:

resource automationAccounts 'Microsoft.Automation/automationAccounts@2021-06-22' = {
  name: 'ExampleAutomation'
  location: location
  identity: {
    type: 'SystemAssigned'
  }
  properties: {
    encryption: {
      identity: {}
      keySource: 'Microsoft.Automation'
    }
    sku: {
      name: 'Basic'
    }
  }
  tags: {}
}

resource automationAccountsConfiguration 'Microsoft.Automation/automationAccounts/configurations@2019-06-01' = {
  parent: automationAccounts
  name: 'ExampleDSC'
}
alex-frankel commented 2 years ago

In addition to the swagger issue, you should be unblocked once #5509 is merged. cc @miqm as FYI

alex-frankel commented 2 years ago

FYI - as of today's 0.4.1272 release, this error should not be a warning. I will leave the issue open to track the swagger specification issue.

Afsalmc commented 1 year ago

I'm facing the same issue with Microsoft.Automation/automationAccounts/credentials.