I am creating events using microsoft graph (using .net sdk) and i found out that 2 events have same id with in a mailbox - graph

Is this a valid scenario or a bug? Both the events are copied below.
{
"#odata.etag": "W/\"xyy/ioMMpU+5PhLPRGcb5AAAHWKktw==\"",
"id": "AAMkADZlNDUzMDYxLTQ2OTEtNDNiOC1hMDNhLTY1ZjAyMTYwZTBkOQBGAAAAAACPfBk217UgTYo6zKN7dzZsBwDHLL_KgwylT7k_Es9EZxvkAAAAAAENAADHLL_KgwylT7k_Es9EZxvkAAAdZ_YbAAA=",
"subject": "TestUtilityRunNow7_51",
"bodyPreview": "",
"body": {
"contentType": "html",
"content": "\r\n\r\n\r\n\r\n \r\n\r\n\r\n"
},
"start": {
"dateTime": "2019-03-08T12:57:15.0000000",
"timeZone": "UTC"
},
"end": {
"dateTime": "2019-03-08T13:02:15.0000000",
"timeZone": "UTC"
},
"location": {
"displayName": "",
"locationType": "default",
"uniqueIdType": "unknown",
"address": {},
"coordinates": {}
},
"attendees": [
{
"type": "resource",
"status": {
"response": "none",
"time": "0001-01-01T00:00:00Z"
},
"emailAddress": {
"name": "Training Room",
"address": "trainingroom#wmexchangeid.onmicrosoft.com"
}
}
],
"organizer": {
"emailAddress": {
"name": "Ravinder Singh Chahal",
"address": "ravindersingh.chahal#wmexchangeid.onmicrosoft.com"
}
}
}
{
"#odata.etag": "W/\"xyy/ioMMpU+5PhLPRGcb5AAAHWKiVA==\"",
"id": "AAMkADZlNDUzMDYxLTQ2OTEtNDNiOC1hMDNhLTY1ZjAyMTYwZTBkOQBGAAAAAACPfBk217UgTYo6zKN7dzZsBwDHLL_KgwylT7k_Es9EZxvkAAAAAAENAADHLL_KgwylT7k_Es9EZxvkAAAdZ_YBAAA=",
"subject": "TestUtilityRunNow7_25",
"bodyPreview": "",
"body": {
"contentType": "html",
"content": "\r\n\r\n\r\n\r\n \r\n\r\n\r\n"
},
"start": {
"dateTime": "2019-03-08T12:30:59.0000000",
"timeZone": "UTC"
},
"end": {
"dateTime": "2019-03-08T12:35:59.0000000",
"timeZone": "UTC"
},
"location": {
"displayName": "",
"locationType": "default",
"uniqueIdType": "unknown",
"address": {},
"coordinates": {}
},
"attendees": [
{
"type": "resource",
"status": {
"response": "none",
"time": "0001-01-01T00:00:00Z"
},
"emailAddress": {
"name": "Training Room",
"address": "trainingroom#wmexchangeid.onmicrosoft.com"
}
}
],
"organizer": {
"emailAddress": {
"name": "Ravinder Singh Chahal",
"address": "ravindersingh.chahal#wmexchangeid.onmicrosoft.com"
}
}
}

Related

Gatling jsonpath, save value

I have a json response I want to obtain a value from looking like this:
{
"resourceType": "Parameters",
"parameter": [
{
"name": "medication",
"resource": {
"resourceType": "Bundle",
"id": "cfa4fa3c-0e34-431c-ac0d-91653ebda972",
"meta": {
"lastUpdated": "2022-09-23T11:37:49.6022504+02:00",
"source": "http://xxx.xxx/Patient/$getMedication",
"profile": [
"http://xxxStructureDefinition/sfm-MedicationBundle"
]
},
"type": "document",
"timestamp": "2022-09-23T11:37:49.6022471+02:00",
"total": 6,
"link": [
{
"relation": "self",
"url": "http://xxx/Patient/$getMedication"
}
],
"entry": [
{
"fullUrl": "urn:uuid:fbb2bd18-a1c3-4f95-8384-d520fba283a5",
"resource": {
"resourceType": "Composition",
"id": "dfc4f003-4eb6-4802-8b8a-d2d53cf7698c",
"meta": {
"profile": [
"http://xxx/StructureDefinition/sfm-MedicationComposition"
]
},
"identifier": {
"use": "official",
"value": "28c2ae8d-39ed-4054-af46-22bc8c2c1e4a"
},
"status": "final",
"type": {
"coding": [
{
"system": "http://loinc.org",
"code": "11503-0",
"display": "Medical records"
}
]
},
"subject": {
"reference": "urn:uuid:67bb77c3-55dc-4643-b334-7f95e38bcf2f",
"type": "http://xxx/StructureDefinition/sfm-Patient",
"display": "Patient 05129997836"
},
"date": "2022-09-23",
"author": [
{
"reference": "urn:uuid:a443c8b2-a45a-4bad-baa6-f38904363673",
"type": "http://xxx/StructureDefinition/sfm-Practitioner",
"display": "xxx xxx, HPR: xxx"
}
],
"title": "Medication summary",
"confidentiality": "N",
"section": [
{
"title": "Medication",
"code": {
"coding": [
{
"system": "http://xxx/CodeSystem/sfm-section-types",
"code": "sectionMedication",
"display": "List of Medication statements"
}
]
},
"text": {
"status": "generated",
"div": "<xhtml:div xmlns:xhtml=\"http://www.w3.org/1999/xhtml\">List of medications</xhtml:div>"
},
"entry": [
{
"reference": "urn:uuid:8c714f72-0c90-403d-9e80-b08c61f82068",
"type": "http://xxx/fhir/StructureDefinition/sfm-MedicationStatement",
"display": "Paracetamol tab 1 g"
}
]
},
{
"title": "PllInfo",
"code": {
"coding": [
{
"system": "http://xxx/fhir/CodeSystem/sfm-section-types",
"code": "sectionPLLinfo",
"display": "PLL Info"
}
]
},
"text": {
"status": "generated",
"div": "<xhtml:div xmlns:xhtml=\"http://www.w3.org/1999/xhtml\">Nil Known</xhtml:div>"
},
"emptyReason": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/list-empty-reason",
"code": "nilknown",
"display": "Nil Known"
}
],
"text": "Nil Known"
}
},
{
"title": "Allergies",
"code": {
"coding": [
{
"system": "http://xxx/fhir/CodeSystem/sfm-section-types",
"code": "sectionAllergies",
"display": "Section allergies"
}
]
},
"text": {
"status": "generated",
"div": "<xhtml:div xmlns:xhtml=\"http://www.w3.org/1999/xhtml\">Nil Known</xhtml:div>"
},
"emptyReason": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/list-empty-reason",
"code": "nilknown",
"display": "Nil Known"
}
],
"text": "Nil Known"
}
},
{
"title": "Other Prescriptions",
"code": {
"coding": [
{
"system": "http://xxx/fhir/CodeSystem/sfm-section-types",
"code": "sectionOtherPrescriptions",
"display": "List of non medical prescriptions"
}
]
},
"text": {
"status": "generated",
"div": "<xhtml:div xmlns:xhtml=\"http://www.w3.org/1999/xhtml\">Nil Known</xhtml:div>"
},
"emptyReason": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/list-empty-reason",
"code": "nilknown",
"display": "Nil Known"
}
],
"text": "Nil Known"
}
}
]
}
},
{
"fullUrl": "urn:uuid:a443c8b2-a45a-4bad-baa6-f38904363673",
"resource": {
"resourceType": "Practitioner",
"id": "1571880245",
"meta": {
"profile": [
"http://xxx/fhir/StructureDefinition/sfm-Practitioner"
]
},
"identifier": [
{
"use": "official",
"type": {
"coding": [
{
"system": "http://hl7.no/fhir/NamingSystem/HPR",
"code": "HPR-nummer"
}
]
},
"system": "urn:oid:2.16.578.1.12.4.1.4.4",
"value": "10055817"
},
{
"use": "official",
"type": {
"coding": [
{
"system": "http://hl7.no/fhir/NamingSystem/FNR",
"code": "FNR-nummer"
}
]
},
"system": "urn:oid:2.16.578.1.12.4.1.4.1",
"value": "10099205569"
}
],
"active": true,
"name": [
{
"use": "official",
"family": "xxx",
"given": [
"xxx"
]
}
],
"gender": "male",
"birthDate": "1992-09-10"
}
},
{
"fullUrl": "urn:uuid:67bb77c3-55dc-4643-b334-7f95e38bcf2f",
"resource": {
"resourceType": "Patient",
"id": "873788333",
"meta": {
"profile": [
"http://xxx/fhir/StructureDefinition/sfm-Patient"
]
},
"identifier": [
{
"use": "official",
"type": {
"coding": [
{
"system": "http://hl7.no/fhir/NamingSystem/FNR",
"code": "FNR-nummer"
}
]
},
"system": "urn:oid:2.16.578.1.12.4.1.4.1",
"value": "05129997836"
}
],
"active": true,
"name": [
{
"family": "05129997836",
"given": [
"Patient"
]
}
],
"gender": "female",
"birthDate": "1999-12-05",
"address": [
{
"type": "postal",
"text": "Autoveien 1",
"city": "Oslo",
"postalCode": "0150"
}
]
}
},
{
"fullUrl": "urn:uuid:f4c95e15-8e9f-416a-83c7-3a6847d69278",
"resource": {
"resourceType": "Practitioner",
"id": "1215535826",
"meta": {
"profile": [
"http://xxx/fhir/StructureDefinition/sfm-Practitioner"
]
},
"identifier": [
{
"use": "official",
"type": {
"coding": [
{
"system": "http://hl7.no/fhir/NamingSystem/HPR",
"code": "HPR-nummer"
}
]
},
"system": "urn:oid:2.16.578.1.12.4.1.4.4",
"value": "1010038"
}
],
"active": true,
"name": [
{
"extension": [
{
"url": "http://hl7.no/fhir/StructureDefinition/no-basis-middlename",
"valueString": "Psa"
}
],
"use": "official",
"family": "xx",
"given": [
"xx"
]
}
],
"gender": "male"
}
},
{
"fullUrl": "urn:uuid:4b4de0ae-3f2d-4030-a193-26713cf30260",
"resource": {
"resourceType": "Medication",
"id": "667718723",
"meta": {
"profile": [
"http://xxx/fhir/StructureDefinition/sfm-Medication"
]
},
"extension": [
{
"extension": [
{
"url": "prescriptiongroup",
"valueCodeableConcept": {
"coding": [
{
"system": "urn:oid:2.16.578.1.12.4.1.1.7421",
"code": "C",
"display": "Reseptgruppe C"
}
]
}
}
],
"url": "http://hl7.no/fhir/StructureDefinition/no-basis-prescriptiongroup"
},
{
"extension": [
{
"url": "registreringstype",
"valueCodeableConcept": {
"coding": [
{
"system": "http://xxx/fhir/CodeSystem/sfm-festregistrationtype",
"code": "1",
"display": "Legemiddelvirkestoff"
}
]
}
}
],
"url": "http://xxx/fhir/StructureDefinition/sfm-medicationdetails"
}
],
"identifier": [
{
"use": "official",
"type": {
"text": "identifier"
},
"value": "ID_DF40453A-DAD1-450D-A58D-0FE411DCDB05"
}
],
"code": {
"coding": [
{
"system": "http://xxx/fhir/CodeSystem/FEST",
"code": "ID_DF40453A-DAD1-450D-A58D-0FE411DCDB05",
"display": "Paracetamol tab 1 g"
},
{
"system": "http://www.whocc.no/atc",
"code": "N02BE01",
"display": "Paracetamol"
}
]
},
"status": "active",
"form": {
"coding": [
{
"system": "urn:oid:2.16.578.1.12.4.1.1.7448",
"code": "53",
"display": "Tablett"
}
]
}
}
},
{
"fullUrl": "urn:uuid:8c714f72-0c90-403d-9e80-b08c61f82068",
"resource": {
"resourceType": "MedicationStatement",
"id": "1850837775",
"meta": {
"profile": [
"http://xxx/fhir/StructureDefinition/sfm-MedicationStatement"
]
},
"extension": [
{
"extension": [
{
"url": "reseptdate",
"valueDate": "2022-09-21"
},
{
"url": "expirationdate",
"valueDate": "2023-09-20"
},
{
"url": "festUpdate",
"valueDateTime": "2022-08-25T13:54:02+00:00"
},
{
"url": "dssn",
"valueString": "1 tablett morgen daglig"
},
{
"url": "amount",
"valueQuantity": {
"value": 92.0,
"unit": "stk"
}
},
{
"url": "reit",
"valueString": "3"
},
{
"url": "itemgroup",
"valueCodeableConcept": {
"coding": [
{
"system": "urn:oid:2.16.578.1.12.4.1.1.7402",
"code": "L",
"display": "Legemiddel"
}
]
}
},
{
"extension": [
{
"url": "starttime",
"valueDate": "2022-09-21"
},
{
"extension": [
{
"url": "amount",
"valueQuantity": {
"value": 1.0,
"unit": "tablett"
}
},
{
"url": "interval",
"valueQuantity": {
"value": 1.0,
"unit": "Døgn"
}
},
{
"url": "accurate",
"valueBoolean": false
},
{
"url": "timerange",
"valueCodeableConcept": {
"coding": [
{
"system": "urn:oid:2.16.578.1.12.4.1.1.8325",
"code": "1",
"display": "Morgen"
}
]
}
}
],
"url": "repeatingdosage"
}
],
"url": "ereseptdosing"
},
{
"extension": [
{
"url": "status",
"valueCodeableConcept": {
"coding": [
{
"system": "urn:oid:2.16.578.1.12.4.1.1.7408",
"code": "E",
"display": "Ekspederbar"
}
]
}
}
],
"url": "rfstatus"
},
{
"url": "typeresept",
"valueCodeableConcept": {
"coding": [
{
"system": "urn:oid:2.16.578.1.12.4.1.1.7491",
"code": "E",
"display": "Eresept"
}
]
}
}
],
"url": "http://xxx/fhir/StructureDefinition/sfm-reseptamendment"
},
{
"extension": [
{
"url": "status",
"valueCodeableConcept": {
"coding": [
{
"system": "http://xxx/fhir/CodeSystem/sfm-medicationstatement-registration-status",
"code": "3",
"display": "Godkjent"
}
]
}
},
{
"url": "type",
"valueCodeableConcept": {
"coding": [
{
"system": "http://xxx/fhir/CodeSystem/sfm-performer-roles",
"code": "1",
"display": "Forskrevet av"
}
]
}
},
{
"url": "provider",
"valueReference": {
"reference": "urn:uuid:f4c95e15-8e9f-416a-83c7-3a6847d69278",
"type": "http://xxx/fhir/StructureDefinition/sfm-Practitioner",
"display": "Bjørn Psa Visjon, HPR: 1010038"
}
},
{
"url": "timestamp",
"valueDateTime": "2022-09-21T16:10:25.5229768+02:00"
}
],
"url": "http://xxx/fhir/StructureDefinition/sfm-regInfo"
},
{
"extension": [
{
"url": "genericSubstitutionAccepted",
"valueBoolean": true
}
],
"url": "http://xxx/fhir/StructureDefinition/sfm-generic-substitution"
},
{
"extension": [
{
"url": "nocombination",
"valueBoolean": false
}
],
"url": "http://xxx/fhir/StructureDefinition/sfm-administration"
}
],
"identifier": [
{
"use": "usual",
"type": {
"text": "ReseptId"
},
"value": "1dfa55d7-674d-4fc8-a182-1fbd3b2faa6a"
}
],
"status": "active",
"medicationReference": {
"reference": "urn:uuid:4b4de0ae-3f2d-4030-a193-26713cf30260",
"type": "http://xxx/fhir/StructureDefinition/sfm-Medication",
"display": "Paracetamol tab 1 g"
},
"subject": {
"reference": "urn:uuid:67bb77c3-55dc-4643-b334-7f95e38bcf2f",
"type": "http://xxx/fhir/StructureDefinition/sfm-Patient",
"display": "Patient 05129997836"
},
"dosage": [
{
"extension": [
{
"url": "http://xxx/fhir/StructureDefinition/sfm-use",
"valueCodeableConcept": {
"coding": [
{
"system": "urn:oid:2.16.578.1.12.4.1.1.9101",
"code": "1",
"display": "Fast"
}
]
}
},
{
"extension": [
{
"url": "text",
"valueString": "MOT SMERTER"
}
],
"url": "http://xxx/fhir/StructureDefinition/sfm-application-area"
}
],
"sequence": 1,
"text": "1 tablett morgen daglig"
}
]
}
}
]
}
},
{
"name": "KJHentetTidspunkt",
"valueDateTime": "2022-09-23T09:37:49.55+00:00"
},
{
"name": "RFHentetTidspunkt",
"valueDateTime": "2022-09-23T11:37:49.027+02:00"
},
{
"name": "KJFeilkode",
"valueCodeableConcept": {
"coding": [
{
"system": "http://xxx/fhir/CodeSystem/sfm-kj-rf-error-code",
"code": "0"
}
],
"text": "OK"
}
},
{
"name": "RFM96Feilkode",
"valueCodeableConcept": {
"coding": [
{
"system": "http://xxx/fhir/CodeSystem/sfm-kj-rf-error-code",
"code": "0"
}
],
"text": "OK"
}
},
{
"name": "RFM912Feilkode",
"valueCodeableConcept": {
"coding": [
{
"system": "http://xxx/fhir/CodeSystem/sfm-kj-rf-error-code",
"code": "0"
}
],
"text": "OK"
}
},
{
"name": "KJHarLegemidler",
"valueBoolean": false
},
{
"name": "KJHarLaste",
"valueBoolean": false
},
{
"name": "RFHarLaste",
"valueBoolean": false
}
]
}
The value I am looking for is the "fullUrl", as in urn:uuid:fbb2bd18-a1c3-4f95-8384-d520fba283a5
I tried to use this jsonpath expression:
.check(jsonPath("$..[?(#.resourceType=="Bundle")].entry.fullUrl").saveAs("fullUrl"))
However it says
jsonPath($..[?(#.resourceType=="Bundle")].entry.fullUrl).find. exists, found nothing
How can I construct an experssion to obtain the fullUrl?
It's because entry is array. So you have two options how to extract the value.
You can get all fullUrl values and then obtain via Gatling EL:
jsonPath("$..[?(#.resourceType=='Bundle')].entry..fullUrl").findAll.saveAs("fullUrls")
And then just get by index #{fullUrls(0)} (Documentation)
Or get by index in the json path:
|
|
ᐯ
jsonPath("$..[?(#.resourceType=='Bundle')].entry.[0].fullUrl").findAll.saveAs("fullUrl")

Sabre BargainFinderMax REST API ResponseType field not working properly

Checking the BFM v4 Rest API docs we find that we can set a 'ResponseType' field to decide how the response will be formatted.
However, when testing this in Postman, we found some oddities. A request with the following Body to the endpoint /v4/offers/shop:
{
"OTA_AirLowFareSearchRQ": {
"POS": {
"Source": [
{
"PseudoCityCode": "{{pcc}}",
"RequestorID": {
"ID": "1",
"Type": "1",
"CompanyName": {
"Code": "TN",
"CodeContext": "TN"
}
}
}
]
},
"OriginDestinationInformation": [
{
"TPA_Extensions": {
"SegmentType": { "Code": "O"}
},
"RPH": "1",
"Fixed": false,
"DepartureDateTime": "{{start_date}}T11:00:00",
"OriginLocation": {
"AllAirports": false,
"LocationCode": "MIA",
"CodeContext": "IATA"
},
"DestinationLocation": {
"AllAirports": false,
"LocationCode": "MCO",
"CodeContext": "IATA"
}
}
],
"TravelPreferences": {
"CabinPref": [
{
"Cabin": "Y",
"PreferLevel": "Preferred"
}
],
"LookForAlternatives": false,
"TPA_Extensions": {
"TripType": { "Value": "OneWay" },
"JumpCabinLogic": { "Disabled": false },
"KeepSameCabin": { "Enabled": true },
"DiversityParameters": {
"AdditionalNonStopsNumber": 30
},
"ExcludeVendorPref": [
{
"Code": "G3"
}
]
},
"ETicketDesired": false,
"Hybrid": true,
"ValidInterlineTicket": true
},
"TravelerInfoSummary": {
"AirTravelerAvail": [
{
"PassengerTypeQuantity": [
{
"Code": "ADT",
"Quantity": 1,
"TPA_Extensions": {
"VoluntaryChanges": {
"Match": "Any"
}
}
}
]
}
],
"PriceRequestInformation": {
"NegotiatedFareCode": [],
"AccountCode": [{ "Code": "PROMAO" }],
"CurrencyCode": "BRL",
"TPA_Extensions": {
"BrandedFareIndicators": {
"SingleBrandedFare": true,
"MultipleBrandedFares": true
},
"Indicators": {
"MinMaxStay": { "Ind": true },
"RefundPenalty": { "Ind": true },
"ResTicketing": { "Ind": true }
},
"Priority": {
"Price": { "Priority": 1 },
"DirectFlights": { "Priority": 2 },
"Time": { "Priority": 3 },
"Vendor": { "Priority": 4 }
}
}
}
},
"TPA_Extensions": {
"IntelliSellTransaction": {
"RequestType": { "Name": "50ITINS" },
"CompressResponse": {
"Value": false
}
},
"AlternateAirportMileage": {
"Number": "25"
}
},
"DirectFlightsOnly": false,
"ResponseType": "OTA",
"SeparateMessages": false,
"Version": "v4"
}
}
produces a response in the GroupedItineraries format ("GIR" value), which is an undesired behavior for us.
Weirdly, the API accepts any string to this field 'ResponseType', not indicating any misuse, but always returning the GroupedItineraries format. The response contains the following messages:
{
"groupedItineraryResponse": {
"version": "6.5.2",
"messages": [
{
"severity": "Info",
"type": "SERVER",
"code": "ASE032LPSCIL549.ATSE.CERT.ASCINT.SABRECIRRUS.COM",
"text": "27138"
},
{
"severity": "Info",
"type": "WORKERTHREAD",
"code": "TRANSACTIONID",
"text": "7100110708344235563"
},
{
"severity": "Info",
"type": "DRE",
"code": "RULEID",
"text": "18411"
},
{
"severity": "Info",
"type": "DEFAULT",
"code": "RULEID",
"text": "25916"
},
{
"severity": "Info",
"type": "SCHEDULES",
"code": "MSG",
"text": "NO FLIGHT SCHEDULES FOR JOURNEY 2022-06-24 [FLL]-[ISM]"
},
{
"severity": "Info",
"type": "SCHEDULES",
"code": "MSG",
"text": "NO FLIGHT SCHEDULES FOR JOURNEY 2022-06-24 [MIA]-[ISM]"
},
{
"severity": "Info",
"type": "SCHEDULES",
"code": "MSG",
"text": "NO FLIGHT SCHEDULES FOR JOURNEY 2022-06-24 [OPF]-[ISM]"
},
{
"severity": "Info",
"type": "SCHEDULES",
"code": "MSG",
"text": "NO FLIGHT SCHEDULES FOR JOURNEY 2022-06-24 [OPF]-[MCO]"
},
{
"severity": "Info",
"type": "SCHEDULES",
"code": "MSG",
"text": "NO FLIGHT SCHEDULES FOR JOURNEY 2022-06-24 [OPF]-[ORL]"
},
{
"severity": "Info",
"type": "SCHEDULES",
"code": "MSG",
"text": "NO FLIGHT SCHEDULES FOR JOURNEY 2022-06-24 [TMB]-[ISM]"
},
{
"severity": "Info",
"type": "SCHEDULES",
"code": "MSG",
"text": "NO FLIGHT SCHEDULES FOR JOURNEY 2022-06-24 [TMB]-[MCO]"
},
{
"severity": "Info",
"type": "SCHEDULES",
"code": "MSG",
"text": "NO FLIGHT SCHEDULES FOR JOURNEY 2022-06-24 [TMB]-[ORL]"
}
] ...
Informing that there's no support for OTA using REST, the REST service answers will always be on GIR format.
Best regards.

How do one work with third party resources in ARM templates?

I'm trying to find out where can I find template reference for SendGrid resource in Azure. It's possible to deploy SendGrid through ARM but I can not find any documentation with details about parameters etc.
Here is a sample of SendGrid account for you.
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"name": {
"type": "String"
},
"location": {
"type": "String"
},
"plan_name": {
"type": "String"
},
"plan_publisher": {
"type": "String"
},
"plan_product": {
"type": "String"
},
"plan_promotion_code": {
"type": "String"
},
"password": {
"type": "SecureString"
},
"email": {
"type": "String"
},
"firstName": {
"type": "String"
},
"lastName": {
"type": "String"
},
"company": {
"type": "String"
},
"website": {
"type": "String"
},
"acceptMarketingEmails": {
"type": "String"
},
"tags": {
"type": "Object"
}
},
"resources": [{
"type": "Sendgrid.Email/accounts",
"apiVersion": "2015-01-01",
"name": "[parameters('name')]",
"location": "[parameters('location')]",
"tags": "[parameters('tags')]",
"plan": {
"name": "[parameters('plan_name')]",
"publisher": "[parameters('plan_publisher')]",
"product": "[parameters('plan_product')]",
"promotionCode": "[parameters('plan_promotion_code')]"
},
"properties": {
"password": "[parameters('password')]",
"acceptMarketingEmails": "[parameters('acceptMarketingEmails')]",
"email": "[parameters('email')]",
"firstName": "[parameters('firstName')]",
"lastName": "[parameters('lastName')]",
"company": "[parameters('company')]",
"website": "[parameters('website')]"
}
}]
}

How do I pass RegistrationKey to Azure DSC extenstion

I have template below which errors out during deployment with error below. Samples on documentation page seems to be erroneous and don't even compile.
"message": "VM has reported a failure when processing extension
'Microsoft.Powershell.DSC'. Error message: \"The DSC Extension failed
to install: Invalid type for parameter RegistrationKey of type
PSCredential.\nMore information about the failure can be found in the
logs located under
'C:\WindowsAzure\Logs\Plugins\Microsoft.Powershell.DSC\2.74.0.0'
on the VM.\nTo retry install, please remove the extension from the VM
first. \"."
Template
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "[parameters('swarmmanager1Name')]",
"type": "Microsoft.Compute/virtualMachines",
"location": "[resourceGroup().location]",
"apiVersion": "2015-06-15",
"tags": {
"displayName": "swarmmanager1"
},
"properties": {
"hardwareProfile": {
"vmSize": "[parameters('swarmmanager1VmSize')]"
},
"licenseType": "[parameters('LicenseType')]",
"osProfile": {
"computerName": "[parameters('swarmmanager1Name')]",
"adminUsername": "[parameters('adminUsername')]",
"adminPassword": "[parameters('adminPassword')]"
},
"storageProfile": {
"imageReference": {
"publisher": "[parameters('swarmmanager1ImagePublisher')]",
"offer": "[parameters('swarmmanager1ImageOffer')]",
"sku": "[parameters('windowsOSVersion')]",
"version": "latest"
},
"osDisk": {
"name": "swarmmanager1OSDisk",
"vhd": {
"uri": "[concat(reference(resourceId('Microsoft.Storage/storageAccounts', parameters('dockerswarmstorageaccountName')), '2016-01-01').primaryEndpoints.blob, parameters('swarmmanager1StorageAccountContainerName'), '/', parameters('swarmmanager1OSDiskName'), '.vhd')]"
},
"caching": "ReadWrite",
"createOption": "FromImage"
}
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('swarmmanager1NicName'))]"
}
]
}
},
"resources": [
{
"name": "Microsoft.Powershell.DSC",
"type": "extensions",
"location": "[resourceGroup().location]",
"apiVersion": "2015-06-15",
"dependsOn": [
"[resourceId('Microsoft.Compute/virtualMachines', parameters('swarmmanager1Name'))]"
],
"tags": {
"displayName": "DSC"
},
"properties": {
"publisher": "Microsoft.Powershell",
"typeHandlerVersion": "2.26",
"type": "DSC",
"autoUpgradeMinorVersion": true,
"forceUpdateTag": "[parameters('DSCExtensionManagerTagVersion')]",
"settings": {
"wmfVersion": "latest",
"configurationArguments": {
//"RegistrationKey": {
// "UserName": "PLACEHOLDER_DONOTUSE",
// "Password": "PrivateSettingsRef:registrationKeyPrivate"
// },
"RegistrationKey": "[parameters('RegistrationKey')]",
"RegistrationUrl": "[parameters('registrationUrl')]",
"NodeConfigurationName": "SwarmManager.localhost",
"RebootNodeIfNeeded": true
}
},
"protectedSettings": {
"Items": {
"registrationKeyPrivate": "[parameters('RegistrationKey')]"
}
}
}
}
]
},
{
"name": "[parameters('dockerswarmstorageaccountName')]",
"type": "Microsoft.Storage/storageAccounts",
"location": "[resourceGroup().location]",
"apiVersion": "2016-01-01",
"sku": {
"name": "[parameters('dockerswarmstorageaccountType')]"
},
"dependsOn": [],
"tags": {
"displayName": "dockerswarmstorageaccount"
},
"kind": "Storage"
},
{
"name": "[parameters('swarmmanager1NicName')]",
"type": "Microsoft.Network/networkInterfaces",
"location": "[resourceGroup().location]",
"apiVersion": "2016-03-30",
"tags": {
"displayName": "swarmmanager1Nic"
},
"properties": {
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"privateIPAllocationMethod": "Dynamic",
"subnet": {
"id": "[parameters('swarmmanager1SubnetRef')]"
},
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('swarmmanagerpublicIPName'))]"
}
}
}
]
}
},
{
"apiVersion": "2016-03-30",
"dependsOn": [],
"location": "[resourceGroup().location]",
"name": "[parameters('swarmmanagerpublicIPName')]",
"properties": {
"publicIPAllocationMethod": "Dynamic",
"dnsSettings": {
"domainNameLabel": "[parameters('swarmmanagerpublicIPDnsName')]"
}
},
"tags": {
"displayName": "swarmmanagerpublicIP"
},
"type": "Microsoft.Network/publicIPAddresses"
}
],
"parameters": {
"swarmmanager1Name": { "type": "string" },
"swarmmanager1VmSize": { "type": "string" },
"adminUsername": { "type": "string" },
"adminPassword": { "type": "securestring" },
"dockerswarmstorageaccountName": { "type": "string" },
"dockerswarmstorageaccountType": { "type": "string" },
"swarmmanager1NicName": { "type": "string" },
"swarmmanagerpublicIPName": { "type": "string" },
"swarmmanager1SubnetRef": { "type": "string" },
"swarmmanager1ImagePublisher": { "type": "string" },
"swarmmanager1ImageOffer": { "type": "string" },
"windowsOSVersion": { "type": "string" },
"swarmmanager1StorageAccountContainerName": { "type": "string" },
"swarmmanager1OSDiskName": { "type": "string" },
"swarmmanagerpublicIPDnsName": { "type": "string" },
"DSCConfigurationURL": { "type": "string" },
"DSCExtensionManagerTagVersion": { "type": "string" },
"RegistrationKey": { "type": "securestring" },
"RegistrationUrl": { "type": "string" },
"LicenseType": {"type": "string"}
},
"outputs": {
"returnedIPAddress": {
"type": "string",
"value": "[reference(parameters('swarmmanager1NicName')).ipConfigurations[0].properties.privateIPAddress]"
}
}
}
if you want to pass in ps credentials do this:
"protectedSettings": {
"configurationArguments": {
"RegistrationKey": {
"userName": "whatever",
"password": "[parameters('RegistrationKey')]"
}
}
}

How do I get private IP address of VM in nested ARM template?

I have a nested template which creates VM which works fine but I need to return private IP address of that machine to main template and as output. I create following output in my nested template but it fails with error message
Deployment template validation failed: 'The template reference 'swarmmanager1NetworkInterface' is not valid: could not find template resource or resource copy with this name. Please see https://aka.ms/arm-template-expressions/#reference for usage details.'.
Here is entire template
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01-preview/deploymentTemplate.json",
"contentVersion": "1.0.0.0",
"parameters": {
"vmSku": {
"type": "string",
"defaultValue": "Standard_A1",
"metadata": {
"description": "Size of VMs in the VM Scale Set."
}
},
"windowsOSVersion": {
"type": "string",
"defaultValue": "2016-Datacenter-with-Containers",
"allowedValues": [
"2008-R2-SP1",
"2012-Datacenter",
"2012-R2-Datacenter",
"2016-Datacenter-with-Containers"
],
"metadata": {
"description": "The Windows version for the VM. This will pick a fully patched image of this given Windows version. Allowed values: 2008-R2-SP1, 2012-Datacenter, 2012-R2-Datacenter."
}
},
"registrationKey": {
"type": "securestring",
"metadata": {
"description": "Registration key to use to onboard to the Azure Automation DSC pull/reporting server"
}
},
"registrationUrl": {
"type": "string",
"metadata": {
"description": "Registration url of the Azure Automation DSC pull/reporting server"
}
},
"DSCExtensionTagVersion": {
"type": "string",
"metadata": {
"description": "Change this to redeploy DSC"
}
},
"nodeConfigurationName": {
"type": "string",
"defaultValue": "MyService.webServer",
"metadata": {
"description": "The name of the node configuration, on the Azure Automation DSC pull server, that this node will be configured as"
}
},
"configurationMode": {
"type": "string",
"defaultValue": "ApplyAndAutoCorrect",
"allowedValues": [
"ApplyOnly",
"ApplyAndMonitor",
"ApplyAndAutoCorrect"
],
"metadata": {
"description": "DSC agent (LCM) configuration mode setting. ApplyOnly, ApplyAndMonitor, or ApplyAndAutoCorrect"
}
},
"configurationModeFrequencyMins": {
"type": "int",
"defaultValue": 15,
"metadata": {
"description": "DSC agent (LCM) configuration mode frequency setting, in minutes"
}
},
"refreshFrequencyMins": {
"type": "int",
"defaultValue": 30,
"metadata": {
"description": "DSC agent (LCM) refresh frequency setting, in minutes"
}
},
"rebootNodeIfNeeded": {
"type": "bool",
"defaultValue": true,
"metadata": {
"description": "DSC agent (LCM) rebootNodeIfNeeded setting"
}
},
"actionAfterReboot": {
"type": "string",
"defaultValue": "ContinueConfiguration",
"allowedValues": [
"ContinueConfiguration",
"StopConfiguration"
],
"metadata": {
"description": "DSC agent (LCM) actionAfterReboot setting. ContinueConfiguration or StopConfiguration"
}
},
"allowModuleOverwrite": {
"type": "bool",
"defaultValue": false,
"metadata": {
"description": "DSC agent (LCM) allowModuleOverwrite setting"
}
},
"automationAccountName": {
"type": "string",
"defaultValue": "myAutomationAccount",
"metadata": {
"description": "The name of the Automation account to use. Check the SKU and tags to make sure they match the existing account."
}
},
"automationRegionId": {
"type": "string",
"defaultValue": "East US 2",
"allowedValues": [
"Japan East",
"East US 2",
"West Europe",
"Southeast Asia",
"South Central US",
"Central India"
],
"metadata": {
"description": "The region the Automation account is located in."
}
},
"vmssName": {
"type": "string",
"metadata": {
"description": "String used as a base for naming resources. Must be 3-57 characters in length and globally unique across Azure. A hash is prepended to this string for some resources, and resource-specific information is appended."
},
"maxLength": 57
},
"instanceCount": {
"type": "int",
"metadata": {
"description": "Number of VM instances (100 or less)."
},
"maxValue": 100
},
"adminUsername": {
"type": "string",
"metadata": {
"description": "Admin username on all VMs."
}
},
"adminPassword": {
"type": "securestring",
"metadata": {
"description": "Admin password on all VMs."
}
},
"_artifactsLocation": {
"type": "string",
"metadata": {
"description": "Auto-generated container in staging storage account to receive post-build staging folder upload"
}
},
"_artifactsLocationSasToken": {
"type": "securestring",
"metadata": {
"description": "Auto-generated token to access _artifactsLocation"
}
},
"dockerswarmstorageaccountType": {
"type": "string",
"defaultValue": "Standard_LRS",
"allowedValues": [
"Standard_LRS",
"Standard_ZRS",
"Standard_GRS",
"Standard_RAGRS",
"Premium_LRS"
]
},
"swarmmanager1Name": {
"type": "string",
"minLength": 1,
"defaultValue": "swarmmanager1"
},
"swarmmanagerpublicIPDnsName": {
"type": "string",
"defaultValue": "[uniqueString(subscription().subscriptionId)]",
"minLength": 1
}
},
"variables": {
"namingInfix": "[toLower(substring(concat(parameters('vmssName'), uniqueString(resourceGroup().id)), 0, 9))]",
"longNamingInfix": "[toLower(parameters('vmssName'))]",
"addressPrefix": "10.0.0.0/16",
"subnetPrefix": "10.0.8.0/21",
"virtualNetworkName": "[concat(variables('namingInfix'), 'vnet')]",
"natPoolName": "[concat(variables('namingInfix'), 'natpool')]",
"publicIPAddressName": "[concat(variables('namingInfix'), 'pip')]",
"subnetName": "[concat(variables('namingInfix'), 'subnet')]",
"nicName": "[concat(variables('namingInfix'), 'nic')]",
"ipConfigName": "[concat(variables('namingInfix'), 'ipconfig')]",
"imageReference": {
"publisher": "MicrosoftWindowsServer",
"offer": "WindowsServer",
"sku": "[parameters('windowsOSVersion')]",
"version": "latest"
},
"virtualNetworkID": "[resourceId('Microsoft.Network/virtualNetworks',variables('virtualNetworkName'))]",
"appGwPublicIPAddressName": "[concat(variables('namingInfix'), 'appGwPip')]",
"bePoolName": "[concat(variables('namingInfix'), 'bepool')]",
"frontEndIPConfigID": "[concat(variables('lbID'),'/frontendIPConfigurations/loadBalancerFrontEnd')]",
"appGwName": "[concat(variables('namingInfix'), 'appGw')]",
"loadBalancerName": "[concat(variables('namingInfix'), 'lb')]",
"publicIPAddressID": "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]",
"lbID": "[resourceId('Microsoft.Network/loadBalancers',variables('loadBalancerName'))]",
"appGwPublicIPAddressID": "[resourceId('Microsoft.Network/publicIPAddresses',variables('appGwPublicIPAddressName'))]",
"appGwID": "[resourceId('Microsoft.Network/applicationGateways',variables('appGwName'))]",
"appGwSubnetName": "[concat(variables('namingInfix'),'appGwSubnet')]",
"appGwSubnetPrefix": "10.0.1.0/24",
"appGwSubnetID": "[concat(variables('virtualNetworkID'),'/subnets/',variables('appGwSubnetName'))]",
"appGwFrontendPort": 80,
"appGwBackendPort": 80,
"appGwBePoolName": "[concat(variables('namingInfix'), 'appGwBepool')]",
"computeApiVersion": "2016-04-30-preview",
"networkApiVersion": "2016-03-30",
"natStartPort": 50000,
"natEndPort": 50119,
"natBackendPort": 3389,
"DSCArchiveFolder": "DSC",
"DSCArchiveFileName": "DSC.zip",
"dockerswarmstorageaccountName": "[concat('sa', uniqueString(resourceGroup().id))]",
"swarmmanager1ImagePublisher": "MicrosoftWindowsServer",
"swarmmanager1ImageOffer": "WindowsServer",
"swarmmanager1OSDiskName": "swarmmanager1OSDisk",
"swarmmanager1VmSize": "Standard_D2_v2",
"swarmmanager1VnetID": "[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]",
"swarmmanager1SubnetRef": "[concat(variables('swarmmanager1VnetID'), '/subnets/', variables('subnetName'))]",
"swarmmanager1StorageAccountContainerName": "vhds",
"swarmmanager1NicName": "[concat(parameters('swarmmanager1Name'), 'NetworkInterface')]",
"swarmmanagerpublicIPName": "swarmmanagerpublicIP",
"swarmmanagerdeploymentTemplateFolder": "nestedtemplates",
"swarmmanagerdeploymentTemplateFileName": "swarmmanagerdeployment.json",
"swarmmanagerdeploymentTemplateParametersFileName": "swarmmanagerdeployment.parameters.json"
},
"resources": [
{
"type": "Microsoft.Network/virtualNetworks",
"name": "[variables('virtualNetworkName')]",
"location": "[resourceGroup().location]",
"apiVersion": "[variables('networkApiVersion')]",
"properties": {
"addressSpace": {
"addressPrefixes": [
"[variables('addressPrefix')]"
]
},
"subnets": [
{
"name": "[variables('subnetName')]",
"properties": {
"addressPrefix": "[variables('subnetPrefix')]"
}
},
{
"name": "[variables('appGwSubnetName')]",
"properties": {
"addressPrefix": "[variables('appGwSubnetPrefix')]"
}
}
]
}
},
{
"type": "Microsoft.Network/loadBalancers",
"name": "[variables('loadBalancerName')]",
"location": "[resourceGroup().location]",
"apiVersion": "2017-04-01",
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]"
],
"properties": {
"frontendIPConfigurations": [
{
"name": "LoadBalancerFrontEnd",
"properties": {
"publicIPAddress": {
"id": "[variables('publicIPAddressID')]"
}
}
}
],
"backendAddressPools": [
{
"name": "[variables('bePoolName')]"
}
],
"inboundNatPools": [
{
"name": "[variables('natPoolName')]",
"properties": {
"frontendIPConfiguration": {
"id": "[variables('frontEndIPConfigID')]"
},
"protocol": "tcp",
"frontendPortRangeStart": "[variables('natStartPort')]",
"frontendPortRangeEnd": "[variables('natEndPort')]",
"backendPort": "[variables('natBackendPort')]"
}
}
]
}
},
{
"type": "Microsoft.Network/publicIPAddresses",
"name": "[variables('appGwPublicIPAddressName')]",
"location": "[resourceGroup().location]",
"apiVersion": "[variables('networkApiVersion')]",
"properties": {
"publicIPAllocationMethod": "Dynamic",
"dnsSettings": {
"domainNameLabel": "appgwvip"
}
}
},
{
"apiVersion": "[variables('networkApiVersion')]",
"location": "[resourceGroup().location]",
"name": "[variables('publicIPAddressName')]",
"properties": {
"publicIPAllocationMethod": "Dynamic",
"dnsSettings": {
"domainNameLabel": "rdpvip"
}
},
"type": "Microsoft.Network/publicIPAddresses"
},
{
"type": "Microsoft.Network/applicationGateways",
"name": "[variables('appGwName')]",
"location": "[resourceGroup().location]",
"apiVersion": "[variables('networkApiVersion')]",
"dependsOn": [
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]",
"[concat('Microsoft.Network/publicIPAddresses/', variables('appGwPublicIPAddressName'))]"
],
"properties": {
"sku": {
"name": "Standard_Small",
"tier": "Standard",
"capacity": "1"
},
"gatewayIPConfigurations": [
{
"name": "appGwIpConfig",
"properties": {
"subnet": {
"id": "[variables('appGwSubnetID')]"
}
}
}
],
"frontendIPConfigurations": [
{
"name": "appGwFrontendIP",
"properties": {
"PublicIPAddress": {
"id": "[variables('appGwPublicIPAddressID')]"
}
}
}
],
"frontendPorts": [
{
"name": "appGwFrontendPort",
"properties": {
"Port": "[variables('appGwFrontendPort')]"
}
}
],
"backendAddressPools": [
{
"name": "[variables('appGwBePoolName')]"
}
],
"backendHttpSettingsCollection": [
{
"name": "appGwBackendHttpSettings",
"properties": {
"Port": "[variables('appGwBackendPort')]",
"Protocol": "Http",
"CookieBasedAffinity": "Disabled"
}
}
],
"httpListeners": [
{
"name": "appGwHttpListener",
"properties": {
"FrontendIPConfiguration": {
"Id": "[concat(variables('appGwID'), '/frontendIPConfigurations/appGwFrontendIP')]"
},
"FrontendPort": {
"Id": "[concat(variables('appGwID'), '/frontendPorts/appGwFrontendPort')]"
},
"Protocol": "Http",
"SslCertificate": null
}
}
],
"requestRoutingRules": [
{
"Name": "rule1",
"properties": {
"RuleType": "Basic",
"httpListener": {
"id": "[concat(variables('appGwID'), '/httpListeners/appGwHttpListener')]"
},
"backendAddressPool": {
"id": "[concat(variables('appGwID'), '/backendAddressPools/', variables('appGwBePoolName'))]"
},
"backendHttpSettings": {
"id": "[concat(variables('appGwID'), '/backendHttpSettingsCollection/appGwBackendHttpSettings')]"
}
}
}
]
}
},
{
"type": "Microsoft.Compute/virtualMachineScaleSets",
"name": "[variables('namingInfix')]",
"location": "[resourceGroup().location]",
"apiVersion": "[variables('computeApiVersion')]",
"dependsOn": [
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]",
"[concat('Microsoft.Network/applicationGateways/', variables('appGwName'))]",
"[concat('Microsoft.Network/loadBalancers/', variables('loadBalancerName'))]"
],
"sku": {
"name": "[parameters('vmSku')]",
"tier": "Standard",
"capacity": "[parameters('instanceCount')]"
},
"properties": {
"overprovision": "false",
"singlePlacementGroup": "true",
"upgradePolicy": {
"mode": "Automatic"
},
"virtualMachineProfile": {
"storageProfile": {
"osDisk": {
"caching": "ReadWrite",
"createOption": "FromImage"
},
"dataDisks": [],
"imageReference": "[variables('imageReference')]"
},
"osProfile": {
"computerNamePrefix": "[variables('namingInfix')]",
"adminUsername": "[parameters('adminUsername')]",
"adminPassword": "[parameters('adminPassword')]"
},
"networkProfile": {
"networkInterfaceConfigurations": [
{
"name": "[variables('nicName')]",
"properties": {
"primary": "true",
"ipConfigurations": [
{
"name": "[variables('ipConfigName')]",
"properties": {
"subnet": {
"id": "[concat('/subscriptions/', subscription().subscriptionId,'/resourceGroups/', resourceGroup().name, '/providers/Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'), '/subnets/', variables('subnetName'))]"
},
"loadBalancerBackendAddressPools": [
{
"id": "[concat('/subscriptions/', subscription().subscriptionId,'/resourceGroups/', resourceGroup().name, '/providers/Microsoft.Network/loadBalancers/', variables('loadBalancerName'), '/backendAddressPools/', variables('bePoolName'))]"
}
],
"loadBalancerInboundNatPools": [
{
"id": "[concat('/subscriptions/', subscription().subscriptionId,'/resourceGroups/', resourceGroup().name, '/providers/Microsoft.Network/loadBalancers/', variables('loadBalancerName'), '/inboundNatPools/', variables('natPoolName'))]"
}
],
"ApplicationGatewayBackendAddressPools": [
{
"id": "[concat('/subscriptions/', subscription().subscriptionId,'/resourceGroups/', resourceGroup().name, '/providers/Microsoft.Network/applicationGateways/', variables('appGwName'), '/backendAddressPools/', variables('appGwBePoolName'))]"
}
]
}
}
]
}
}
]
},
"extensionProfile": {
"extensions": [
{
"name": "Microsoft.Powershell.DSC",
"properties": {
"autoUpgradeMinorVersion": true,
"publisher": "Microsoft.Powershell",
"forceUpdateTag": "[parameters('DSCExtensionTagVersion')]",
"settings": {
"configuration": {
"url": "[concat(parameters('_artifactsLocation'), '/', variables('DSCArchiveFolder'), '/', variables('DSCArchiveFileName'), parameters('_artifactsLocationSasToken'))]",
"script": "DSC.ps1",
"function": "Main"
},
"configurationArguments": {
"RegistrationKey": "[parameters('registrationKey')]",
"RegistrationUrl": "[parameters('registrationUrl')]",
"NodeConfigurationName": "[parameters('nodeConfigurationName')]",
"ConfigurationMode": "[parameters('configurationMode')]",
"ConfigurationModeFrequencyMins": "[parameters('configurationModeFrequencyMins')]",
"RefreshFrequencyMins": "[parameters('refreshFrequencyMins')]",
"RebootNodeIfNeeded": "[parameters('rebootNodeIfNeeded')]",
"ActionAfterReboot": "[parameters('actionAfterReboot')]",
"AllowModuleOverwrite": "[parameters('allowModuleOverwrite')]"
}
},
"type": "DSC",
"typeHandlerVersion": "2.26"
}
}
]
}
}
}
},
{
"name": "swarmmanager",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2016-09-01",
"dependsOn": [],
"properties": {
"mode": "Incremental",
"template": {
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "[parameters('swarmmanager1Name')]",
"type": "Microsoft.Compute/virtualMachines",
"location": "[resourceGroup().location]",
"apiVersion": "2015-06-15",
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', variables('dockerswarmstorageaccountName'))]",
"[resourceId('Microsoft.Network/networkInterfaces', variables('swarmmanager1NicName'))]"
],
"tags": {
"displayName": "swarmmanager1"
},
"properties": {
"hardwareProfile": {
"vmSize": "[variables('swarmmanager1VmSize')]"
},
"osProfile": {
"computerName": "[parameters('swarmmanager1Name')]",
"adminUsername": "[parameters('adminUsername')]",
"adminPassword": "[parameters('adminPassword')]"
},
"storageProfile": {
"imageReference": {
"publisher": "[variables('swarmmanager1ImagePublisher')]",
"offer": "[variables('swarmmanager1ImageOffer')]",
"sku": "[parameters('windowsOSVersion')]",
"version": "latest"
},
"osDisk": {
"name": "swarmmanager1OSDisk",
"vhd": {
"uri": "[concat(reference(resourceId('Microsoft.Storage/storageAccounts', variables('dockerswarmstorageaccountName')), '2016-01-01').primaryEndpoints.blob, variables('swarmmanager1StorageAccountContainerName'), '/', variables('swarmmanager1OSDiskName'), '.vhd')]"
},
"caching": "ReadWrite",
"createOption": "FromImage"
}
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('swarmmanager1NicName'))]"
}
]
}
}
},
{
"name": "[variables('dockerswarmstorageaccountName')]",
"type": "Microsoft.Storage/storageAccounts",
"location": "[resourceGroup().location]",
"apiVersion": "2016-01-01",
"sku": {
"name": "[parameters('dockerswarmstorageaccountType')]"
},
"dependsOn": [],
"tags": {
"displayName": "dockerswarmstorageaccount"
},
"kind": "Storage"
},
{
"name": "[variables('swarmmanager1NicName')]",
"type": "Microsoft.Network/networkInterfaces",
"location": "[resourceGroup().location]",
"apiVersion": "2016-03-30",
"tags": {
"displayName": "swarmmanager1Nic"
},
"properties": {
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"privateIPAllocationMethod": "Dynamic",
"subnet": {
"id": "[variables('swarmmanager1SubnetRef')]"
},
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('swarmmanagerpublicIPName'))]"
}
}
}
]
}
},
{
"name": "[variables('swarmmanagerpublicIPName')]",
"type": "Microsoft.Network/publicIPAddresses",
"location": "[resourceGroup().location]",
"apiVersion": "2016-03-30",
"dependsOn": [],
"tags": {
"displayName": "swarmmanagerpublicIP"
},
"properties": {
"publicIPAllocationMethod": "Dynamic",
"dnsSettings": {
"domainNameLabel": "[parameters('swarmmanagerpublicIPDnsName')]"
}
}
},
{
"outputs": {
"returnedIPAddress": {
"type": "string",
"value": "[reference(variables('swarmmanager1NicName')).ipConfigurations[0].properties.privateIPAddress]"
}
}
}
]
}
}
}
]
}
Ok, a couple things - you have your output in the nested template in the resources array - outputs should be a peer of the resources array. That's not getting flagged because of the inline reference() call fails before this.
First, reference() calls are often made very early in the deployment - sometimes earlier than you want them to be. When the resource being referenced is defined in the same template, it works as expected. When it's not defined in the same template, the GET happens immediately and the resource may not exist. That's a nuance of the reference() function that's a little tangential but important to know as you use it...
Combine that behavior with the inline template deployment. Inline deployments have a number of design quirks that make them pretty hard to use for anything "advanced". You won't be able to do what you're doing with an inline deployment. If you use a templateLink (i.e. another file), you can deploy the nic and output the ipconfig in the same template.
That help?
I have had a similar issue, we were deploying using Azure Pipelines, the approach i took was 1) Deploy Template and pass the RG name and VMSS name as template outputs 2) ARM Outputs - Use this snippet to publish the above results as vars to use downstream 3) Azure Powershell to get the IPs of all VMSS instances and publish them as pipeline variables 4) Write the pipeline vars file to a blob. Hope this helps
$iplist=#()
$i=1
$nicinfo=Get-AzureRmNetworkInterface -ResourceGroupName $(ResourceGroupName) -
VirtualMachineScaleSetName $(VmssName)
foreach($nic in $nicinfo){
$iplist += $nic.IpConfigurations.PrivateIpAddress
}
foreach($ip in $iplist){
Write-host Private ip $i is $ip
Write-Host "##vso[task.setvariable variable=Privateip$i;]$ip"
$i++
}

Resources