You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: umbraco-cloud/build-and-customize-your-solution/handle-deployments-and-environments/umbraco-cicd/v1-umbraco-cloud-api.md
+22-17Lines changed: 22 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,6 @@ hidden: true
6
6
7
7
The Umbraco Cloud API serves as a publicly accessible endpoint that customers can utilize to execute relevant tasks.
8
8
9
-
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.
10
-
11
9
For the scope of this discussion, we will concentrate solely on the endpoints associated with interactions within the Umbraco CI/CD Flow.
12
10
13
11
## Getting started
@@ -34,7 +32,9 @@ The two elements to be used for the authentication are:
34
32
35
33
By including the API key header in your HTTP requests, you ensure secure access to your Umbraco Cloud project's resources.
36
34
37
-
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.
35
+
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.
36
+
37
+
Each API key is tightly coupled with a specific Umbraco Cloud project and can only be used for deployments related to that project.
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.
67
+
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.
68
68
69
-
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:
69
+
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:
70
70
71
71
```json
72
72
{
@@ -121,25 +121,30 @@ Part of the returned response will be the actual `deploymentId`. The response fr
121
121
122
122
### Upload zip source file
123
123
124
-
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.
124
+
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.
125
+
126
+
If your setup includes a frontend project with custom elements, the build artifacts from that project should be:
127
+
128
+
* Included in the ZIP file, and
129
+
* Placed in the appropriate directory within the repository structure.
125
130
126
131
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.
127
132
128
133
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.
129
134
130
-
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.
135
+
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.
131
136
132
137
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.
133
138
134
139
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.
135
140
136
141
#### A note about .gitignore
137
142
138
-
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.
143
+
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.
139
144
140
-
**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.
145
+
**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.
141
146
142
-
**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.
147
+
**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.
143
148
144
149
In curl uploading the source file will be:
145
150
@@ -153,7 +158,7 @@ curl -s -X POST $url \
153
158
--form "file=@$file"
154
159
```
155
160
156
-
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':
161
+
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':
157
162
158
163
```json
159
164
{
@@ -171,7 +176,7 @@ The response of this call will be the same deployment object (in JSON) as when c
171
176
172
177
### Start Deployment
173
178
174
-
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.
179
+
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.
175
180
176
181
In curl starting a deployment will be:
177
182
@@ -185,7 +190,7 @@ curl -s -X PATCH $url \
185
190
-d "{\"deploymentState\": \"Queued\"}"
186
191
```
187
192
188
-
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':
193
+
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':
189
194
190
195
```json
191
196
{
@@ -203,9 +208,9 @@ The response of this call will be the same deployment object (in JSON) as when c
203
208
204
209
### Get Deployment status
205
210
206
-
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.
211
+
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.
207
212
208
-
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.
213
+
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.
209
214
210
215
Using a curl command, polling for the deployment status would look like this:
211
216
@@ -339,11 +344,11 @@ fi
339
344
340
345
```
341
346
342
-
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.
347
+
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.
343
348
344
349
### Possible errors
345
350
346
-
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:
351
+
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:
Copy file name to clipboardExpand all lines: umbraco-cloud/build-and-customize-your-solution/set-up-your-project/databases/backups.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ When restoring a database backup on Umbraco Cloud, certain elements may cause is
18
18
***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.
19
19
20
20
{% hint style="info" %}
21
-
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.
21
+
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.
22
22
{% endhint %}
23
23
24
24
## Backup on Umbraco Cloud
@@ -125,7 +125,7 @@ If a `bacpac` restore fails in SQL server, ensure the 'Contained Database Authen
125
125
126
126
If it is not set the import will fail.
127
127
128
-
To Enable Contained Database Authentication, run the following SQL against your SQL server on the Master database.
128
+
To Enable Contained Database Authentication, run the following SQL against your SQL server on the main database.
Copy file name to clipboardExpand all lines: umbraco-cloud/build-and-customize-your-solution/set-up-your-project/databases/cloud-database/local-database.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,15 +17,18 @@ Since Umbraco 10, **SQL CE** is no longer supported, instead, Umbraco now comes
17
17
18
18
When cloning down your Umbraco project and restoring its content, it will create a `Umbraco.sqlite.db` file in `~/umbraco/Data/Umbraco.sqlite.db`.
19
19
20
-
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).
20
+
To view your local SQLite database, you need to use software that supports reading that type of database:
21
+
22
+
* A program like [DB Browser for SQLite](https://sqlitebrowser.org/)
23
+
* A Visual Studio extension like [SQLite and SQL Server Compact Toolbox](https://marketplace.visualstudio.com/items?itemName=ErikEJ.SQLServerCompactSQLiteToolbox)
21
24
22
25
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.
23
26
24
27
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.
25
28
26
29
## Using Custom Tables with Umbraco Cloud
27
30
28
-
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.
31
+
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.
29
32
30
33
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).
0 commit comments