Azure / azure-rest-api-specs

The source for REST API specifications for Microsoft Azure.
MIT License
2.54k stars 5k forks source link

Azure Spring Cloud buildservices REST API missing #18286

Open ezYakaEagle442 opened 2 years ago

ezYakaEagle442 commented 2 years ago

Hi I have look the in Bicep doc for Azure Spring Cloud, there are doc for Builders but not for the parent buildService. It is because such REST API to create buildservices is missing.

As a consequence it is not possible deploy buildServices with Bicep :

resource buildService 'Microsoft.AppPlatform/Spring/buildServices@2022-03-01-preview' = {
  name: 'string'
  parent: azurespringcloud
  properties: {
    kPackVersion: '0.5.1'
    resourceRequests: {
      cpu: '200m'
      memory: '4Gi'
    }
  }
}

resource buildagentpool 'Microsoft.AppPlatform/Spring/buildServices/agentPools@2022-03-01-preview' = {
  name: 'string'
  parent: buildService
  properties: {
    poolSize: {
      name: 'S1'
    }
  }
}

// https://docs.microsoft.com/en-us/azure/spring-cloud/how-to-enterprise-build-service?tabs=azure-portal#default-builder-and-tanzu-buildpacks
resource builder 'Microsoft.AppPlatform/Spring/buildServices/builders@2022-03-01-preview' = {
  name: 'string'
  parent: buildService
  properties: {
    buildpackGroups: [
      {
        buildpacks: [
          {
            id: 'tanzu-buildpacks/java-azure'
          }
        ]
        name: 'java'
      }
    ]
    stack: {
      id: 'tanzu-base-bionic-stack' // https://docs.pivotal.io/tanzu-buildpacks/stacks.html
      version: '1.1.49'
    }
  }
}

resource builds 'Microsoft.AppPlatform/Spring/buildServices/builds@2022-03-01-preview' = {
  name: 'string'
  parent: buildService
  properties: {
    agentPool: 'string'
    builder: 'string'
    env: {}
    relativePath: 'string'
  }
}
zhoufenqin commented 2 years ago

@ezYakaEagle442 yes, currently we only support default build service resource, it will be created when creating azure spring cloud service.

ezYakaEagle442 commented 2 years ago

@zhoufenqin thank you for your quick reply but I do not understand, how then to create the buildagentpool, builder, build then with Bicep ?

Could you please paste here a Bicep snippet to implement that ?

ezYakaEagle442 commented 2 years ago

should this be used ?

resource buildService 'Microsoft.AppPlatform/Spring/buildServices@2022-03-01-preview' existing = {
  name: 'default/default'
}
zhoufenqin commented 2 years ago

should this be used ?

resource buildService 'Microsoft.AppPlatform/Spring/buildServices@2022-03-01-preview' existing = {
 scope: resourceGroup('my RG')
 name: 'default/default'
}

Hi @ezYakaEagle442 I'm not familiar with Bicep, but I think it looks like

resource buildagentpool 'Microsoft.AppPlatform/Spring/buildServices/agentPools@2022-03-01-preview' = {
 name: '{your-service-name}/default/default'  //{your-service-name}/{build-service-name}/{agenpool-name}
 properties: {
   poolSize: {
     name: 'S1'
   }
 }
 location: '{your-location}',
 dependsOn: [
      resourceId('Microsoft.AppPlatform/Spring', {your-service-name})
 ]
}

you can try it.