Generate a JSON object for Packer
This changes adds code that will generate a JSON object containing the things you'll need to make Packer work with Azure.
This commit is contained in:
parent
e9a63d8653
commit
a8ff095059
|
@ -246,6 +246,23 @@ $ azure role list --json \
|
||||||
|
|
||||||
Now (finally) everything has been setup in Azure. Let's get our configuration keys together:
|
Now (finally) everything has been setup in Azure. Let's get our configuration keys together:
|
||||||
|
|
||||||
|
Python:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ cat <<EOF
|
||||||
|
> {
|
||||||
|
> "subscription_id": $(az account show | jq '.id'),
|
||||||
|
> "client_id": $(az ad app list | jq '.[] | select(.displayName == "Packer") | .appId'),
|
||||||
|
> "client_secret": "$password",
|
||||||
|
> "location": "$location",
|
||||||
|
> "tenant_id": $(az account show | jq '.tenantId')
|
||||||
|
> "object_id": $(az ad app list | jq '.[] | select(.displayName == "Packer") | .objectId')
|
||||||
|
> }
|
||||||
|
> EOF
|
||||||
|
```
|
||||||
|
|
||||||
|
node.js:
|
||||||
|
|
||||||
Get `subscription_id`:
|
Get `subscription_id`:
|
||||||
|
|
||||||
``` shell
|
``` shell
|
||||||
|
@ -253,12 +270,6 @@ $ azure account show --json \
|
||||||
| jq ".[] | .id"
|
| jq ".[] | .id"
|
||||||
```
|
```
|
||||||
|
|
||||||
Python:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
$ az account show | jq -r '.id'
|
|
||||||
```
|
|
||||||
|
|
||||||
Get `client_id`
|
Get `client_id`
|
||||||
|
|
||||||
``` shell
|
``` shell
|
||||||
|
@ -266,11 +277,6 @@ $ azure ad app list --json \
|
||||||
| jq '.[] | select(.displayName | contains("APPNAME")) | .appId'
|
| jq '.[] | select(.displayName | contains("APPNAME")) | .appId'
|
||||||
```
|
```
|
||||||
|
|
||||||
Python
|
|
||||||
|
|
||||||
```shell
|
|
||||||
$ az ad app list | jq '.[] | select(.displayName | contains("APPNAME")) | .appId'
|
|
||||||
```
|
|
||||||
|
|
||||||
Get `client_secret`
|
Get `client_secret`
|
||||||
|
|
||||||
|
@ -282,32 +288,14 @@ Get `object_id` (OSTYpe=Windows only)
|
||||||
azure ad sp show -n CLIENT_ID
|
azure ad sp show -n CLIENT_ID
|
||||||
```
|
```
|
||||||
|
|
||||||
Python:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
$ az ad sp show -n CLIENT_ID
|
|
||||||
```
|
|
||||||
|
|
||||||
Get `resource_group_name`
|
Get `resource_group_name`
|
||||||
|
|
||||||
``` shell
|
``` shell
|
||||||
$ azure group list
|
$ azure group list
|
||||||
```
|
```
|
||||||
|
|
||||||
Python:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
$ az group list | jq '.[] | select(.name=="GROUPNAME") | .id'
|
|
||||||
```
|
|
||||||
|
|
||||||
Get `storage_account`
|
Get `storage_account`
|
||||||
|
|
||||||
``` shell
|
``` shell
|
||||||
$ azure storage account list
|
$ azure storage account list
|
||||||
```
|
```
|
||||||
|
|
||||||
Python:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
$ az storage account list | jq '.[] | select(.name=="GROUPNAME") | .id'
|
|
||||||
```
|
|
||||||
|
|
Loading…
Reference in New Issue