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
1. To create the function app, use the following command. Replace `<app-name>`with the name you want to use. Replace `<acrinstance>`and`<imagename>`with the values from returned `package.location` earlier. Replace Replace `<webjobStorage>`with the name of the storage account from the previous step:
165
+
1. To create the function app, use the following command. Replace `<app-name>`with the name you want to use. Replace `<acrinstance>`and`<imagename>`with the values from returned `package.location` earlier. Replace `<webjobStorage>`with the name of the storage account from the previous step:
@@ -171,12 +171,12 @@ When `show_output=True`, the output of the Docker build process is shown. Once t
171
171
> [!IMPORTANT]
172
172
> At this point, the function app has been created. However, since you haven't provided the connection string for the blob trigger or credentials to the Azure Container Registry that contains the image, the function app is not active. In the next steps, you provide the connection string and the authentication information for the container registry.
173
173
174
-
1. Create the storage account to use for the blob trigger storage and get it's connection string. Replace `<triggerStorage>` with the name you want to use.
174
+
1. Create the storage account to use for the blob trigger storage and get its connection string. Replace `<triggerStorage>`with the name you want to use.
Record this connection string to provide to the function app. We will use it later when we ask for`<triggerConnectionString>`
@@ -202,7 +202,7 @@ When `show_output=True`, the output of the Docker build process is shown. Once t
202
202
```
203
203
Save the value returned, it will be used as the `imagetag`in the next step.
204
204
205
-
1. To provide the function app with the credentials needed to access the container registry, use the following command. Replace `<app-name>`with the name you want to use. Replace `<acrinstance>`and`<imagetag>`with the values from the AZCLI call in the previous step. Replace `<username>`and`<password>`with the ACR login information retrieved earlier:
205
+
1. To provide the function app with the credentials needed to access the container registry, use the following command. Replace `<app-name>`with the name of the function app. Replace `<acrinstance>`and`<imagetag>`with the values from the AZCLI call in the previous step. Replace `<username>`and`<password>`with the ACR login information retrieved earlier:
@@ -244,6 +244,52 @@ At this point, the function app begins loading the image.
244
244
> [!IMPORTANT]
245
245
> It may take several minutes before the image has loaded. You can monitor progress using the Azure Portal.
246
246
247
+
## Test the deployment
248
+
249
+
Once the image has loaded and the app is available, use the following steps to trigger the app:
250
+
251
+
1. Create a text file that contains the data that the score.py file expects. The following example would work with a score.py that expects an array of 10 numbers:
> The format of the data depends on what your score.py and model expects.
259
+
260
+
2. Use the following command to upload this file to the input container in the trigger storage blob created earlier. Replace `<file>`with the name of the file containing the data. Replace `<triggerConnectionString>`with the connection string returned earlier. In this example, `input`is the name of the input container created earlier. If you used a different name, replace this value:
261
+
262
+
```azurecli-interactive
263
+
az storage blob upload --container-name input--file<file>--name <file>--connection-string <triggerConnectionString>
264
+
```
265
+
266
+
The output of this command is similar to the following JSON:
267
+
268
+
```json
269
+
{
270
+
"etag": "\"0x8D7C21528E08844\"",
271
+
"lastModified": "2020-03-06T21:27:23+00:00"
272
+
}
273
+
```
274
+
275
+
3. To view the output produced by the function, use the following command to list the output files generated. Replace `<triggerConnectionString>`with the connection string returned earlier. In this example, `output`is the name of the output container created earlier. If you used a different name, replace this value::
276
+
277
+
```azurecli-interactive
278
+
az storage blob list--container-name output --connection-string <triggerConnectionString>--query '[].name'--output tsv
279
+
```
280
+
281
+
The output of this command is similar to `sample_input_out.json`.
282
+
283
+
4. To download the fileand inspect the contents, use the following command. Replace `<file>`with the file name returned by the previous command. Replace `<triggerConnectionString>`with the connection string returned earlier:
284
+
285
+
```azurecli-interactive
286
+
az storage blob download --container-name output --file<file>--name <file>--connection-string <triggerConnectionString>
287
+
```
288
+
289
+
Once the command completes, open the file. It contains the data returned by the model.
290
+
291
+
For more information on using blob triggers, see the [Create a function triggered by Azure Blob storage](/azure/azure-functions/functions-create-storage-blob-triggered-function) article.
292
+
247
293
## Next steps
248
294
249
295
* Learn to configure your Functions App in the [Functions](/azure/azure-functions/functions-create-function-linux-custom-image) documentation.
0 commit comments