Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ inputs:
default: 1
dns-name-label:
description: 'The DNS Name Label for Container with Public IP'
required: true
required: false
environment-variables:
description: 'List of environment variables for the container. Space-seperated in "key=value" format'
required: false
Expand Down Expand Up @@ -119,6 +119,10 @@ inputs:
secure-environment-variables:
description: 'List of secure environment variables for the container. Space seperated values in "key=value" format'
default: ''
network-profile-id:
description: 'ID or name of the network profile'
required: false
default: ''
outputs:
app-url:
description: 'URL of the Deployed Application'
Expand Down
5 changes: 4 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ async function main() {
"osType": taskParams.osType,
"restartPolicy": taskParams.restartPolicy,
"type": "Microsoft.ContainerInstance/containerGroups",
"name": taskParams.containerName
"name": taskParams.containerName,
"networkProfile": taskParams.networkProfileId ? {
"id": taskParams.networkProfileId
} : undefined,
}
let containerDeploymentResult = await client.containerGroups.createOrUpdate(taskParams.resourceGroup, taskParams.containerName, containerGroupInstance);
if(containerDeploymentResult.provisioningState == "Succeeded") {
Expand Down
8 changes: 7 additions & 1 deletion src/taskparameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export class TaskParameters {
private _restartPolicy: ContainerInstanceManagementModels.ContainerGroupRestartPolicy;
private _volumes: Array<ContainerInstanceManagementModels.Volume>;
private _volumeMounts: Array<ContainerInstanceManagementModels.VolumeMount>;
private _networkProfileId: string;

private _subscriptionId: string;

Expand All @@ -45,7 +46,7 @@ export class TaskParameters {
});
}
this._cpu = parseFloat(core.getInput('cpu'));
this._dnsNameLabel = core.getInput('dns-name-label', { required: true });
this._dnsNameLabel = core.getInput('dns-name-label');
this._diagnostics = {}
let logType = core.getInput('log-type');
let logAnalyticsWorkspace = core.getInput('log-analytics-workspace');
Expand Down Expand Up @@ -116,6 +117,7 @@ export class TaskParameters {
let afsAccountName = core.getInput('azure-file-volume-account-name');
let afsShareName = core.getInput('azure-file-volume-share-name');
this._getVolumes(gitRepoVolumeUrl, afsShareName, afsAccountName);
this._networkProfileId = core.getInput('network-profile-id');
}

private _getDiagnostics(logAnalyticsWorkspace: string, logAnalyticsWorkspaceKey: string, logType: string) {
Expand Down Expand Up @@ -323,4 +325,8 @@ export class TaskParameters {
return this._subscriptionId;
}

public get networkProfileId() {
return this._networkProfileId;
}

}