Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/styles/UmbracoDocs/Acronyms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ exceptions:
- CDN # Content Delivery Network
- CI # Continuous Integration
- CLI # Command Line Interface
- CNAME #
- CMD # Command (Windows shell)
- CMS # Content Management System
- CPU # Central Processing Unit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ hidden: true

The Umbraco Cloud API serves as a publicly accessible endpoint that customers can utilize to execute relevant tasks.

While its initial focus is on automating and managing deployments in Umbraco Cloud projects via the "Umbraco CI/CD Flow," future enhancements will broaden its capabilities to encompass a wider range of activities and options for Umbraco Cloud users.

For the scope of this discussion, we will concentrate solely on the endpoints associated with interactions within the Umbraco CI/CD Flow.

## Getting started
Expand All @@ -34,7 +32,9 @@ The two elements to be used for the authentication are:

By including the API key header in your HTTP requests, you ensure secure access to your Umbraco Cloud project's resources.

For enhanced security, it's crucial to store the provided API key in a secure location. Options include a variable group in Azure DevOps or using the Secrets feature in GitHub Actions. It's important to note that each API key is tightly coupled with a specific Umbraco Cloud project and can only be used for deployments related to that project.
For enhanced security, it's crucial to store the provided API key in a secure location. Options include a variable group in Azure DevOps or using the Secrets feature in GitHub Actions.

Each API key is tightly coupled with a specific Umbraco Cloud project and can only be used for deployments related to that project.

### How to authenticate your requests

Expand Down Expand Up @@ -64,9 +64,9 @@ curl -s -X GET $url -H "Umbraco-Cloud-Api-Key: $apiKey"

### Create the deployment

The Create Deployment endpoint initiates a new deployment and returns a unique `deploymentId`. This call serves as the initial step in the deployment process. It requires a `projectId` specified in the URL path and a commit message included in the request body. Essentially, this establishes the metadata necessary for initiating the deployment process. If a deployment is already underway, initiating a new one will be possible but should be avoided.
The Create Deployment endpoint initiates a new deployment and returns a unique `deploymentId`. This call serves as the initial step in the deployment process. It requires a `projectId` specified in the URL path and a commit message included in the request body. This establishes the metadata necessary for initiating the deployment process. If a deployment is already underway, initiating a new one will be possible but should be avoided.

To create a deployment, you'll need to make an HTTP POST request. The request body should contain a simple JSON object with the commit message:
To create a deployment, you'll need to make an HTTP POST request. The request body should contain a JSON object with the commit message:

```json
{
Expand Down Expand Up @@ -121,25 +121,30 @@ Part of the returned response will be the actual `deploymentId`. The response fr

### Upload zip source file

To deploy content to the Umbraco Cloud repository, you need to perform an HTTP POST request to the Umbraco Cloud API. The deployment content should be packaged as a ZIP file, which must mirror the expected structure of the Umbraco Cloud repository. This ZIP file should include all relevant files such as project and solution files, and compiled frontend code. If your setup includes a frontend project with custom elements, the build artifacts from that project should also be included in the ZIP file, and placed in the appropriate directory within the repository structure.
To deploy content to the Umbraco Cloud repository, you need to perform an HTTP POST request to the Umbraco Cloud API. The deployment content should be packaged as a ZIP file, which must mirror the expected structure of the Umbraco Cloud repository. This ZIP file should include all relevant files such as project and solution files, and compiled frontend code.

If your setup includes a frontend project with custom elements, the build artifacts from that project should be:

* Included in the ZIP file, and
* Placed in the appropriate directory within the repository structure.

The HTTP POST request should be made using the `multipart/form-data` content type. The request URL should incorporate both the `projectId` and `deploymentId` obtained from the previous step in the API path.

The ZIP file must be structured the same way as described in the `Readme.md` included in all cloud projects starting from Umbraco 9. This also means if you need to change the name and/or structure of the project, you should follow the guide in the same Readme.

By adhering to these guidelines, you ensure that the uploaded content is an exact match with what is expected in the Umbraco Cloud repository, facilitating a seamless deployment process.
By adhering to these guidelines, you ensure that the uploaded content is an exact match with what is expected in the Umbraco Cloud repository. You also ensure a seamless deployment process.

The purpose of packaging your content into a ZIP file is to replace the existing content in the Umbraco Cloud repository upon unpackaging. This ensures that the repository is updated with the latest version of your project files.

Make sure your ZIP archive does not contain .git folder. If you're using the `.zipignore` file, you can add the following line `.git/*` to exclude it.

#### A note about .gitignore

Umbraco Cloud environments are using git internally. This means you should be careful about the .gitignore file you add to the package. If you have “git ignored” build js assets locally, you need to handle this so that this is not being ignored in the cloud repository.
Umbraco Cloud environments are using git internally. This means you should be careful about the .gitignore file you add to the package. If you have “git ignored” build JavaScrips assets locally, you need to handle this so that this is not being ignored in the cloud repository.

**Note:** If the `.gitignore` file within the ZIP package does not exclude bin/ and obj/ directories, these will also be committed to the Umbraco Cloud repository.
**Note:** If the `.gitignore` file within the ZIP package does not exclude `bin/` and `obj/` directories, these will also be committed to the Umbraco Cloud repository.

**Best Practice:** If you have frontend assets your local repository's .gitignore file will most likely differ from the one intended for the Umbraco Cloud repository, it's advisable to create a separate .cloud\_gitignore file. Include this file in the ZIP package and rename it to .gitignore before packaging. This ensures that only the necessary files and directories are uploaded and finally committed to the Umbraco Cloud repository.
**Best Practice:** If you have frontend assets, your local repository's `.gitignore` file will most likely differ from the one intended for the Umbraco Cloud repository. It's recommended to create a separate `.cloud\_gitignore` file. Include this file in the ZIP package and rename it to `.gitignore` before packaging. This ensures that only the necessary files and directories are uploaded and finally committed to the Umbraco Cloud repository.

In curl uploading the source file will be:

Expand All @@ -153,7 +158,7 @@ curl -s -X POST $url \
--form "file=@$file"
```

The response of this call will be the same deployment object (in JSON) as when creating a new deployment, but the deploymentState should now be 'Pending':
The response of this call will be the same deployment object (in JSON) as when creating a new deployment. The `deploymentState` should now be 'Pending':

```json
{
Expand All @@ -171,7 +176,7 @@ The response of this call will be the same deployment object (in JSON) as when c

### Start Deployment

After the source file has been uploaded the deployment can be started. This will queue the deployment in the Umbraco Cloud services which will start the deployment as soon as possible. Starting the deployment is an HTTP PATCH request to the Umbraco Cloud API. `projectId` and the `deploymentId` from the previous step must be included in the path, and the deployment state set to 'Queued' in the request body.
After the source file has been uploaded the deployment can be started. This will queue the deployment in the Umbraco Cloud services which will start the deployment as soon as possible. Starting the deployment is an `HTTP PATCH` request to the Umbraco Cloud API. `projectId` and the `deploymentId` from the previous step must be included in the path, and the deployment state set to 'Queued' in the request body.

In curl starting a deployment will be:

Expand All @@ -185,7 +190,7 @@ curl -s -X PATCH $url \
-d "{\"deploymentState\": \"Queued\"}"
```

The response of this call will be the same deployment object (in JSON) as when creating a new deployment, but the deploymentState should now be 'Queued':
The response of this call will be the same deployment object (in JSON) as when creating a new deployment. The deploymentState should now be 'Queued':

```json
{
Expand All @@ -203,9 +208,9 @@ The response of this call will be the same deployment object (in JSON) as when c

### Get Deployment status

To monitor the status of a deployment—whether it's completed, successful, or otherwise — you can periodically query the 'Get Deployment Status' API. This API endpoint is an HTTP GET request to the Umbraco Cloud API, and it requires both the `projectId` and the `deploymentId` obtained from previous steps to be included in the path.
To monitor the status of a deployment—whether it's completed, successful, or otherwise — you can periodically query the 'Get Deployment Status' API. This API endpoint is an HTTP GET request to the Umbraco Cloud API. It requires both the `projectId` and the `deploymentId` obtained from previous steps to be included in the path.

Deployments in Umbraco services can take varying amounts of time to complete. Therefore, it's advisable to poll this API at regular intervals to stay updated on the deployment's current state. For example, in a simple project, you might choose to poll the API every 15 seconds for a duration of 15 minutes. These figures are just a starting point; the optimal polling frequency and duration may differ for your specific pipeline. Based on initial experience, a 15-minute window generally suffices, but we welcome your feedback to fine-tune these parameters.
Deployments in Umbraco services can take varying amounts of time to complete. Therefore, it's advisable to poll this API at regular intervals to stay updated on the deployment's current state. For example, you might choose to poll the API every 15 seconds for a duration of 15 minutes. These figures are a starting point; the optimal polling frequency and duration may differ for your specific pipeline. Based on initial experience, a 15-minute window generally suffices, but we welcome your feedback to fine-tune these parameters.

Using a curl command, polling for the deployment status would look like this:

Expand Down Expand Up @@ -339,11 +344,11 @@ fi

```

The API response will vary based on whether or not there are changes to report. If no changes are detected, you'll receive an HTTP 204 No Content status. On the other hand, if there are changes, the API will return an HTTP 200 OK status along with a git-patch file as the content. This git-patch file can then be applied to your local repository to sync it with the changes.
The API response will vary based on whether or not there are changes to report. If no changes are detected, you'll receive an HTTP 204 No Content status. If there are changes, the API will return an HTTP 200 OK status along with a git-patch file as the content. This git-patch file can then be applied to your local repository to sync it with the changes.

### Possible errors

When interacting with the Umbraco Cloud API, you may encounter various HTTP status codes that indicate the success or failure of your API request. Below is a table summarizing the possible status codes, their corresponding errors, and basic root causes to guide your troubleshooting:
When interacting with the Umbraco Cloud API, you may encounter HTTP status codes that indicate the success or failure of your API request. Below is a table summarizing the possible status codes, their corresponding errors, and basic root causes to guide your troubleshooting:

| Status Code | Error | Basic Root Cause |
| ----------- | ------------------- | ----------------------------------------------------------------------------------- |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ When restoring a database backup on Umbraco Cloud, certain elements may cause is
* **Complex Database Objects** - Custom complex database objects in SQL is an element with external dependencies or special server configurations, which may result in conflicts when restoring the database in our hosting platform.

{% hint style="info" %}
Restoring a database replaces the existing database with a fresh one containing the restored content. Once a Restore has run, you cannot create database backups with a **Date and Time for snapshot (UTC)** earlier than the time of the Restore-operation. However, any existing backups are still available.
Restoring a database replaces the existing database with a fresh one containing the restored content. Once a Restore has run, you cannot create database backups with a **Date and Time for snapshot (UTC)** going back before the Restore-operation. However, any existing backups are still available.
{% endhint %}

## Backup on Umbraco Cloud
Expand Down Expand Up @@ -125,7 +125,7 @@ If a `bacpac` restore fails in SQL server, ensure the 'Contained Database Authen

If it is not set the import will fail.

To Enable Contained Database Authentication, run the following SQL against your SQL server on the Master database.
To Enable Contained Database Authentication, run the following SQL against your SQL server on the main database.

```sql
sp_configure 'contained database authentication', 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@ Since Umbraco 10, **SQL CE** is no longer supported, instead, Umbraco now comes

When cloning down your Umbraco project and restoring its content, it will create a `Umbraco.sqlite.db` file in `~/umbraco/Data/Umbraco.sqlite.db`.

To view your local SQLite database, you will need to use a program like [DB Browser for SQLite](https://sqlitebrowser.org/) or a Visual Studio extension like [SQLite and SQL Server Compact Toolbox](https://marketplace.visualstudio.com/items?itemName=ErikEJ.SQLServerCompactSQLiteToolbox).
To view your local SQLite database, you need to use software that supports reading that type of database:

* A program like [DB Browser for SQLite](https://sqlitebrowser.org/)
* A Visual Studio extension like [SQLite and SQL Server Compact Toolbox](https://marketplace.visualstudio.com/items?itemName=ErikEJ.SQLServerCompactSQLiteToolbox)

You can also configure your project to prefer SQL Server LocalDb when it's available on your local machine by enabling the Deploy [`PreferLocalDbConnectionString`](https://docs.umbraco.com/umbraco-deploy/deploy-settings#preferlocaldbconnectionstring) setting.

To configure your database, you can add the connection string in the 'appsettings.json' file. For more information, see the [Configure your database](https://docs.umbraco.com/umbraco-cms/fundamentals/setup/install/unattended-install#configure-your-database) section in the [Unattended Installs](https://docs.umbraco.com/umbraco-cms/fundamentals/setup/install/unattended-install) article.

## Using Custom Tables with Umbraco Cloud

Umbraco Cloud will ensure that your Umbraco-related data is always up to date, but it won't know anything about data in custom tables unless told. This is like any other host when it comes to non-Umbraco data.
Umbraco Cloud ensures that your Umbraco-related data is always up to date, but it won't know anything about data in custom tables. This is like any other host when it comes to non-Umbraco data.

However, you have full access to the SQL Azure databases running on Umbraco Cloud. You can create custom tables like you'd expect on any other hosting provider. The easiest way to do this is to [connect using SQL Management Studio](./#connecting-to-your-cloud-database-locally).

Expand Down
Loading
Loading