https://github.com/fiftin/str_to_azure_template_str
Simple tool for converting strings to valid Azure Resource Manager template strings
https://github.com/fiftin/str_to_azure_template_str
azure azure-templates converter golang
Last synced: 27 days ago
JSON representation
Simple tool for converting strings to valid Azure Resource Manager template strings
- Host: GitHub
- URL: https://github.com/fiftin/str_to_azure_template_str
- Owner: fiftin
- License: mit
- Created: 2019-08-20T18:31:29.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-10-31T14:16:07.000Z (over 6 years ago)
- Last Synced: 2025-09-28T22:25:02.376Z (9 months ago)
- Topics: azure, azure-templates, converter, golang
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## What is it?
Simple tool for converting strings to valid Azure Resource Manager template strings.
It useful for passing a lot of data to VM by custom data in ARM templates.
For example you need pass some data to VM. In ARM template it can looks like:
```
{
...
"customData": "[base64(concat('#!/bin/sh\n\ncat > /home/ec2-user/config.json << CONFIG\n{\n \"domain\": \"',reference(parameters('frontIpName')).dnsSettings.fqdn,'\",\n \"sslKey\": \"',parameters('domainSslKey'),'\"\n}\nCONFIG\n\nsh /home/ec2-user/init.sh\n'))]",
...
}
```
It is hell. And it is not a lot of data.
This tool converts next readable text to string above:
```
#!/bin/sh
cat > /home/ec2-user/config.json << CONFIG
{
"domain": "${reference(parameters('frontIpName')).dnsSettings.fqdn}",
"sslKey": "${parameters('domainSslKey')}"
}
CONFIG
sh /home/ec2-user/init.sh
```
## How to install?
```
go get github.com/fiftin/str_to_azure_template_str
go install github.com/fiftin/str_to_azure_template_str
```
## How to use?
```
str_to_azure_template_str < test.txt
```