|
2 | 2 | set -e -x |
3 | 3 |
|
4 | 4 | RESOURCE_GROUP="<RESOURCE GROUPP MAME>" |
5 | | -APP_NAME="<FUNCTION APP NAME>" # the name needs to be unique across all apps in Azure. |
| 5 | +APP_NAME="<FUNCTION APP NAME>" |
6 | 6 | STORAGE_ACCOUNT_NAME="<STORAGE ACCOUNT NAME>" |
7 | 7 | COSMOSDB_ACCOUNT_NAME="<COSMOSDB ACCOUNT NAME>" |
8 | 8 | COGNITIVE_ACCOUNT_NAME="<COGNITIVE ACCOUNT NAME>" |
9 | 9 | COGNITIVE_RESOURCE_GROUP="<COGNITIVE RESOURCE GROUP>" |
10 | 10 |
|
11 | | -STORAGE_ACCOUNT_KEY=$(az storage account keys list --account-name $STORAGE_ACCOUNT_NAME --resource-group $RESOURCE_GROUP --output tsv |head -1 | awk '{print $3}') |
12 | | -COSMOSDB_ACCOUNT_KEY=$(az cosmosdb list-keys --name $COSMOSDB_ACCOUNT_NAME --resource-group $RESOURCE_GROUP --output tsv |awk '{print $1}') |
13 | | -MY_STORAGE_CONNECTION="DefaultEndpointsProtocol=https;AccountName=$STORAGE_ACCOUNT_NAME;AccountKey=$STORAGE_ACCOUNT_KEY;EndpointSuffix=core.windows.net" |
14 | | -MY_COSMOS_DB_CONNECTION="AccountEndpoint=https://$COSMOSDB_ACCOUNT_NAME.documents.azure.com:443/;AccountKey=$COSMOSDB_ACCOUNT_KEY;" |
15 | | -MY_COMPUTER_VISION_ENDPOINT=$(az cognitiveservices account show -n $COGNITIVE_ACCOUNT_NAME -g $COGNITIVE_RESOURCE_GROUP --output tsv |awk '{print $1}') |
16 | | -MY_COMPUTER_VISION_APIKEY=$(az cognitiveservices account keys list -n $COGNITIVE_ACCOUNT_NAME -g $COGNITIVE_RESOURCE_GROUP --output tsv |awk '{print $1}') |
| 11 | + |
| 12 | +STORAGE_CONNECTION_STRING=$(az storage account show-connection-string \ |
| 13 | +--resource-group $RESOURCE_GROUP --name $STORAGE_ACCOUNT_NAME \ |
| 14 | +--query connectionString --output tsv) |
| 15 | + |
| 16 | +COSMOSDB_CONNECTION_STRING=$(az cosmosdb list-connection-strings \ |
| 17 | +--resource-group $RESOURCE_GROUP --name $COSMOSDB_ACCOUNT_NAME \ |
| 18 | +--query connectionStrings --output tsv | head -1 | awk '{print $1}') |
| 19 | + |
| 20 | +COMPUTER_VSION_API_ENDPOINT=$(az cognitiveservices account show \ |
| 21 | +-n $COGNITIVE_ACCOUNT_NAME -g $COGNITIVE_RESOURCE_GROUP --output tsv |awk '{print $1}') |
| 22 | + |
| 23 | +COMPUTER_VSION_API_SUBSCRIPTION=$(az cognitiveservices account keys list \ |
| 24 | +-n $COGNITIVE_ACCOUNT_NAME -g $COGNITIVE_RESOURCE_GROUP --output tsv |awk '{print $1}') |
17 | 25 |
|
18 | 26 | az webapp config appsettings set \ |
19 | 27 | -n $APP_NAME \ |
|
0 commit comments