Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support log streaming on build resource #25902

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,51 @@
},
"x-ms-long-running-operation": true
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName}/getAuthToken": {
pauld-msft marked this conversation as resolved.
Show resolved Hide resolved
"post": {
"tags": [
"Builds"
],
"operationId": "Builds_GetAuthToken",
"description": "Gets the token used to connect to the endpoint where source code can be uploaded for a build.",
"parameters": [
{
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "./Builders.json#/parameters/BuilderNameParameter"
},
{
"$ref": "#/parameters/BuildNameParameter"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/BuildToken"
}
},
"default": {
"description": "Common error response.",
"schema": {
"$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse"
}
}
},
"x-ms-examples": {
"Get Build Auth Token": {
"$ref": "./examples/Builds_GetAuthToken.json"
}
}
}
}
},
"definitions": {
Expand Down Expand Up @@ -311,6 +356,16 @@
"type": "string",
"description": "Endpoint to which the source code should be uploaded.",
"readOnly": true
},
"logStreamEndpoint": {
"type": "string",
"description": "Endpoint from which the build logs can be streamed.",
"readOnly": true
},
"tokenEndpoint": {
"type": "string",
"description": "Endpoint to use to retrieve an authentication token for log streaming and uploading source code.",
"readOnly": true
}
},
"description": "The build properties."
Expand Down Expand Up @@ -388,6 +443,36 @@
"server"
]
},
"BuildToken": {
"description": "Build Auth Token.",
"type": "object",
"allOf": [
{
"$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ProxyResource"
pauld-msft marked this conversation as resolved.
Show resolved Hide resolved
}
],
"properties": {
"properties": {
"description": "Build auth token resource specific properties",
"type": "object",
"properties": {
"token": {
"type": "string",
"x-ms-secret": true,
"description": "Authentication token.",
"readOnly": true
},
"expires": {
"format": "date-time",
"description": "Token expiration date.",
"type": "string",
"readOnly": true
}
},
"x-ms-client-flatten": true
}
}
},
"EnvironmentVariable": {
"type": "object",
"properties": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@
}
]
},
"uploadEndpoint": "foo.azurecontainerapps.dev/upload"
"uploadEndpoint": "foo.azurecontainerapps.dev/upload",
"logStreamEndpoint": "foo.azurecontainerapps.dev/logstream",
"tokenEndpoint": ".../Microsoft.App/builders/testBuilder/builds/testBuild/getAuthToken"
},
"systemData": {
"createdBy": "sample@microsoft.com",
Expand Down Expand Up @@ -194,7 +196,9 @@
}
]
},
"uploadEndpoint": "foo.azurecontainerapps.dev/upload"
"uploadEndpoint": "foo.azurecontainerapps.dev/upload",
"logStreamEndpoint": "foo.azurecontainerapps.dev/logstream",
"tokenEndpoint": ".../Microsoft.App/builders/testBuilder/builds/testBuild/getAuthToken"
},
"systemData": {
"createdBy": "sample@microsoft.com",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"properties": {
"provisioningState": "Succeeded",
"buildStatus": "InProgress",
"uploadEndpoint": "https://testStorage.blob.core.windows.net/buildGUID/blobName"
"uploadEndpoint": "foo.azurecontainerapps.dev/upload",
"logStreamEndpoint": "foo.azurecontainerapps.dev/logstream",
"tokenEndpoint": ".../Microsoft.App/builders/testBuilder/builds/testBuild/getAuthToken"
},
"systemData": {
"createdBy": "sample@microsoft.com",
Expand All @@ -41,7 +43,9 @@
"properties": {
"provisioningState": "Creating",
"buildStatus": "InProgress",
"uploadEndpoint": "https://testStorage.blob.core.windows.net/buildGUID/blobName"
"uploadEndpoint": "foo.azurecontainerapps.dev/upload",
"logStreamEndpoint": "foo.azurecontainerapps.dev/logstream",
"tokenEndpoint": ".../Microsoft.App/builders/testBuilder/builds/testBuild/getAuthToken"
},
"systemData": {
"createdBy": "sample@microsoft.com",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@
}
]
},
"uploadEndpoint": "foo.azurecontainerapps.dev/upload"
"uploadEndpoint": "foo.azurecontainerapps.dev/upload",
"logStreamEndpoint": "foo.azurecontainerapps.dev/logstream",
"tokenEndpoint": ".../Microsoft.App/builders/testBuilder/builds/testBuild/getAuthToken"
},
"systemData": {
"createdBy": "sample@microsoft.com",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"operationId": "Builds_GetAuthToken",
"title": "Builds_GetAuthToken_0",
"parameters": {
"api-version": "2023-08-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"resourceGroupName": "rg",
"builderName": "testBuilder",
"buildName": "testBuild"
},
"responses": {
"200": {
"headers": {},
"body": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.App/builders/testBuilder/builds/testBuild",
"name": "testBuild",
"type": "Microsoft.App/builders/builds",
"properties": {
"token": "foobartoken",
"expires": "2022-07-14T19:22:50.3080223Z"
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@
}
]
},
"uploadEndpoint": "foo.azurecontainerapps.dev/upload"
"uploadEndpoint": "foo.azurecontainerapps.dev/upload",
"logStreamEndpoint": "foo.azurecontainerapps.dev/logstream",
"tokenEndpoint": ".../Microsoft.App/builders/testBuilder/builds/testBuild/getAuthToken"
},
"systemData": {
"createdBy": "sample@microsoft.com",
Expand Down Expand Up @@ -137,7 +139,9 @@
}
]
},
"uploadEndpoint": "foo.azurecontainerapps.dev/upload"
"uploadEndpoint": "foo.azurecontainerapps.dev/upload",
"logStreamEndpoint": "foo.azurecontainerapps.dev/logstream",
"tokenEndpoint": ".../Microsoft.App/builders/testBuilder/builds/testBuild/getAuthToken"
},
"systemData": {
"createdBy": "sample@microsoft.com",
Expand Down