Skip to content

Commit adc0154

Browse files
authored
Merge pull request #100497 from Blackmist/fixing-functionapp
adding missing steps
2 parents dc88c02 + 163548d commit adc0154

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

articles/machine-learning/how-to-deploy-functions.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,27 +153,35 @@ When `show_output=True`, the output of the Docker build process is shown. Once t
153153
> [!IMPORTANT]
154154
> Images created by Azure Machine Learning use Linux, so you must use the `--is-linux` parameter.
155155
156-
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:
156+
1. Create the storage account to use for the web job storage and get it's connection string. Replace `<webjobStorage>` with the name you want to use.
157157
158158
```azurecli-interactive
159-
az storage account create --name
160-
az functionapp create --resource-group myresourcegroup --plan myplanname --name <app-name> --deployment-container-image-name <acrinstance>.azurecr.io/package:<imagename>
159+
az storage account create --name triggerStorage --location westeurope --resource-group myresourcegroup --sku Standard_LRS
160+
```
161+
```azurecli-interactive
162+
az storage account show-connection-string --resource-group myresourcegroup --name <webJobStorage> --query connectionString --output tsv
163+
```
164+
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 Replace `<webjobStorage>` with the name of the storage account from the previous step:
166+
167+
```azurecli-interactive
168+
az functionapp create --resource-group myresourcegroup --plan myplanname --name <app-name> --deployment-container-image-name <acrinstance>.azurecr.io/package:<imagename> --storage-account <webjobStorage>
161169
```
162170
163171
> [!IMPORTANT]
164172
> 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.
165173
166-
1. Create the storage account to use as the trigger and get it's connection string.
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.
167175
168176
```azurecli-interactive
169177
az storage account create --name triggerStorage --location westeurope --resource-group myresourcegroup --sku Standard_LRS
170178
```
171179
```azurecli-interactive
172-
az storage account show-connection-string --resource-group myresourcegroup --name triggerStorage --query connectionString --output tsv
180+
az storage account show-connection-string --resource-group myresourcegroup --name <triggerStorage> --query connectionString --output tsv
173181
```
174182
Record this connection string to provide to the function app. We will use it later when we ask for `<triggerConnectionString>`
175183
176-
1. Create the containers for the input and output in the storage account.
184+
1. Create the containers for the input and output in the storage account. Replace `<triggerConnectionString>` with the connection string returned earlier:
177185
178186
```azurecli-interactive
179187
az storage container create -n input --connection-string <triggerConnectionString>
@@ -182,12 +190,17 @@ When `show_output=True`, the output of the Docker build process is shown. Once t
182190
az storage container create -n output --connection-string <triggerConnectionString>
183191
```
184192
185-
1. You will need to retrieve the tag associated with the created container using the following command:
193+
1. To associate the trigger connection string with the function app, use the following command. Replace `<app-name>` with the name of the function app. Replace `<triggerConnectionString>` with the connection string returned earlier:
194+
195+
```azurecli-interactive
196+
az functionapp config appsettings set --name <app-name> --resource-group myresourcegroup --settings "TriggerConnectionString=<triggerConnectionString>"
197+
```
198+
1. You will need to retrieve the tag associated with the created container using the following command. Replace `<username>` with the username returned earlier from the container registry:
186199
187200
```azurecli-interactive
188201
az acr repository show-tags --repository package --name <username> --output tsv
189202
```
190-
The most recent tag shown will be `imagetag` below.
203+
Save the value returned, it will be used as the `imagetag` in the next step.
191204
192205
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 AZ CLI call in the previous step. Replace `<username>` and `<password>` with the ACR login information retrieved earlier:
193206

0 commit comments

Comments
 (0)