Microsoft.Web sourcecontrols 2015-08-01

Bicep resource definition

The sourcecontrols resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Usage Examples

Bicep Samples

A basic example of deploying App Service GitHub Token.

targetScope = 'tenant'

param resourceName string = 'acctest0001'
param location string = 'eastus'
@secure()
@description('The GitHub access token for source control integration')
param githubToken string
@secure()
@description('The GitHub token secret for source control integration')
param githubTokenSecret string

resource sourcecontrol 'Microsoft.Web/sourcecontrols@2021-02-01' = {
  name: 'GitHub'
  properties: {
    token: githubToken
    tokenSecret: githubTokenSecret
  }
}

Resource format

To create a Microsoft.Web/sourcecontrols resource, add the following Bicep to your template.

resource symbolicname 'Microsoft.Web/sourcecontrols@2015-08-01' = {
  kind: 'string'
  location: 'string'
  name: 'string'
  properties: {
    expirationTime: 'string'
    name: 'string'
    refreshToken: 'string'
    token: 'string'
    tokenSecret: 'string'
  }
  tags: {
    {customized property}: 'string'
  }
}

Property Values

Microsoft.Web/sourcecontrols

Name Description Value
kind Kind of resource string
location Resource Location string (required)
name The resource name string (required)
properties SourceControlProperties
tags Resource tags Dictionary of tag names and values. See Tags in templates

ResourceTags

Name Description Value

SourceControlProperties

Name Description Value
expirationTime OAuth Token Expiration string
name Name or Source Control Type string
refreshToken OAuth Refresh Token string
token OAuth Access Token string
tokenSecret OAuth Access Token Secret string

ARM template resource definition

The sourcecontrols resource type can be deployed with operations that target:

Usage Examples

Resource format

To create a Microsoft.Web/sourcecontrols resource, add the following JSON to your template.

{
  "type": "Microsoft.Web/sourcecontrols",
  "apiVersion": "2015-08-01",
  "name": "string",
  "kind": "string",
  "location": "string",
  "properties": {
    "expirationTime": "string",
    "name": "string",
    "refreshToken": "string",
    "token": "string",
    "tokenSecret": "string"
  },
  "tags": {
    "{customized property}": "string"
  }
}

Property Values

Microsoft.Web/sourcecontrols

Name Description Value
apiVersion The api version '2015-08-01'
kind Kind of resource string
location Resource Location string (required)
name The resource name string (required)
properties SourceControlProperties
tags Resource tags Dictionary of tag names and values. See Tags in templates
type The resource type 'Microsoft.Web/sourcecontrols'

ResourceTags

Name Description Value

SourceControlProperties

Name Description Value
expirationTime OAuth Token Expiration string
name Name or Source Control Type string
refreshToken OAuth Refresh Token string
token OAuth Access Token string
tokenSecret OAuth Access Token Secret string

Terraform (AzAPI provider) resource definition

The sourcecontrols resource type can be deployed with operations that target:

  • Tenant For a list of changed properties in each API version, see change log.

Usage Examples

Terraform Samples

A basic example of deploying App Service GitHub Token.

terraform {
  required_providers {
    azapi = {
      source = "Azure/azapi"
    }
  }
}

provider "azapi" {
  skip_provider_registration = false
}

variable "resource_name" {
  type    = string
  default = "acctest0001"
}

variable "location" {
  type    = string
  default = "eastus"
}

variable "github_token" {
  type        = string
  description = "The GitHub access token for source control integration"
  sensitive   = true
}

variable "github_token_secret" {
  type        = string
  description = "The GitHub token secret for source control integration"
  sensitive   = true
}

resource "azapi_update_resource" "sourcecontrol" {
  type      = "Microsoft.Web/sourcecontrols@2021-02-01"
  parent_id = "/"
  name      = "GitHub"
  body = {
    properties = {
      token       = var.github_token
      tokenSecret = var.github_token_secret
    }
  }
  response_export_values = ["*"]
}

Resource format

To create a Microsoft.Web/sourcecontrols resource, add the following Terraform to your template.

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Web/sourcecontrols@2015-08-01"
  name = "string"
  parent_id = "string"
  location = "string"
  tags = {
    {customized property} = "string"
  }
  body = {
    kind = "string"
    properties = {
      expirationTime = "string"
      name = "string"
      refreshToken = "string"
      token = "string"
      tokenSecret = "string"
    }
  }
}

Property Values

Microsoft.Web/sourcecontrols

Name Description Value
kind Kind of resource string
location Resource Location string (required)
name The resource name string (required)
properties SourceControlProperties
tags Resource tags Dictionary of tag names and values.
type The resource type "Microsoft.Web/sourcecontrols@2015-08-01"

ResourceTags

Name Description Value

SourceControlProperties

Name Description Value
expirationTime OAuth Token Expiration string
name Name or Source Control Type string
refreshToken OAuth Refresh Token string
token OAuth Access Token string
tokenSecret OAuth Access Token Secret string