Skip to content

Commit d131a0c

Browse files
committed
Learn Editor: Update best-practices.md
1 parent cb15a0a commit d131a0c

File tree

1 file changed

+42
-0
lines changed
  • articles/ai-services/language-service/conversational-language-understanding/concepts

1 file changed

+42
-0
lines changed

articles/ai-services/language-service/conversational-language-understanding/concepts/best-practices.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,4 +171,46 @@ curl --request POST \
171171
}
172172
}
173173
}'
174+
```
175+
176+
## Best Practices for Copying Projects across language resources
177+
178+
CLU projects can be easily copied from one resource to another using the Copy button in the UI. However in some cases, it might be easier to copy projects via the API. Here is how to do it.
179+
180+
### Step 1
181+
182+
Identify the
183+
184+
1. source-project-name
185+
186+
1. the target-project-name
187+
188+
1. the source-language-resource
189+
190+
1. the target-language-resource you want to copy it to. Call the authorize copy API as below to get the accessTokens for the actual Copy call (which is described in step 2)
191+
```console
192+
curl --request POST \
193+
--url 'https://<target-language-resource>.cognitiveservices.azure.com//language/authoring/analyze-conversations/projects/<source-project-name>/:authorize-copy?api-version=2023-04-15-preview' \
194+
--header 'Content-Type: application/json' \
195+
--header 'Ocp-Apim-Subscription-Key: <Your-Subscription-Key>' \
196+
--data '{"projectKind":"Conversation","allowOverwrite":false}'
197+
```
198+
199+
200+
### Step 2
201+
202+
Call the Copy API to complete the copy operation. Use the response you get in Step1 as the payload in Step2 as is.
203+
```console
204+
curl --request POST \
205+
--url 'https://<source-language-resource>.cognitiveservices.azure.com/language/authoring/analyze-conversations/projects/<source-project-name>/:copy?api-version=2023-04-15-preview' \
206+
--header 'Content-Type: application/json' \
207+
--header 'Ocp-Apim-Subscription-Key: <Your-Subscription-Key>\
208+
--data '{
209+
"projectKind": "Conversation",
210+
"targetProjectName": "<target-project-name>",
211+
"accessToken": "<access-token>",
212+
"expiresAt": "<expiry-date>",
213+
"targetResourceId": "<target-resource-id>",
214+
"targetResourceRegion": "<target-region>"
215+
}'
174216
```

0 commit comments

Comments
 (0)