/
vars_populate.cmd
28 lines (21 loc) · 1.08 KB
/
vars_populate.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
@echo off
set "JSON_SETTINGS_FILE=%~dp0..\vars_user.json"
call %~dp0vars_from_user_json_config.cmd
set LOCAL_DEBUG_CERTIFICATE_FILE=%~dp0..\debugCert\democert.p12:""
set server_config=%~dp0..\appsettings.json
set TEMPLATE_DIR=%~dp0..\templates
set API_VERSION=2018-09-01-preview
REM Get rid of Python's f*cking
REM The command failed with an unexpected error.
REM Here is the traceback: unknown encoding: cp65001
chcp 65001 >nul 2>&1
set PYTHONIOENCODING=utf-8
set deployment_template=%TEMPLATE_DIR%\provider.json
set P=.variables.customRP.name
set V=customResourceProviderName
for /f "tokens=*" %%a in ('type %deployment_template% ^| jq -r %P%') do set %V%=%%a
set P=.resources[0].properties.resourceTypes[0].name
set V=customResourceType
for /f "tokens=*" %%a in ('type %deployment_template% ^| jq -r %P%') do set %V%=%%a
set "CUSTOM_ENDPOINT=https://%CUSTOM_RP_DOMAIN%/customresource"
set "REQUEST_PATH=subscriptions/%AZURE_SUBSCRIPTION_ID%/resourceGroups/%AZURE_RG_PROVIDER%/providers/Microsoft.CustomProviders/resourceProviders/%customResourceProviderName%/%customResourceType%"