Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Bicep resource definition
The sourcecontrols resource type can be deployed with operations that target:
- Tenant - See tenant deployment commands
For a list of changed properties in each API version, see change log.
Resource format
To create a Microsoft.Web/sourcecontrols resource, add the following Bicep to your template.
resource symbolicname 'Microsoft.Web/sourcecontrols@2025-03-01' = {
kind: 'string'
name: 'string'
properties: {
expirationTime: 'string'
refreshToken: 'string'
token: 'string'
tokenSecret: 'string'
}
}
Property Values
Microsoft.Web/sourcecontrols
| Name | Description | Value |
|---|---|---|
| kind | Kind of resource. | string |
| name | The resource name | string (required) |
| properties | SourceControl resource specific properties | SourceControlProperties |
SourceControlProperties
| Name | Description | Value |
|---|---|---|
| expirationTime | OAuth token expiration. | 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:
- Tenant - See tenant deployment commands
For a list of changed properties in each API version, see change log.
Resource format
To create a Microsoft.Web/sourcecontrols resource, add the following JSON to your template.
{
"type": "Microsoft.Web/sourcecontrols",
"apiVersion": "2025-03-01",
"name": "string",
"kind": "string",
"properties": {
"expirationTime": "string",
"refreshToken": "string",
"token": "string",
"tokenSecret": "string"
}
}
Property Values
Microsoft.Web/sourcecontrols
| Name | Description | Value |
|---|---|---|
| apiVersion | The api version | '2025-03-01' |
| kind | Kind of resource. | string |
| name | The resource name | string (required) |
| properties | SourceControl resource specific properties | SourceControlProperties |
| type | The resource type | 'Microsoft.Web/sourcecontrols' |
SourceControlProperties
| Name | Description | Value |
|---|---|---|
| expirationTime | OAuth token expiration. | string |
| refreshToken | OAuth refresh token. | string |
| token | OAuth access token. | string |
| tokenSecret | OAuth access token secret. | string |
Usage Examples
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.
Resource format
To create a Microsoft.Web/sourcecontrols resource, add the following Terraform to your template.
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Web/sourcecontrols@2025-03-01"
name = "string"
parent_id = "string"
body = {
kind = "string"
properties = {
expirationTime = "string"
refreshToken = "string"
token = "string"
tokenSecret = "string"
}
}
}
Property Values
Microsoft.Web/sourcecontrols
| Name | Description | Value |
|---|---|---|
| kind | Kind of resource. | string |
| name | The resource name | string (required) |
| properties | SourceControl resource specific properties | SourceControlProperties |
| type | The resource type | "Microsoft.Web/sourcecontrols@2025-03-01" |
SourceControlProperties
| Name | Description | Value |
|---|---|---|
| expirationTime | OAuth token expiration. | string |
| refreshToken | OAuth refresh token. | string |
| token | OAuth access token. | string |
| tokenSecret | OAuth access token secret. | string |
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 = ["*"]
}